Bugzilla – Attachment 89461 Details for
Bug 22610
SIP Payment Types should be moved out of accountype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22610: Update SIP2 to use payment_type
Bug-22610-Update-SIP2-to-use-paymenttype.patch (text/plain), 6.39 KB, created by
Martin Renvoize (ashimema)
on 2019-05-08 11:19:42 UTC
(
hide
)
Description:
Bug 22610: Update SIP2 to use payment_type
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-05-08 11:19:42 UTC
Size:
6.39 KB
patch
obsolete
>From 8bff366e1565403949cf86d77ea208c6ac039ea2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 24 Apr 2019 14:22:35 +0100 >Subject: [PATCH] Bug 22610: Update SIP2 to use payment_type > >The SIP2 interface has long used a set of accounttypes to denote payment >types. Now we have an authorised list of payment_types and a >payment_type field in accountlines this patch alters the logic to use >it. >--- > C4/Reserves.pm | 1 - > C4/SIP/ILS/Transaction/FeePayment.pm | 20 +++++++++---------- > Koha/Account.pm | 14 +++---------- > .../prog/en/includes/accounts.inc | 3 --- > .../bootstrap/en/includes/account-table.inc | 3 --- > 5 files changed, 13 insertions(+), 28 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 5fc68f1359..c767bb3248 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -576,7 +576,6 @@ sub ChargeReserveFee { > user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, > library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, > interface => C4::Context->interface, >- sip => undef, > invoice_type => undef, > type => 'reserve', > item_id => undef >diff --git a/C4/SIP/ILS/Transaction/FeePayment.pm b/C4/SIP/ILS/Transaction/FeePayment.pm >index de0c22b412..943176456d 100644 >--- a/C4/SIP/ILS/Transaction/FeePayment.pm >+++ b/C4/SIP/ILS/Transaction/FeePayment.pm >@@ -50,7 +50,7 @@ sub pay { > my $is_writeoff = shift; > my $disallow_overpayment = shift; > >- my $type = $is_writeoff ? 'writeoff' : undef; >+ my $type = $is_writeoff ? 'writeoff' : 'payment'; > > warn("RECORD:$borrowernumber::$amt"); > >@@ -65,11 +65,11 @@ sub pay { > if ( $fee ) { > $account->pay( > { >- amount => $amt, >- sip => $sip_type, >- type => $type, >- lines => [$fee], >- interface => C4::Context->interface >+ amount => $amt, >+ type => $type, >+ payment_type => 'SIP' . $sip_type, >+ lines => [$fee], >+ interface => C4::Context->interface > } > ); > return 1; >@@ -81,10 +81,10 @@ sub pay { > else { > $account->pay( > { >- amount => $amt, >- sip => $sip_type, >- type => $type, >- interface => C4::Context->interface >+ amount => $amt, >+ type => $type, >+ payment_type => 'SIP' . $sip_type, >+ interface => C4::Context->interface > } > ); > return 1; >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 9d66e70f7c..95b71a1b96 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -56,7 +56,6 @@ This method allows payments to be made against fees/fines > Koha::Account->new( { patron_id => $borrowernumber } )->pay( > { > amount => $amount, >- sip => $sipmode, > note => $note, > description => $description, > library_id => $branchcode, >@@ -72,7 +71,6 @@ sub pay { > my ( $self, $params ) = @_; > > my $amount = $params->{amount}; >- my $sip = $params->{sip}; > my $description = $params->{description}; > my $note = $params->{note} || q{}; > my $library_id = $params->{library_id}; >@@ -199,9 +197,9 @@ sub pay { > } > > $account_type ||= >- $type eq 'writeoff' ? 'W' >- : defined($sip) ? "Pay$sip" >- : 'Pay'; >+ $type eq 'writeoff' >+ ? 'W' >+ : 'Pay'; > > $description ||= $type eq 'writeoff' ? 'Writeoff' : q{}; > >@@ -297,7 +295,6 @@ my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit( > user_id => $user_id, > interface => $interface, > library_id => $library_id, >- sip => $sip, > payment_type => $payment_type, > type => $credit_type, > item_id => $item_id >@@ -324,7 +321,6 @@ sub add_credit { > my $user_id = $params->{user_id}; > my $interface = $params->{interface}; > my $library_id = $params->{library_id}; >- my $sip = $params->{sip}; > my $payment_type = $params->{payment_type}; > my $type = $params->{type} || 'payment'; > my $item_id = $params->{item_id}; >@@ -338,10 +334,6 @@ sub add_credit { > my $schema = Koha::Database->new->schema; > > my $account_type = $Koha::Account::account_type_credit->{$type}; >- $account_type .= $sip >- if defined $sip && >- $type eq 'payment'; >- > my $line; > > $schema->txn_do( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 9b1be90c05..1c667689e6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -1,9 +1,6 @@ > [%- BLOCK account_type_description -%] > [%- SWITCH account.accounttype -%] > [%- CASE 'Pay' -%]<span>Payment >- [%- CASE 'Pay00' -%]<span>Payment (cash via SIP2) >- [%- CASE 'Pay01' -%]<span>Payment (VISA via SIP2) >- [%- CASE 'Pay02' -%]<span>Payment (credit card via SIP2) > [%- CASE 'N' -%]<span>New card > [%- CASE 'OVERDUE' -%]<span>Fine > [%- CASE 'A' -%]<span>Account management fee >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index e2bb1a1b36..83612a1813 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -30,9 +30,6 @@ > <td> > [% SWITCH ACCOUNT_LINE.accounttype %] > [% CASE 'Pay' %]Payment >- [% CASE 'Pay00' %]Payment (cash via SIP2) >- [% CASE 'Pay01' %]Payment (VISA via SIP2) >- [% CASE 'Pay02' %]Payment (credit card via SIP2) > [% CASE 'VOID' %]Voided > [% CASE 'N' %]New card > [% CASE 'OVERDUE' %]Fine >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22610
:
88619
|
88620
|
89460
|
89461
|
89470
|
89471
|
89492
|
89493
|
89494
|
89495
|
89496
|
89498
|
89499
|
89500
|
89501
|
89502
|
89503
|
91638
|
91639
|
91640
|
91641
|
91642
|
91643