Bug in Invoice Item report for negative invoice

We had a client who paid $300, and then requested a refund of $100. We refunded through IN, and then created a negative adjustment invoice of -$100 to get the account in balance. That all worked well.

But the Invoice Item Report shows the negative invoice (ADJ-0003) twice. I recreated this scenario in our test company, with the same result.

It’s important to us to have accurate reporting on this report because it’s the way we identify which General Ledger buckets our revenue goes into.

Hi,

@david @ben any ideas?

I am unable to recreate this. Can you provide exact steps to reproduce please.

This occurred initially in our live (self-hosted v 5) company, with a credit card payment, refunded through invoice ninja. I recreated the scenario in our test company, with a “check” payment, refunded. The steps were:

  • Created $300 invoice, marked SENT
  • Created check payment $300
  • Account balance shows: PAID TO DATE $300, BALANCE IS $0
  • Created refund $100
  • Account balance shows: PAID TO DATE $200, BALANCE IS $100
  • Created adjustment invoice -$100, marked SENT
  • Account balance shows: PAID TO DATE $200, BALANCE IS $0
    So far so good, everything seems to be working as expected.
  • Invoice report, and Payment report all run correctly.
  • But: Ran INVOICE ITEM Report, and a duplicate copy of the ADJ invoice shows up, see the screenshot in my original post (ADJ-0003 is listed twice).

@debored

Thanks, using your steps, i was still unable to recreate this:

Just to confirm, are you using the latest version ? v5.10.11

We are using 5.10.4.

Just to confirm, you are looking at the Invoice ITEM report, not the Invoice report?

Thank you for trying to figure this out!

@debored

Definitely using the Invoice Item report. Let me know if there is something I am missing in the steps here.

OK, I think I may have isolated the problem. The behavior seems to be associated with an invoice related to, or created immediately after, a partial refund that is created using the MORE ACTIONS menu, as opposed to using the REFUNDS tab on the payment itself. The refunded invoice, OR the next invoice created, shows up in duplicate on the INVOICE ITEM report. Here’s my testing - perhaps this will help you to duplicate it. The common denominator appears to be the way the refund was created. In the first instance, the refunded invoice itself appeared in duplicate, and in the second instance, it was the invoice created immediately after the refund that appeared in duplicate. When I repeated the test, but edited the payment itself to create the refund, there was no problem.

Here’s the reporting, with the incorrect entries circled, and below is documentation of my testing.

I hope this will be helpful to you.

Created a new client: SuperTest
Created a negative invoice 0005: -$50
Marked sent.
Invoice ITEM report is reporting correctly.

Created a negative invoice: -$60
Edited invoice number to be: ADJ-0006
Marked sent.
Invoice ITEM report is reporting correctly.

Created positive invoice 0007: $200
Marked sent.
Invoice ITEM report is reporting correctly.

Paid invoice 0007 with a “check”. Payment 0005.
This invoice balance is now $0.
Invoice ITEM report is reporting correctly.

Created a negative invoice 0008: -$70
Marked sent.
Invoice ITEM report is reporting correctly.

Created a FULL REFUND of payment 005.
Customized columns on INVOICE ITEM report.
Invoice ITEM report is reporting correctly.

Created a negative invoice 0009: -$80
Marked sent.
Invoice ITEM report is reporting correctly.

Created positive invoice 0010: $250
Marked sent
Fully paid invoice 0010 with a “check”, payment 0006.

Created PARTIAL refund by going into the payment detail, selecting the refund tab on the payment 0006, selecting invoice 010, and editing the amount in the bottom field to be $50.

Created a negative invoice 0011: -$50
Marked sent.
Invoice ITEM report is reporting correctly.

Created positive invoice 0012: $300
Marked sent.

Paid invoice 0012 with a “check”. Payment 0007.
This invoice balance is now $0.
Created PARTIAL refund by going to the MORE ACTIONS menu, and selecting refunds, on the payment 0007, selecting invoice 0012, and editing the amount in the bottom field to be $125.
Invoice balance is now $125.
Invoice ITEM report is reporting INCORRECTLY. It is reporting Invoice #0012 in duplicate.

Created positive invoice 0013: $350
Marked sent.
Invoice ITEM report is reporting correctly (with the exception of previous duplicate).
Created negative invoice 0014: -$125
Marked sent.
Marked paid.
Invoice ITEM report is reporting correctly (with the exception of previous duplicate).

Created positive invoice 0015: $500
Marked sent.
Paid invoice 0015 with a “check”. Payment 0009.
This invoice balance is now $0.

Created PARTIAL refund by going to the MORE ACTIONS menu, and selecting refund payment, on the payment 0009, selecting invoice 0015, and editing the refund amount in the bottom field to be $160.
Invoice balance is now $160.
Invoice ITEM report is reporting correctly (with the exception of previous duplicate).

Created a negative invoice 0016: -$160
Marked sent.
Invoice ITEM report is reporting INCORRECTLY. It is reporting Invoice #0016 in duplicate.

Created positive invoice 0017: $600
Marked sent.
Paid invoice 0017 with a “check”. Payment 0010.
This invoice balance is now $0.
Created PARTIAL refund by going into the payment detail, selecting the refund tab on the payment 0010, selecting invoice 0017, and editing the amount in the bottom field to be $200.
Invoice balance is now $200.

Created negative invoice ADJ-0019:- $200
Marked sent.
Invoice ITEM report is reporting correctly (with the exception of previous duplicate).

I am still unable to recreate this. as it is an invoice item report, it will have each line item of the invoice, can you compare the item notes/product/unitcost/quantity for any differences there.

Here’s the Invoice Item report - I’ve hidden columns that aren’t important and highlighted the two “duplicate” rows.


InvoiceItemReportForIN.csv (3.9 KB)

@debored

Thanks, this is helpful. So it appears that each of these invoices has a second line item with a Zero Quantity?

This would explain why you are seeing the doubled up lines. The next question would be, what - exactly - is causing the additional lines to be inserted. If you can pinpoint where the additional line is being added we can localize the issue, from my initial tests again, I’m still unable to recreate.

When I broke down my process and tested each part that I thought might be causing this, it seems to have something to do with creating a partial refund using the MORE ACTIONS menu. In my testing, I ran the Invoice Item report after each step, and the duplicate entries ocurred after that action was taken.

If there’s more testing you want me to do, can you please explain specifically what you are asking me to do?

Otherwise, at least we know what not to do in future, and also what to watch for on the reporting, and perhaps if we see this happen again a pattern will become clearer. But I’m hoping that if we don’t use the MORE ACTIONS menu, we won’t see this happen again.

Thanks for trying to help figure this out.