Bug 6273: (follow-up) fix various issues
authorGalen Charlton <gmc@esilibrary.com>
Wed, 30 Apr 2014 17:11:58 +0000 (17:11 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 30 Apr 2014 17:11:58 +0000 (17:11 +0000)
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 <gmc@esilibrary.com>
C4/Accounts.pm
C4/SIP/Sip/MsgType.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt

index fa1ef77..117f8d9 100644 (file)
@@ -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 );
index fceb16b..4bad2ea 100644 (file)
@@ -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);
index ca9c63a..1debd29 100644 (file)
@@ -47,6 +47,9 @@
       <td>
         [% 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
index 58a80fe..c35131d 100644 (file)
@@ -116,6 +116,9 @@ function enableCheckboxActions(){
     <td>
         [% 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
index 47169e8..c26668c 100644 (file)
@@ -42,6 +42,9 @@
                         <td>
                           [% 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