@@ -, +, @@ --- C4/SIP/ILS.pm | 10 ++++++++-- C4/SIP/ILS/Transaction.pm | 1 + C4/SIP/ILS/Transaction/FeePayment.pm | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) --- a/C4/SIP/ILS.pm +++ a/C4/SIP/ILS.pm @@ -136,6 +136,7 @@ sub checkout { $circ->item( $item = C4::SIP::ILS::Item->new($item_id) ); if ($fee_ack) { $circ->fee_ack($fee_ack); + $circ->registerid($self->{institution}->{policy}->{registerid}); } if ( !$patron ) { @@ -260,9 +261,14 @@ sub end_patron_session { } sub pay_fee { - my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment ) = @_; + my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $registerid) = @_; my $trans = C4::SIP::ILS::Transaction::FeePayment->new(); + if (!defined $registerid) { + syslog('LOG_ERR', 'pay_fee passed undefined tillid'); + $registerid = 0; + } + $trans->transaction_id($trans_id); my $patron; @@ -271,7 +277,7 @@ sub pay_fee { $trans->screen_msg('Invalid patron barcode.'); return $trans; } - my $trans_result = $trans->pay( $patron->{borrowernumber}, $fee_amt, $pay_type, $fee_id, $is_writeoff, $disallow_overpayment ); + my $trans_result = $trans->pay( $patron->{borrowernumber}, $fee_amt, $pay_type, $fee_id, $is_writeoff, $disallow_overpayment, $registerid ); my $ok = $trans_result->{ok}; $trans->ok($ok); --- a/C4/SIP/ILS/Transaction.pm +++ a/C4/SIP/ILS/Transaction.pm @@ -24,6 +24,7 @@ my %fields = ( screen_msg => '', print_line => '', fee_ack => 'N', + registerid => undef, ); our $AUTOLOAD; --- a/C4/SIP/ILS/Transaction/FeePayment.pm +++ a/C4/SIP/ILS/Transaction/FeePayment.pm @@ -49,6 +49,7 @@ sub pay { my $fee_id = shift; my $is_writeoff = shift; my $disallow_overpayment = shift; + my $registerid = shift; my $type = $is_writeoff ? 'WRITEOFF' : 'PAYMENT'; @@ -86,10 +87,11 @@ sub pay { else { my $pay_response = $account->pay( { - amount => $amt, - type => $type, - payment_type => 'SIP' . $sip_type, - interface => C4::Context->interface + amount => $amt, + type => $type, + payment_type => 'SIP' . $sip_type, + interface => C4::Context->interface, + cash_register => $registerid } ); return { --