I need to confirm if this is a bug in CU8. In order to reproduce this error, I just create a Purchase Line, and I apply a Line Discount and also a Line Percent Discount. So for example I Line Discount 2 euros and also apply a 10% discount in the same line.
The invoice is correct, net price, etc. However, when I go to see the General Ledger records that have been created, there is a mess, the amounts registered at ledger level are not equivalent to the Invoice Amounts.
We started debugging this issue, and found that in CU8 there has been a total redesign of class "VendorInvoiceLineSourceDocLineItem" method "calculateSourceDocumentAmountMap"
Here we have a variable called a actualDiscountAmount, that is now (CU8 SYP layer) calculated with this code:
actualDiscountAmount = -Currency::amount( (vendInvoiceLineMap.Qty * vendInvoiceLineMap.pdsPurchPrice() * vendInvoiceLineMap.discPercent()) / (100 * (vendInvoiceLineMap.PriceUnit ? vendInvoiceLineMap.PriceUnit : 1.0)), vendInvoiceLineMap.CurrencyCode);
Nothing to do with the calculation in SYS layer. I think the problem is that LineDisc is not included in this calculation, but would like to confirm with you community members before making changes to the standard code.
Thanks!
*This post is locked for comments