Hi,
I have recently written a query report in erpnext which is a report based on sales invoice, basically this report shows the list of all the invoices pending for payments. Now I have added a column which shows the total amount of invoices pending with respect to a customer and the report works fine, but for certain customers this total column is not calculating the amounts properly.
The link for the report code is
here.
The problem being faced with the report is enclosed in the screenshots, if you see that the total pending column is taking the total of someone else as well, can some one please help me debug this issue as it is only happening with a very few accounts only in the whole list.