I have 5 tables:
A. invoices (many invoices from each vendor).
B to E. Advance payments, packaging, and other amounts they should deduct from the total in A.
I want to consolidate the total to pay, per vendor, after discounts (A-(B+C+D+E)), and have ...