From 6cc55a0032be0bd2a8f0d7d4c5dc264c18b3fddd Mon Sep 17 00:00:00 2001
From: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Date: Sun, 9 Sep 2018 23:22:18 +0200
Subject: [PATCH] Bug 21326: C4::SIP::ILS add missing branch param

ILS::Transaction was missing branch param for unknown reason.
Since every transactions needs a branch, it makes sense to include it in
the object and allow as param.

This patch only adds the param to the object and ILS->checkout so it
can be used in submodules.
---
 C4/SIP/ILS.pm             | 4 +++-
 C4/SIP/ILS/Transaction.pm | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm
index 1bd23c6..4db34ef 100644
--- a/C4/SIP/ILS.pm
+++ b/C4/SIP/ILS.pm
@@ -126,7 +126,7 @@ sub offline_ok {
 # the response.
 #
 sub checkout {
-    my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack ) = @_;
+    my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $branch ) = @_;
     my ( $patron, $item, $circ );
 
     $circ = C4::SIP::ILS::Transaction::Checkout->new();
@@ -134,6 +134,8 @@ sub checkout {
     # BEGIN TRANSACTION
     $circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) );
     $circ->item( $item     = C4::SIP::ILS::Item->new($item_id) );
+    $circ->branch( $branch );
+
     if ($fee_ack) {
         $circ->fee_ack($fee_ack);
     }
diff --git a/C4/SIP/ILS/Transaction.pm b/C4/SIP/ILS/Transaction.pm
index 011aa98..6580329 100644
--- a/C4/SIP/ILS/Transaction.pm
+++ b/C4/SIP/ILS/Transaction.pm
@@ -15,6 +15,7 @@ my %fields = (
 	ok            => 0,
 	patron        => undef,
 	item          => undef,
+	branch        => undef,
 	desensitize   => 0,
 	alert         => '',
 	transaction_id=> undef,
@@ -23,7 +24,7 @@ my %fields = (
 	sip_currency  => 'USD', # FIXME: why hardcoded?
 	screen_msg    => '',
 	print_line    => '',
-    fee_ack       => 'N',
+	fee_ack       => 'N',
 );
 
 our $AUTOLOAD;
-- 
2.1.4