I run in to some issue with the CashDiscount when using payment schedule.
As far as I can tell it is a bug in the PaymSchedCalc class method createCustVendTransaction.
In that method it calculates the baseAmountCashDisc using the amount of the transaction minus total invoice tax instead of the tax portion that should be used according to payment schedule.
For example,
Invoice amount 300 (Incl tax)
Total tax 30
CashDisc 4% if payed in 90 days.
Schedule 3 terms 90 days
Results in transactions of:
Amount 100
CashDiscount 2,8 ((100 - 30) * 4%)
Amount to settle 97,02
Did I notice correcty or did I mis some setting?