How to aggregate sales order and return trx in the AR interface in order to create a single invoice
The client I am working with, in the sales process, needs to reconcile the shipped quantities to the customer every month. Therefore, after issuing the sales order, they receive confirmation of the quantities actually received by the customer, and in case of any discrepancy with the shipped quantities, a return order is generated for the difference.
Here's a practical example: A sales order is issued and 100 tons are shipped. A check performed by the customer at the destination confirms that the actual quantity received is 80 tons. A shipment of 100 is recorded, followed by a return line of 20.
So, every month, there are as many sales orders as return orders for the same customer. At the end of the month, the autoinvoice process is run for billing.