Bugzilla – Attachment 117354 Details for
Bug 27796
SIP payment types should not be available as refund types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27796: Centralise payment/transaction type handling
Bug-27796-Centralise-paymenttransaction-type-handl.patch (text/plain), 11.99 KB, created by
Martin Renvoize (ashimema)
on 2021-02-25 17:29:26 UTC
(
hide
)
Description:
Bug 27796: Centralise payment/transaction type handling
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-02-25 17:29:26 UTC
Size:
11.99 KB
patch
obsolete
>From 9b19cd85da9dcaf241dd9e6ff7662805fda2c33c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Feb 2021 17:28:33 +0000 >Subject: [PATCH] Bug 27796: Centralise payment/transaction type handling > >--- > .../prog/en/includes/payments.inc | 29 ------------------ > .../prog/en/modules/members/boraccount.tt | 30 +++---------------- > .../prog/en/modules/members/paycollect.tt | 7 ++--- > .../intranet-tmpl/prog/en/modules/pos/pay.tt | 3 +- > .../prog/en/modules/pos/register.tt | 14 +-------- > members/boraccount.pl | 10 +++---- > pos/register.pl | 4 +-- > 7 files changed, 16 insertions(+), 81 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc >deleted file mode 100644 >index b1b57979ad..0000000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc >+++ /dev/null >@@ -1,29 +0,0 @@ >-[% USE AuthorisedValues %] >-[%- BLOCK account_payment_types -%] >- [% SET payment_types = [] %] >- [% FOR pt IN AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] >- [% NEXT IF pt.authorised_value.grep("^SIP[[:digit:]]{2}$").size() %] >- [% payment_types.push(pt) %] >- [% END %] >- [% IF payment_types.size > 0 %] >- <li> >- [% IF Koha.Preference('UseCashRegisters') %] >- <label for="payment_type" class="required">Payment type: </label> >- <select name="payment_type" id="payment_type" class="required" required="required"> >- [% FOREACH pt IN payment_types %] >- <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> >- [% END %] >- </select> >- <span class="required">Required</span> >- [%- ELSE -%] >- <label for="payment_type">Payment type: </label> >- <select name="payment_type" id="payment_type"> >- <option value=""></option> >- [% FOREACH pt IN payment_types %] >- <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> >- [% END %] >- </select> >- [%- END -%] >- </li> >- [% END %] >-[%- END -%] >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 b23267b970..88641d62c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -177,20 +177,8 @@ > <input type="text" inputmode="numeric" pattern="[0-9]*" id="amount" name="amount" required="required"> > <span class="required">Required</span> > </li> >- [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] >- [% SET excluded = ['SIP00', 'SIP01', 'SIP02'] %] >- [% IF payment_types > 3 %] >- <li> >- <label for="transaction_type">Transaction type: </label> >- <select name="transaction_type" id="payout_transaction_type"> >- [% FOREACH pt IN payment_types %] >- [% UNLESS excluded.grep("^$pt.authorised_value\$").size %] >- <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- [% END %] >+ >+ [% INCLUDE 'transaction_types.inc' type="payout" %] > > [% IF Koha.Preference('UseCashRegisters') %] > <li> >@@ -246,18 +234,8 @@ > <input type="text" inputmode="numeric" pattern="[0-9]*" id="returned" name="amount" required="required"> > <span class="required">Required</span> > </li> >- [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] >- <li> >- <label for="transaction_type">Transaction type: </label> >- <select name="transaction_type" id="refund_transaction_type"> >- <option value="AC">Account credit</option> >- [% IF payment_types %] >- [% FOREACH pt IN payment_types %] >- <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >+ >+ [% INCLUDE 'transaction_types.inc' type="refund" %] > > [% IF Koha.Preference('UseCashRegisters') %] > <li> >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 f5e5ea3fe8..9e7b7e4662 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -5,7 +5,6 @@ > [% USE Registers %] > [% USE Price %] > [% SET footerjs = 1 %] >-[% PROCESS 'payments.inc' %] > [% PROCESS 'accounts.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > [% BLOCK cash_register_required %] >@@ -149,7 +148,7 @@ > <span id="change">0.00</span> > </li> > >- [% PROCESS account_payment_types %] >+ [% INCLUDE 'transaction_types.inc' type="payment" %] > > [% IF Koha.Preference('UseCashRegisters') %] > <li> >@@ -279,8 +278,8 @@ > <label>Change to give: </label> > <span id="change">0.00</span> > </li> >- >- [% PROCESS account_payment_types %] >+ >+ [% INCLUDE 'transaction_types.inc' type="payment" %] > > [% IF Koha.Preference('UseCashRegisters') %] > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index 4d35b60ff7..5f3b6436f5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -6,7 +6,6 @@ > [% USE TablesSettings %] > [% USE Registers %] > [% SET footerjs = 1 %] >-[% PROCESS 'payments.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > [% SET registers = Registers.all( filters => { current_branch => 1 } ) %] > <title>Koha › Payments</title> >@@ -125,7 +124,7 @@ > <input type="hidden" name="change" value="[% 0 | $Price %]"/> > </li> > >- [% PROCESS account_payment_types %] >+ [% INCLUDE 'transaction_types.inc' type="payment" %] > > <li> > <label for="registerid" class="required">Cash register: </label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >index 5569539969..6d5112e2bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -276,19 +276,7 @@ > <input type="number" step="0.01" id="returned" name="amount" min="0.00" required="required"> > <span class="required">Required</span> > </li> >- [% SET payment_types = [] %] >- [% FOR pt IN AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] >- [% NEXT IF pt.authorised_value.grep("^SIP[[:digit:]]{2}$").size() %] >- [% payment_types.push(pt) %] >- [% END %] >- <li> >- <label for="transaction_type">Transaction type: </label> >- <select name="transaction_type" id="transaction_type"> >- [% FOREACH pt IN payment_types %] >- <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> >- [% END %] >- </select> >- </li> >+ [% INCLUDE 'transaction_types.inc' type="refund" %] > </ol> > </fieldset> <!-- /.rows --> > </div> <!-- /.modal-body --> >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 35930810be..7bd550940d 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -79,12 +79,12 @@ if ( $action eq 'payout' ) { > my $payment_id = scalar $input->param('accountlines_id'); > my $payment = Koha::Account::Lines->find($payment_id); > my $amount = scalar $input->param('amount'); >- my $transaction_type = scalar $input->param('transaction_type'); >+ my $payout_type = scalar $input->param('payout_type'); > $schema->txn_do( > sub { > my $payout = $payment->payout( > { >- payout_type => $transaction_type, >+ payout_type => $payout_type, > branch => $library_id, > staff_id => $logged_in_user->id, > cash_register => $registerid, >@@ -100,7 +100,7 @@ if ( $action eq 'refund' ) { > my $charge_id = scalar $input->param('accountlines_id'); > my $charge = Koha::Account::Lines->find($charge_id); > my $amount = scalar $input->param('amount'); >- my $transaction_type = scalar $input->param('transaction_type'); >+ my $refund_type = scalar $input->param('refund_type'); > $schema->txn_do( > sub { > >@@ -113,10 +113,10 @@ if ( $action eq 'refund' ) { > amount => $amount > } > ); >- unless ( $transaction_type eq 'AC' ) { >+ unless ( $refund_type eq 'AC' ) { > my $payout = $refund->payout( > { >- payout_type => $transaction_type, >+ payout_type => $refund_type, > branch => $library_id, > staff_id => $logged_in_user->id, > cash_register => $registerid, >diff --git a/pos/register.pl b/pos/register.pl >index 97d6d63cf6..e398bda396 100755 >--- a/pos/register.pl >+++ b/pos/register.pl >@@ -119,7 +119,7 @@ else { > my $amount = $input->param('amount'); > my $quantity = $input->param('quantity'); > my $accountline_id = $input->param('accountline'); >- my $transaction_type = $input->param('transaction_type'); >+ my $refund_type = $input->param('refund_type'); > > my $accountline = Koha::Account::Lines->find($accountline_id); > $schema->txn_do( >@@ -136,7 +136,7 @@ else { > ); > my $payout = $refund->payout( > { >- payout_type => $transaction_type, >+ payout_type => $refund_type, > branch => $library_id, > staff_id => $logged_in_user->id, > cash_register => $cash_register->id, >-- >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 27796
:
117354
|
117368
|
117369
|
117370
|
117784
|
118145
|
118146
|
118768
|
118769
|
119239
|
119240
|
119678
|
119679
|
119680