From c456d0e1a4594ccafe36f1e650fc957a11bb7b9e Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Mon, 24 Nov 2014 10:18:50 -0500
Subject: [PATCH] Bug 13330 - All overdue items with fines returned via
 checkouts table will have fines forgiven!

Due to a disconnect between how booleans are handled in Perl vs JSON,
all checkins done from the checkouts table will have fines forgiven!
This is because the parameters sent to svc/checkin are coded in JSON
and the JSON false is treated in Perl as the string 'false' which
evaluates to true!

Test Plan:
1) Find a patron with an overdue item that has a fine
2) Return the item via the checkouts table on circulation.pl or moremember.pl
3) Note the fine is forgiven
4) Apply this patch
5) Repeat steps 1-2
6) Note the fine is no longer forgiven

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Verified bug, fix corrects the problem.
---
 svc/checkin | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/svc/checkin b/svc/checkin
index 2ca539c..c10a1b8 100755
--- a/svc/checkin
+++ b/svc/checkin
@@ -47,6 +47,10 @@ my $exempt_fine    = $input->param('exempt_fine');
 my $branchcode     = $input->param('branchcode')
   || C4::Context->userenv->{'branch'};
 
+# Expect these inputs to come in as JSON boolean values
+$override_limit = $override_limit ? $override_limit eq 'true' : undef;
+$exempt_fine    = $exempt_fine    ? $exempt_fine eq 'true'    : undef;
+
 my $barcode = GetBarcodeFromItemnumber($itemnumber);
 
 my $data;
-- 
1.9.1