Hi Fatima
I know EXACTLY what you're asking as I have the same requirement.
Did you get a solution?
I have several ideas on how it cd be achieved but the big questions are:
I assume the correction shd be triggered as the settlement/payment of the invoice(s) is made and the cash discount is claimed?
What if multiple invoices are being settled with a single payment?
1. Should there be one corrective invoice per invoice paid, containing debit/credit lines for each invoice line netting to the credit cash discount allowed for that material line or
2. Should there be a single debit/credit line for each invoice total or
3. Should there be a single debit/credit line summarizing all invoice totals?
Hope to compare notes soon!