A few things to note about orders before we get started:
An individual Order can have one or more Shipments.
An individual Shipment can have only one Invoice.
An individual Invoice can have one or more Payments.
An individual Order can optionally have a Deposit, whose Payment(s) can be applied to any Shipment's Invoice.
🤨 Confused? Let's break that down.
Seller: Order 111 has a single Shipment A. Shipment A has a single Invoice 111-A.
Buyer: Customer receives Invoice 111-A and pays for the order in full.
Seller: Order 222 has a Shipment A going out right now, and a Shipment B going out in a month. Shipment A has a single Invoice 222-A, Shipment B has a single Invoice 222-B. There's also a single Deposit D-222.
Buyer: Customer receives a request for Deposit D-222, which they pay in full according to the deposit's payment terms. When Shipment A is ready, the customer receives Invoice 222-A, with all, some, or none of the funds from Deposit D-222 credited (per seller's discretion). Customer pays Invoice 222-A per its included payment terms. Finally, when Shipment B is ready, the customer receives Invoice 222-B, credited with the balance (if any) from Deposit D-222. This final invoice is paid in full, per its included terms, and the order is considered paid in full.
Most orders will usually lie somewhere between these two examples in terms of complexity.