Step to reproduce the bug:
1) Create a payment term with two separated due type:
-Due type 1: percent , value 30, numbers of days: 0 days after the invoice date
-Due type 2: Balance; value 0, Number of days 0: Last day of following month
2) Create an invoice with the payment term
3) Refund the invoice with the option "cancel: create refund and reconcile"
or "Modify: create refund, reconcile and create a new draft invoice".
4) Error message: "You are trying to reconcile some entries that are already reconciled!"
But no payment had been received and the receivable accounts were still open.
opw:694386