From 0456f6ade08d3d741d5da6eb912c0f40e08deb8b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 30 Apr 2014 17:11:58 +0000 Subject: [PATCH] Bug 6273: (follow-up) fix various issues This patch fixes various issues that prevented the account type from being set correctly when recording SIP2 payments: - the fixed fields in the fee paid message were not getting parsed correclty - accountlines.accounttype is only five characters wide, so SIP2 payments are now records as 'Pay00', 'Pay02', etc. rather than 'Pay-00'. - removed regression on bug 2546 and made the new payment types translatable Signed-off-by: Galen Charlton --- C4/Accounts.pm | 8 +++----- C4/SIP/Sip/MsgType.pm | 2 +- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 3 +++ koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt | 3 +++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index fa1ef770f9..117f8d902b 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -147,14 +147,12 @@ sub recordpayment { my $usth = $dbh->prepare( "INSERT INTO accountlines (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) - VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)" + VALUES (?,?,now(),?,'',?,?,?)" ); - my $payment_description = "Payment, thanks"; - $payment_description .= " (via SIP2)" if defined $sip_paytype; my $paytype = "Pay"; - $paytype .= "-$sip_paytype" if defined $sip_paytype; - $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, $payment_description, $paytype, 0 - $amountleft, $manager_id ); + $paytype .= $sip_paytype if defined $sip_paytype; + $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, $paytype, 0 - $amountleft, $manager_id ); $usth->finish; UpdateStats( $branch, 'payment', $data, '', '', '', $borrowernumber, $nextaccntno ); diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index fceb16b302..4bad2ea0ec 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -1054,7 +1054,7 @@ sub handle_end_patron_session { sub handle_fee_paid { my ($self, $server) = @_; my $ils = $server->{ils}; - my ($trans_date, $fee_type, $pay_type, $currency) = $self->{fixed_fields}; + my ($trans_date, $fee_type, $pay_type, $currency) = @{ $self->{fixed_fields} }; my $fields = $self->{fields}; my ($fee_amt, $inst_id, $patron_id, $terminal_pwd, $patron_pwd); my ($fee_id, $trans_id); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index ca9c63a281..1debd29b56 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -47,6 +47,9 @@ [% SWITCH account.accounttype %] [% CASE 'Pay' %]Payment,thanks + [% CASE 'Pay00' %]Payment,thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment,thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment,thanks (credit card via SIP2) [% CASE 'N' %]New Card [% CASE 'F' %]Fine [% CASE 'A' %]Account management fee diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 58a80fe8f6..c35131d4c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -116,6 +116,9 @@ function enableCheckboxActions(){ [% SWITCH line.accounttype %] [% CASE 'Pay' %]Payment,thanks + [% CASE 'Pay00' %]Payment,thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment,thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment,thanks (credit card via SIP2) [% CASE 'N' %]New Card [% CASE 'F' %]Fine [% CASE 'A' %]Account management fee diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt index 47169e872b..c26668c683 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt @@ -42,6 +42,9 @@ [% SWITCH ACCOUNT_LINE.accounttype %] [% CASE 'Pay' %]Payment,thanks + [% CASE 'Pay00' %]Payment,thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment,thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment,thanks (credit card via SIP2) [% CASE 'N' %]New Card [% CASE 'F' %]Fine [% CASE 'A' %]Account management fee -- 2.39.5