How does PostAR link back to an invoice and which table holds the discount given on payments?
I know that invnum holds the invoice details
I'm looking for payments, as well as the discount given on payments.
The PostAR table links to InvNum on PostAR.InvNumKey = InvNum.AutoIndex
Correct, the invoice header information is on the InvNum table, while the invoice line details are on _btblInvoiceLines.
Discount information is on the InvNum table for document level discounts, and _btblInvoiceLines for line level discounts