manage the process of manufacturing bread and distributing it through representatives

How to manage the process of manufacturing bread and distributing it through representatives, deducting the return, recording the debt to the customer, linking it to the representative, and calculating the representative’s percentage