Browse Source

Bug 24828: Add ability to specify cash register in SIP config

This patch adds the ablity to specify a cash register id to link to
payments taken via SIP2 clients.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Martin Renvoize 3 years ago
parent
commit
b772d1fd3d
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 4
      C4/SIP/ILS.pm
  2. 10
      C4/SIP/ILS/Transaction/FeePayment.pm
  3. 3
      C4/SIP/Sip/MsgType.pm
  4. 3
      etc/SIPconfig.xml

4
C4/SIP/ILS.pm

@ -260,7 +260,7 @@ 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, $register_id) = @_;
my $trans = C4::SIP::ILS::Transaction::FeePayment->new();
@ -271,7 +271,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, $register_id );
my $ok = $trans_result->{ok};
$trans->ok($ok);

10
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 $register_id = 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 => $register_id
}
);
return {

3
C4/SIP/Sip/MsgType.pm

@ -1092,6 +1092,7 @@ sub handle_fee_paid {
my $disallow_overpayment = $server->{account}->{disallow_overpayment};
my $payment_type_writeoff = $server->{account}->{payment_type_writeoff} || q{};
my $register_id = $server->{account}->{register_id};
my $is_writeoff = $pay_type eq $payment_type_writeoff;
@ -1104,7 +1105,7 @@ sub handle_fee_paid {
$ils->check_inst_id( $inst_id, "handle_fee_paid" );
my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment );
my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $register_id );
$status = $pay_result->{status};
my $pay_response = $pay_result->{pay_response};

3
etc/SIPconfig.xml

@ -58,7 +58,8 @@
ae_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]"
hide_fields="BD,BE,BF,PB">
hide_fields="BD,BE,BF,PB"
register_id=''>
<screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
<screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
<patron_attribute field="XY" code="CODE" />

Loading…
Cancel
Save