LP#1942220: (follow-up) API: remove cancel reason if last LID of LI is received
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 13 Jan 2022 19:35:00 +0000 (14:35 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 13 Jan 2022 19:35:00 +0000 (14:35 -0500)
Otherwise, a sequence where a line item was cancelled but one of
its items was received would have the LI end up in a received
state but with a cancel reason.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm

index 100be39..010036a 100644 (file)
@@ -623,6 +623,7 @@ sub check_lineitem_received {
 
     my $li = $mgr->editor->retrieve_acq_lineitem($li_id);
     $li->state('received');
+    $li->clear_cancel_reason; # un-cancel on receive
     return update_lineitem($mgr, $li);
 }