Commits
Marek Vsechovsky committed 9571e799502
Session 144, Step 63: Fix invoice item pricing, affiliate reward formula, and invoice detail overlay - AIM-2774 Add invoice detail overlay in affiliate portal My ledger - AIM-2809 Fix InvoiceAmount and InvoiceItemQty using Aisman-set values instead of actual Paddle quantities for one-off items - AIM-2820 Fix affiliate reward calculation to use tax-exclusive originalPrice Outcome: - AIM-2774: the invoice overlay now renders catalogue-priced items, the upgrade pro-rata discount line, and Subtotal / Discount (percent) / Tax / Total paid rows with a matching header total; ghost rows are removed. - AIM-2809: tier InvoiceItemUnitPrice stores the catalogue price, the upgrade pro-rata discount InvoiceCustomItem is auto-created, the Invoice/AffiliateLedger relationship is reversed (new SQL script 119), InvoiceAffiliate is removed, and InvoiceNetTotal follows subtotal − discount − fee − ALedgerAmount. - AIM-2820: affiliate reward = (tax-exclusive subtotal − fee) × share − discount; the reported example verifies to 10.87.