Contract with suppliers

Hey guys
I need to create a module (or modify it) for contracts with suppliers to supply materials to my company, where I can link material deliveries (purchases).
That accept partial deliveries. For each delivery, the amount linked to the contract is reduced.
It’s possible?

There is already a purchase orders module that can accept partial delivery of orders. And you can attach a purchase order to a project, where the project will be the alternative to a contract.