Browse Source

Bug 24525: (follow-up) Factor out to an include

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Martin Renvoize 3 years ago
parent
commit
ed7c1b3453
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 19
      koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc
  2. 39
      koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt
  3. 16
      koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt

19
koha-tmpl/intranet-tmpl/prog/en/includes/payments.inc

@ -0,0 +1,19 @@
[% 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>
<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>
</li>
[% END %]
[%- END -%]

39
koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt

@ -2,9 +2,9 @@
[% USE Asset %]
[% USE Koha %]
[% USE Branches %]
[% USE AuthorisedValues %]
[% USE Price %]
[% SET footerjs = 1 %]
[% PROCESS 'payments.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo;
[% IF type == 'WRITEOFF' %]
@ -123,22 +123,9 @@
<label>Change to give: </label>
<span id="change">0.00</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 %]
[% IF payment_types.size > 0 %]
<li>
<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>
</li>
[% END %]
[% PROCESS account_payment_types %]
[% IF Koha.Preference('UseCashRegisters') %]
<li>
<label for="cash_register">Cash register: </label>
@ -257,22 +244,8 @@
<label>Change to give: </label>
<span id="change">0.00</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 %]
[% IF payment_types.size > 0 %]
<li>
<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>
</li>
[% END %]
[% PROCESS account_payment_types %]
[% IF Koha.Preference('UseCashRegisters') %]
<li>

16
koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt

@ -1,9 +1,9 @@
[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE Price %]
[% SET footerjs = 1 %]
[% PROCESS 'payments.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Payments</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -112,19 +112,7 @@
<input type="hidden" name="change" value="0.00"/>
</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="payment_type">Payment type: </label>
<select name="payment_type" id="payment_type">
[% FOREACH pt IN payment_types %]
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option>
[% END %]
</select>
</li>
[% PROCESS account_payment_types %]
[% IF Koha.Preference('UseCashRegisters') %]
<li>

Loading…
Cancel
Save