Detecting and deleting positive/negative payment pairs (invoice number missing) — KNIME workflow ...

I built a workflow to process a payments report and ran into the following situation. I have the columns: invoice number, amount collected, invoice handover date, invoice payment date, and invoice code.

If I identify a positive payment with the same invoice number, date, and amount that matches a negative payment, the two entries should be deleted (they cancel each other out) — for example: a negative payment of -200 RON and a positive payment of +200 RON sum to zero.

Next: if I identify positive payments with the same date and amount that match negative payments but they do NOT have an invoice number, I will check the columns “Handover Date,” “Payment Date,” and “Invoice Code” to confirm they belong to the same case. If they do, the two payments should be deleted.