From da6c0bcb437f3603c8ebbfe412f8265191452d29 Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Thu, 5 Oct 2017 08:32:10 -0400 Subject: [PATCH] Bug 5620 - (Rebase) - Collect payment mode in staff interface --- C4/SIP/ILS/Transaction/FeePayment.pm | 4 ++-- Koha/Account.pm | 6 +++--- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 6 ++++++ .../intranet-tmpl/prog/en/modules/members/paycollect.tt | 12 ++++++++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt | 6 ++++++ members/paycollect.pl | 14 +++++++++++--- opac/opac-account-pay-paypal-return.pl | 2 +- 7 files changed, 41 insertions(+), 9 deletions(-) diff --git a/C4/SIP/ILS/Transaction/FeePayment.pm b/C4/SIP/ILS/Transaction/FeePayment.pm index fe49197..96ce291 100644 --- a/C4/SIP/ILS/Transaction/FeePayment.pm +++ b/C4/SIP/ILS/Transaction/FeePayment.pm @@ -61,7 +61,7 @@ sub pay { $account->pay( { amount => $amt, - sip => $sip_type, + mode => $sip_type, type => $type, lines => [$fee], } @@ -76,7 +76,7 @@ sub pay { $account->pay( { amount => $amt, - sip => $sip_type, + mode => $sip_type, type => $type, } ); diff --git a/Koha/Account.pm b/Koha/Account.pm index 9ec1c1b..7d00620 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -50,7 +50,7 @@ This method allows payments to be made against fees/fines Koha::Account->new( { patron_id => $borrowernumber } )->pay( { amount => $amount, - sip => $sipmode, + mode => $mode, note => $note, library_id => $branchcode, lines => $lines, # Arrayref of Koha::Account::Line objects to pay @@ -63,7 +63,7 @@ sub pay { my ( $self, $params ) = @_; my $amount = $params->{amount}; - my $sip = $params->{sip}; + my $mode = $params->{mode}; my $note = $params->{note} || q{}; my $library_id = $params->{library_id}; my $lines = $params->{lines}; @@ -176,7 +176,7 @@ sub pay { my $account_type = $type eq 'writeoff' ? 'W' - : defined($sip) ? "Pay$sip" + : defined($mode) ? "Pay$mode" : 'Pay'; my $description = $type eq 'writeoff' ? 'Writeoff' : q{}; 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 ec79237..227d763 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -89,6 +89,12 @@ $(document).ready(function() { [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) + [% CASE 'Pay03' %]Payment, thanks (cash) + [% CASE 'Pay04' %]Payment, thanks (credit card) + [% CASE 'Pay05' %]Payment, thanks (debit) + [% CASE 'Pay06' %]Payment, thanks (check) + [% CASE 'Pay07' %]Payment, thanks (cryptocurrency) + [% CASE 'Pay08' %]Payment, thanks (PayPal) [% CASE 'N' %]New card [% CASE 'F' %]Fine [% CASE 'A' %]Account management fee diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index a1458b5..90a2fea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -147,6 +147,18 @@ function moneyFormat(textObj) { +
  • + + +
  • diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt index a868d0f..8a5a4d9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -109,6 +109,12 @@ [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) + [% CASE 'Pay03' %]Payment, thanks (cash) + [% CASE 'Pay04' %]Payment, thanks (credit card) + [% CASE 'Pay05' %]Payment, thanks (debit) + [% CASE 'Pay06' %]Payment, thanks (check) + [% CASE 'Pay07' %]Payment, thanks (cryptocurrency) + [% CASE 'Pay08' %]Payment, thanks (PayPal) [% CASE 'N' %]New card [% CASE 'F' %]Fine [% CASE 'A' %]Account management fee diff --git a/members/paycollect.pl b/members/paycollect.pl index f880f57..45e7fc9 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -70,6 +70,7 @@ my $writeoff = $input->param('writeoff_individual'); my $select_lines = $input->param('selected'); my $select = $input->param('selected_accts'); my $payment_note = uri_unescape scalar $input->param('payment_note'); +my $paymode = $input->param('paymode') || undef; my $accountlines_id; if ( $individual || $writeoff ) { @@ -123,7 +124,8 @@ if ( $total_paid and $total_paid ne '0.00' ) { lines => [$line], amount => $total_paid, library_id => $branch, - note => $payment_note + note => $payment_note, + mode => $paymode, } ); print $input->redirect( @@ -154,13 +156,19 @@ if ( $total_paid and $total_paid ne '0.00' ) { amount => $total_paid, lines => \@lines, note => $note, + mode => $paymode, } ); } else { my $note = $input->param('selected_accts_notes'); - Koha::Account->new( { patron_id => $borrowernumber } ) - ->pay( { amount => $total_paid, note => $note } ); + Koha::Account->new( { patron_id => $borrowernumber } )->pay( + { + amount => $total_paid, + note => $note, + mode => $paymode, + } + ); } print $input->redirect( diff --git a/opac/opac-account-pay-paypal-return.pl b/opac/opac-account-pay-paypal-return.pl index 64292d4..4b36ce7 100755 --- a/opac/opac-account-pay-paypal-return.pl +++ b/opac/opac-account-pay-paypal-return.pl @@ -104,7 +104,7 @@ if ( $response->is_success ) { { amount => $amount, lines => \@lines, - note => 'PayPal' + mode => '08', } ); } -- 2.7.4