Fix typo in TPAC noticed by Warren Layton
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / main_payment_form.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "payment_form";
6
7     last_chance = CGI.param("last_chance");
8
9 %]
10 [% IF ctx.fines.balance_owed <= 0 %]
11 <div>
12     [% l("You either have no fines to pay or you have selected fines whose " _
13         "total is non-positive.  We cannot process non-positive amounts.") %]
14 </div>
15 [% ELSE %]
16 <div id="pay_fines_now">
17     [% IF last_chance %]
18     <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
19     <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="POST">
20         [% FOR k IN CGI.Vars;
21             NEXT UNLESS k;
22             FOR val IN CGI.param(k) %]
23         <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
24         [% END; END %]
25         <input type="submit" value="[% l('Submit Payment') %]" />
26         <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
27     [% ELSE %]
28     <form method="POST">
29         <input type="hidden" name="last_chance" value="1" />
30         [% FOR xact IN CGI.param('xact') %]
31         <input type="hidden" name="xact" value="[% xact | html %]" />
32         [% END %]
33         [% FOR xact IN CGI.param('xact_misc') %]
34         <input type="hidden" name="xact_misc" value="[% xact | html %]" />
35         [% END %]
36
37         <table>
38             <tbody>
39                 <tr>
40                     <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
41                     <td rowspan='13' valign='top'>
42                         <p>[% l('Selected fines you are paying for:') %]</p>
43                         <table cellpadding="0" cellspacing="0" border="0" class="myopac_payments_table">
44                             <thead>
45                                 <tr>
46                                     <th>[% l('Name') %]</th>
47                                     <th>[% l('Amount') %]</th>
48                                 </tr>
49                             </thead>
50                             <tbody>
51                             [%
52                             FOR f IN ctx.fines.circulation;
53                                 NEXT IF CGI.param('xact').size &&
54                                     !CGI.param('xact').grep(f.xact.id).size;
55                                 attrs = {marc_xml => f.marc_xml};
56                                 IF f.marc_xml;
57                                     PROCESS get_marc_attrs args=attrs;
58                                 ELSIF f.xact.reservation;
59                                     attrs.title = f.xact.reservation.target_resource_type.name;
60                                 END %]
61                                 <tr>
62                                     <td>[% attrs.title | html %]</td>
63                                     <td class="text-right">[% money(f.xact.balance_owed) %]</td>
64                                 </tr>
65                             [%
66                             END;
67                             FOR f IN ctx.fines.grocery;
68                                 NEXT IF CGI.param('xact_misc').size &&
69                                     !CGI.param('xact_misc').grep(f.xact.id).size %]
70                                 <tr>
71                                     <td>[% f.xact.last_billing_type | html %]</td>
72                                     <td class="text-right">[% money(f.xact.balance_owed) %]</td>
73                                 </tr>
74                             [% END %]
75                             </tbody>
76                         </table>
77                         <br />
78                         <div>
79                             [% l('Total amount to pay:') %]
80                             <strong>[% money(ctx.fines.balance_owed) %]</strong>
81                         </div>
82                         <br />
83                         [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
84                     </td>
85                 </tr>
86                 <tr>
87                     <td>[% l('First Name') %]</td>
88                     <td><input type="text" name="billing_first" value="[% ctx.user.first_given_name | html %]" /></td>
89                 </tr>
90                 <tr>
91                     <td>[% l('Last Name') %]</td>
92                     <td><input type="text" name="billing_last" value="[% ctx.user.family_name | html %]" /></td>
93                 </tr>
94                 <tr>
95                     <td>[% l('Email Address') %]</td>
96                     <td>
97                         <input type="text" disabled="disabled" readonly="readonly" value="[% ctx.user.email | html %]" />
98                         <a href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
99                     </td>
100                 </tr>
101                 <tr>
102                     <td>[% l('Street Address') %]</td>
103                     <td><input type="text" name="billing_address" value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
104                 </tr>
105                 <tr>
106                     <td>[% l('City' )%]</td>
107                     <td><input type="text" name="billing_city" value="[% ctx.user.billing_address.city | html %]" /></td>
108                 </tr>
109                 <tr>
110                     <td>[% l('State or Province') %]</td>
111                     <td><input type="text" name="billing_state" value="[% ctx.user.billing_address.state | html %]" /></td>
112                 </tr>
113                 <tr>
114                     <td>[% l('ZIP or Postal Code') %]</td>
115                     <td><input type="text" name="billing_zip" value="[% ctx.user.billing_address.post_code | html %]" /></td>
116                 </tr>
117                 <tr>
118                   <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
119                 </tr>
120                 <!-- Technically not needed since card type is derived from the CC number
121                 <tr>
122                     <td>Type of Card</td>
123                     <td>
124                         <select name="type">
125                             <option value='VISA'>VISA</option>
126                             <option value='MasterCard'>MasterCard</option>
127                             <option value='American Express'>American Express</option>
128                         </select>
129                     </td>
130                 </tr>
131                 -->
132                 <tr>
133                     <td>[% l('Credit Card #') %]</td>
134                     <td><input type="text" name="number" maxlength="16" /></td>
135                 </tr>
136                 <tr>
137                     <td>[% l('Security Code') %]</td>
138                     <td>
139                         <input type="text" size="4" maxlength="5" name="cvv2" />
140                     </td>
141                 </tr>
142                 <tr>
143                     <td>[% l('Expiration Month') %]</td>
144                     <td>
145                         <select name="expire_month">
146                             <option value="01">[% l("January") %]</option>
147                             <option value="02">[% l("February") %]</option>
148                             <option value="03">[% l("March") %]</option>
149                             <option value="04">[% l("April") %]</option>
150                             <option value="05">[% l("May") %]</option>
151                             <option value="06">[% l("June") %]</option>
152                             <option value="07">[% l("July") %]</option>
153                             <option value="08">[% l("August") %]</option>
154                             <option value="09">[% l("September") %]</option>
155                             <option value="10">[% l("October") %]</option>
156                             <option value="11">[% l("November") %]</option>
157                             <option value="12">[% l("December") %]</option>
158                         </select>
159                     </td>
160                 </tr>
161                 <tr>
162                     <td>[% l('Expiration Year') %]</td>
163                     <td>
164                         <select name="expire_year">
165                         [% year = date.format(date.now, '%Y');
166                         y = year;
167                         WHILE y < year + 10; # show ten years starting now %]
168                             <option value="[% y %]">[% y %]</option>
169                         [% y = y + 1; END %]
170                         </select>
171                     </td>
172                 </tr>
173                 <tr>
174                     <td colspan='2' align="center">
175                         <input type="submit" value="[% l('Next') %]" />
176                         <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
177                     </td>
178                 </tr>
179                 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]
180             </tbody>
181         </table>
182     [% END %]
183     </form>
184 </div>
185 [% END %]
186 [% END %]