Hello everyone - I'm currently running a search to...
# general
f
Hello everyone - I'm currently running a search to retrieve some data regarding invoices, the issue I'm facing is when trying to retrieve the payment amount of an invoice. If the payment applied to that invoice also has another invoice applied to it, it will retrieve the sum of both lines instead of the corresponding amount. this is the way I'm trying to achieve it: How can I fix it?
c
It seems that your Formula is summing {applyingtransaction.paiddamount} across all lines, causing double-counting when payments split across invoices. Fix it by using a CASE statement to isolate the payment for the current invoice: CASE WHEN {applyingtransaction.internalid} = {internalid} THEN {applyingtransaction.paiddamount} ELSE 0 END.