When we are sending a bill to MYOB Essentials, they expect it to have line items. Every line item contains a unit price, quantity and the ID of its tax rate. This means we are neither sending the tax amount nor the total amount to MYOB Essentials. Calculation of the tax amount is done by their system based on the sent ID. Total amount is also calculated by them based on the unit price and the quantity of each line item. The unit price sent by us calculated via a simple formula - line_item.total_amount / line_item.quantity
. As you can notice the unit price is not affected by the net amount but only the total. This means every line item generated by us has to contain information for 3 attributes - total amount, quantity, tax rate ID.
Used terminology:
- used_defined_lines - line items defined by the user in the monolith interface