ACQ lineitems canceled via EDI not deleting linked bibs/items

Bug #1269574 reported by Bill Erickson
80
This bug affects 17 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

Evergreen 2.4+

When a lineitem is canceled via the ACQ UI, real copies (acp's) and call numbers (acn's) which were created as a result of the lineitem are deleted when the lineitem is permanently canceled. Similarly, there is an org unit setting "cat.bib.delete_on_no_copy_via_acq_lineitem_cancel", which tells the ACQ backend to delete the catalog record (bre) created from the lineitem if the record no longer has any viable copies.

However, when cancellation occurs via EDI, none of this cleanup takes place. It should.

Revision history for this message
Bill Erickson (berick) wrote :

For additional reference, the UI relies on the open-ils.acq.lineitem_detail.cancel API, while EDI performs the cancellations manually / directly on the lineitems / lineitem details.

Revision history for this message
Kathy Lussier (klussier) wrote :

Adding a comment on some additional places in the acq UI that is not deleting line items when it should or deleting line items when it shouldn't:

If you mark a lineitem temporarily canceled (e.g. backordered) through the UI, the real copies are deleted. These copies should not be deleted when the cancellation reason is configured to keep debits.

Alternatively, if you mark an acq copy permanently cancelled through the copies UI, the real copes are not deleted. These copies should be deleted.

Kathy Lussier (klussier)
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Christine Burns (christine-burns) wrote :

If you mark an acq copy permanently cancelled through the copies UI, the real copes are not being deleted. These copies should be deleted.

Additionally, once the copies are deleted, In the selection list and PO view interfaces, beside the lineitem ID #, we now also display the number of catalog copies already owned at or below the ordering agency for the bib record in question. This # should not include the deleted copies (currently it does not update once the copies are cancelled).

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Just wanted to add a link to bug 1175740, whose solution includes a prompt to the user during lineitem deletion as to whether or not to keep or delete the associated copies. This may not be directly applicable, especially to the EDI-level issue, but I thought it was worth mentioning for posterity's sake.

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello, I'm trying to understand what needs to be done to fix this.

open-ils.acq.lineitem_detail.cancel - Doesn't delete copies itself... maybe it should though?

open-ils.acq.lineitem.cancel - Calls the open-ils.acq.lineitem_detail.cancel function, and then deletes copies/volumes and bibs and holds as the next step.

Does the situation come up in real life where only some of the copies are canceled and others are not? In my limited experience I've only seen entire line items canceled, with all copies. It would be nice to just be able to use the open-ils.acq.lineitem.cancel which would handle removing the copies/volumes/bibs/holds.

If not, then the deleting copies, volumes, bibs and holds needs to move to open-ils.acq.lineitem_detail.cancel. It would only delete volumes, bibs, and holds if the current lineitem_detail is the last record for that volume/bib. This might fix some of the other situations where copies are not removed, if the problem is that in those cases just one lineitem_detail is being deleted.

Or maybe there is a better approach?

Josh

Revision history for this message
Christine Burns (christine-burns) wrote :

Hello

In my experience the entire line item is cancelled will all copies.

In my experience this situation does not occur "where only some of the copies are canceled and others are not?"

Common situation

- User Loads MARC Order Records -> Load Items for Imported Records is checked
- upload is slow or import error causes User to believe the upload failed -> Purchase Order is created and sitting in pending status -> items are loaded on-order copies appear in the cataloge

- User attempts to load the order again (sometimes multiple times) -> duplicate orders / duplicate copies created

Example MARC order records were upload 4 times -> 4 PO's created

1 PO activated
3 PO delete selected items -> PO empty has no line items -> Check catalogue -> Bib record still shows 4 on-order copies -> need to manually delete 3 extra copies

Desired behavior = When a lineitem is canceled/deleted via the ACQ UI, real copies (acp's) and call numbers (acn's) which were created as a result of the lineitem are deleted when the lineitem is permanently canceled / deleted

MARC order records were upload 4 times

1 PO was activated
3 PO were cancelled

4 Line items still exist in the catalogue.

When a lineitem is canceled via the ACQ UI, real copies (acp's) and call numbers (acn's) which were created as a result of the lineitem are deleted when the lineitem is permanently canceled. --> this is not happening??

Manually delete all line items from the catalogue

Revision history for this message
Chris Sharp (chrissharp123) wrote :

I just opened bug 1730764 to address Kathy's first point in comment #2, FYI.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

I am unable to reproduce the problem described in Kathy's second point in current master. When I permanently cancel (select a cancel reason that does not keep debits), copies are deleted as expected. If it's still happening, I believe it should be considered as separate bug report, so the original problem specific to EDI cancellation can be addressed here.

Changed in evergreen:
assignee: nobody → Chris Sharp (chrissharp123)
Revision history for this message
Chris Sharp (chrissharp123) wrote :

My initial attempt to fix the originally-reported issue:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/csharp/lp1269574_delete_acq_copies_via_edi

Testing will require mocking up an EDI ORDRSP file that cancels the lineitems.

Many thanks to Bill Erickson and Mike Rylander for assistance with this!

Changed in evergreen:
milestone: none → 3.next
Revision history for this message
Chris Sharp (chrissharp123) wrote :

After running my fix in comment #9, we found that EDI ORDRSP messages were failing. Obviously something needs repair.

tags: added: acq-edi acq-lineitem
Changed in evergreen:
assignee: Chris Sharp (chrissharp123) → nobody
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.