From: Bill Erickson <berick@esilibrary.com> Date: Tue, 4 Dec 2012 15:00:26 +0000 (-0500) Subject: EDI: ensure lineitem 'state' matches cancel state X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f51e4fdbdebfc716d46c1e116f20120f3a2a6912;p=evergreen%2Fmasslnc.git EDI: ensure lineitem 'state' matches cancel state When cancelling a lineitem becuase all linked copies are cancelled, ensure that the lineitem state is set to "cancelled". Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm index dbabd2550d..09b6ce2d2f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm @@ -543,7 +543,10 @@ sub process_parsed_msg { $lids_cancelled += $cancel_count; # if ALL the items have the same cancel_reason, the LI gets it too - $li->cancel_reason($eg_reason->id) if $qty_count == $lid_count; + if ($qty_count == $lid_count) { + $li->cancel_reason($eg_reason->id); + $li->state("cancelled"); + } $li->edit_time('now'); unless ($e->update_acq_lineitem($li)) { @@ -604,8 +607,11 @@ sub process_parsed_msg { # All LIDs cancelled with same reason, apply # the same cancel reason to the lineitem - $li->cancel_reason($reason->id) if $remaining_lids == $order_qty; - + if ($remaining_lids == $order_qty) { + $li->cancel_reason($reason->id); + $li->state("cancelled"); + } + $li->edit_time('now'); unless ($e->update_acq_lineitem($li)) { $logger->error("EDI: update_acq_lineitem failed " . $e->die_event);