Invoice display issue with multiple instances of one line item

Bug #1998511 reported by Tiffany Little
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

Seen in the wild on our 3.8 production server.

Library ordered 5 copies of an item. On the resulting invoice, the vendor split up the quantity onto two lines--one line with 2 copies, and one line with the other 3 copies. Both referenced the same original line item.

On looking at the invoice in Evergreen, only one line appeared, the line with 2 copies. Upon trying to adjust the quantity to 5 and update the Cost/Billed with the total amount for all 5 copies, once clicking Save you get a popup error of "Acq Invoice Entry Count Exceeds Debits."

Looking at the EDI message that created the invoice, I confirmed that the EDI invoice also had the 5 copies split out into different LINs, both referencing the same line item. It was like because it was the same line item ID, it couldn't display both at the same time.

Going back to the invoice UI, I detached the line item and saved. And when it reloaded, there was the *other* instance of the same line item.

So the bug would be that if a vendor splits quantity across lines on an invoice, if they're referencing the same line item then EG can only display one at a time. I wasn't able to initially increase the quantity to 5 because under the hood both instances of the line item existed and there were 5 fund debits--unwittingly I was trying to artificially increase it to 8 so I got the error.

For anyone who stumbles on this bug, the solution to this is to just detach the line item entirely from the invoice until it no longer appears, then reattach and adjust the quantity and prices to match the printed invoice. (Don't try to duplicate the line item twice on your EG invoice, just have it on there once and update it to reflect the total cost and quantity for the title from the printed invoice.)

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Galen Charlton (gmc) wrote (last edit ):

Confirmed this bug by constructing an invoice using SQL that had two invoice entries for the same line item.

Culprit is around line 882 in Open-ILS/web/js/ui/default/acq/invoice/view.js:

    if(dojo.query('[lineitem=' + entry.lineitem() +']', entryTbody)[0])
        // Is it ever valid to have multiple entries for 1 lineitem in a single invoice?
        return;

Superficially, it works if you take out these three lines: both invoice entries appear, you can adjust their counts and amounts individually, and you can detach them individually. (Caveat: I'm not claiming to have tested thoroughly.)

On the face of it, while it's not parsimonious, I don't see an inherent conceptual problem with multiple invoice entries on the same invoice pointing at the same line item so long as the total count of line item copies invoiced doesn't exceed the number ordered.

Revision history for this message
Tiffany Little (tslittle) wrote :

I agree that I don't see an issue with having multiple invoice entries on the same invoice going to the same line item. It also better reflects the printed invoice you may receive from a vendor, thus reducing the above confusion.

Revision history for this message
Tiffany Little (tslittle) wrote :

General consensus from the January AIG meeting was that we think if there are multiple instances of one line item then all instances should display, to better replicate what you see on the printed invoice from the vendor.

Revision history for this message
Christine Morgan (cmorgan-z) wrote :

We are also seeing this issue on 3.7.2

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.