Bug 28138: (follow-up) Add empty option to payment type selection
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / transaction_types.inc
1 [% USE AuthorisedValues %]
2 [% SET payment_types = [] %]
3 [% FOR pt IN AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %]
4     [% NEXT IF pt.authorised_value.grep("^SIP[[:digit:]]{2}$").size() %]
5     [% payment_types.push(pt) %]
6 [% END %]
7 [% IF payment_types.size > 0 %]
8     <li>
9         [% IF Koha.Preference('UseCashRegisters') || Koha.Preference('RequirePaymentType') %]
10             <label for="[% type | html %]_type" class="required">[% IF type == 'payment' %]Payment[% ELSE %]Transaction[% END %] type: </label>
11             <select name="[% type | html %]_type" id="[% type | html %]_type" class="required" required="required">
12                 <option value="">None selected</option>
13                 [% IF type == 'refund' %]
14                 <option value="AC">Account credit</option>
15                 [% END %]
16                 [% FOREACH pt IN payment_types %]
17                     <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option>
18                 [% END %]
19             </select>
20             <span class="required">Required</span>
21         [%- ELSE -%]
22             <label for="[% type | html %]_type">[% IF type == 'payment' %]Payment[% ELSE %]Transaction[% END %] type: </label>
23             <select name="[% type | html %]_type" id="[% type | html %]_type">
24                 <option value="">None selected</option>
25                 [% IF type == 'refund' %]
26                 <option value="AC">Account credit</option>
27                 [% END %]
28                 [% FOREACH pt IN payment_types %]
29                     <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option>
30                 [% END %]
31             </select>
32         [%- END -%]
33     </li>
34 [% END %]