Discount terms - ideas?

I think this post will help you solve it. Payment Entry - Deductions/Loss not working - #12 by FinForce

In brief, just check in your allocation amount (in last column) amount should be equal to your Sales Invoice and the amount of discount given should be shown as -ve amount under deduction table. So the total of (i) allocation table & (ii) deduction table equal to the payment Received.