From 8403ec3095c79df46029ff16de05b39b0bb59a74 Mon Sep 17 00:00:00 2001 From: Michele Morgan Date: Wed, 23 May 2018 13:54:28 -0400 Subject: [PATCH] LP#1511765 Fix error when checking in with zero-balance lost OU setting enabled Fixes an error generated when checking in Lost/Long Overdue/Lost and Paid items with no associated circ when the org unit setting circ.checkin.lost_zero_balance.do_not_change is set to TRUE Items can attain this state from migration, or when the associated circ has been aged. Signed-off-by: Michele Morgan Signed-off-by: Kyle Huckins Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 73d69efda6..7a2958a3ad 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -2678,7 +2678,8 @@ sub do_checkin { $copy_circ_lib, 'circ.checkin.lost_zero_balance.do_not_change', $self->editor) || 0; - if ($dont_change_lost_zero) { + # Don't assume there's always a circ based on copy status + if ($dont_change_lost_zero && $self->circ) { my ($obt) = $U->fetch_mbts($self->circ->id, $self->editor); $dont_change_lost_zero = 0 if( $obt and $obt->balance_owed != 0 ); } -- 2.11.0