We have a vendor that gives us a 2% discount except for the freight on an invoice. Right now the system is taking 2% across the board. The freight is setup as a Charge(Item). Is there any way to exclude this from the discounting process? Thanks.
At this point I just made a function that scans the current payment journal:
It goes through each line, then looks for any FRT(Frieght) lines on that invoice. If so it adds back the 2% it took off on the amount. This isn’t ideal but since I don’t have a developer license I can’t modify the codeunit that determines what discount to take.
// Loop through the payment journals
PaymentJournal.SETFILTER(“Journal Template Name”,‘PAYMENTS’);
PaymentJournal.SETFILTER(“Journal Batch Name”,CurrentJnlBatchName);
IF PaymentJournal.FINDFIRST THEN BEGIN
// Loop through the payment invoice lines and look for freight
PurchInvoiceLine.SETFILTER(“Document No.”, PaymentJournal.“Applies-to Doc. No.”);
IF PurchInvoiceLine.FINDFIRST THEN BEGIN
PaymentJournal.Amount += ROUND((PurchInvoiceLine.Amount * 0.02),0.01);
UNTIL PurchInvoiceLine.NEXT = 0;
It isn’t an invoice discount it is a payment discount. So if we pay before X, we can take two percent off everything except Freight. It isn’t that the invoice is entered wrong, it just depends on how much we owe when we pay it. Make sense?
In such case you still can use standart Payment Discount functionality, to avoid discounting the freight you can create TWO POs, one for merchandise, another for freight, and set Payment discount along with its effective date in the first one only.
ChargeItems can be applied to another Invoice’s lines, not only the same where it sits, so no problems here. Disadvantage is, you need 2 separate POs, but otherwise everything works without modifications.
Decide yourself, what fits you better - a small additional work creating & applying charges in additional PO, or ordering modifications. Besides, mod will not be as simple as you supposed in your post, as such approach may cause problems with accurate costing. Without detailed analysis, I can’t suggest for sure, but I would look toward modifying that part in PO dealing with Payment Discount, as standart really allows only % of WHOLE Inv. amt.