HTML-Escape unter templates/ap/form_header.html eingefügt
[kivitendo-erp.git] / templates / webpages / ap / form_header.html
1 [%- USE L %]
2 [%- USE HTML %]
3 [%- USE T8 %]
4 [%- USE LxERP %]
5
6 <script type="text/javascript">
7 <!--
8   function setTaxkey(accno, row) {
9     var taxkey = accno.options[accno.selectedIndex].value;
10     var reg = /--([0-9]*)/;
11     var found = reg.exec(taxkey);
12     var index = found[1];
13     index = parseInt(index);
14     var tax = 'taxchart_' + row;
15     for (var i = 0; i < document.getElementById(tax).options.length; ++i) {
16       var reg2 = new RegExp("^"+ index, "");
17       if (reg2.exec(document.getElementById(tax).options[i].value)) {
18         document.getElementById(tax).options[i].selected = true;
19         break;
20       }
21     }
22   };
23 //-->
24 </script>
25
26 <script type="text/javascript" src="js/show_history.js"></script>
27
28 <form method="post" action="[% script | html %]">
29
30 <input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
31 <input type="hidden" name="selectdepartment" value="[% selectdepartment | html %]">
32 <input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]">
33
34 <input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
35 <input type="hidden" name="vendor_id" value="[% vendor_id | html %]">
36 <input type="hidden" name="terms" value="[% terms | html %]">
37
38 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
39 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
40
41 <input type="hidden" name="forex" value="[% forex | html %]">
42
43 <input type="hidden" name="id" value="[% id | html %]">
44 <input type="hidden" name="sort" value="[% sort | html %]">
45 <input type="hidden" name="closedto" value="[% closedto | html %]">
46 <input type="hidden" name="locked" value="[% locked | html %]">
47 <input type="hidden" name="title" value="[% title_ | html %]">
48
49 <input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
50 <input type="hidden" name="follow_up_trans_type_1" value="ap_transaction">
51 <input type="hidden" name="follow_up_trans_info_1" value="[% follow_up_trans_info | html %]">
52 <input type="hidden" name="follow_up_rowcount" value="1">
53
54 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
55 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
56 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
57
58 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
59 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
60
61 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
62
63 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
64
65 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
66
67 [% FOREACH i IN [1..paidaccounts] %]
68   [% temp = "acc_trans_id_"_ i %]
69   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
70
71   [% temp = "gldate_"_ i %]
72   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
73 [% END %]
74
75 <h1>[% title | html %]</h1>
76
77 [% IF ( saved_message ) %]
78   <p>[% saved_message | html %]</p>
79 [% END %]
80
81 <table width="100%">
82   <tr valign="top">
83     <td>
84       <table width="100%">
85         <tr valign="top">
86           <td>
87             <table>
88               <tr>
89                 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
90                 <td colspan="3">
91                   [% IF ( selectvendor ) %]
92                     <select name="vendor" onchange="document.getElementById('update_button').click();">[% selectvendor %]</select>
93                   [% ELSE %]
94                     <input name=vendor value="[% vendor | html %]" size="35">
95                   [% END %]
96                   <input type="button" value="D" onclick="show_vc_details('vendor')">
97                 </td>
98               </tr>
99
100               <tr>
101                 <td></td>
102                 <td colspan="3">
103                   <table width="100%">
104                     <tr>
105                       <th align="left" nowrap>[% 'Credit Limit' | $T8 %]</th>
106                       <td>[% creditlimit | html %]</td>
107                       <th align="left" nowrap>[% 'Remaining' | $T8 %]</th>
108                       <td class="plus[% creditremaining_plus %]">[% creditremaining | html %]</td>
109                     </tr>
110                   </table>
111                 </td>
112               </tr>
113
114               <tr>
115                 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
116                 <td><select name="currency">[% selectcurrency %]</select></td>
117
118                 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
119                   <th align=right>[% 'Exchangerate' | $T8 %]</th>
120                   [% IF ( forex ) %]
121                     <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
122                   [% ELSE %]
123                     <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
124                   [% END %]
125                 [% END %]
126
127               </tr>
128
129               [% IF ( selectdepartment ) %]
130                 <tr>
131                   <th align="right" nowrap>[% 'Department' | $T8 %]</th>
132                   <td colspan="3">
133                     <select name="department">[% selectdepartment %]</select>
134                   </td>
135                 </tr>
136               [% END %]
137
138               <tr>
139                 <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
140                 <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
141               </tr>
142             </table>
143           </td>
144
145           <td align="right">
146             <table>
147               <tr>
148                 <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
149                 <td><input name="invnumber" size="11" value="[% invnumber | html %]" [% readonly %]></td>
150               </tr>
151               <tr>
152                 <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
153                 <td><input name="ordnumber" size="11" value="[% ordnumber | html %]" [% readonly %]></td>
154               </tr>
155               <tr>
156                 <th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
157                 <td>[% L.date_tag('transdate', transdate) %]</td>
158               </tr>
159               <tr>
160                 <th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
161                 <td>[% L.date_tag('duedate', duedate) %]</td>
162               </tr>
163               <tr>
164                 <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
165                 <td>[% globalprojectnumber %]</td>
166               </tr>
167             </table>
168           </td>
169         </tr>
170       </table>
171     </td>
172   </tr>
173
174   <tr>
175     <td>
176       <table width=100%>
177         <tr class=listheading>
178           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
179           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
180           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
181           <th class=listheading style="width:10%">[% 'Taxkey' | $T8 %]</th>
182           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
183         </tr>
184
185         [% FOREACH i IN [1..rowcount] %]
186           <tr>
187             <td>
188               [% temp = "selectAP_amount_"_ i %][% $temp %]
189               <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
190             </td>
191             <td>
192               <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
193             </td>
194             <td>
195               [% temp = "tax_"_ i %][% $temp | html %]
196             </td>
197             <td>
198               [% temp = "select_tax_"_ i %][% $temp %]
199             </td>
200             <td>
201               [% temp = "select_projectnumber_"_ i %][% $temp %]
202             </td>
203           </tr>
204         [% END %]
205
206         <tr>
207           <td colspan="6">
208             <hr noshade>
209           </td>
210         </tr>
211         <tr>
212           <td>[% APselected %]</td>
213           <th align="left">[% invtotal | html %]</th>
214           <td colspan="4"></td>
215         </tr>
216       </table>
217      </td>
218     </tr>
219     <tr>
220       <td>
221         <table width="100%">
222         <tr>
223           <th align="left" width="1%">[% 'Notes' | $T8 %]</th>
224           <td align="left">
225             <textarea name="notes" rows="[% textarea_rows %]" cols="50" wrap="soft" [% readonly %]>[% notes | html %]</textarea>
226           </td>
227
228           <th align="left" width=1%>[% 'Notes for vendor' | $T8 %]</th>
229           <td align="left">
230             <textarea name="intnotes" rows="[% textarea_rows %]" cols="50" wrap="soft" readonly>[% intnotes | html %]</textarea>
231           </td>
232         </tr>
233       </table>
234     </td>
235   </tr>
236   <tr>
237     <td>
238       <table width="100%">
239         <tr class="listheading">
240           <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
241         </tr>
242
243         <tr>
244           <th>[% 'Date' | $T8 %]</th>
245           <th>[% 'Source' | $T8 %]</th>
246           <th>[% 'Memo' | $T8 %]</th>
247           <th>[% 'Amount' | $T8 %]</th>
248           [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
249             <th>[% 'Exch' | $T8 %]</th>
250           [% END %]
251           <th>[% 'Account' | $T8 %]</th>
252           <th>[% 'Project Number' | $T8 %]</th>
253         </tr>
254
255         [% FOREACH i IN [1..paidaccounts] %]
256           [% temp = "paidaccount_changeable_"_ i %]
257           [% changeable = $temp %]
258
259           <tr>
260             [% temp = "datepaid_"_ i %]
261             <td align="center">
262               [% IF( changeable ) %]
263                 [% L.date_tag(temp, $temp) %]
264               [% ELSE %]
265                 [% $temp | html %]
266                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">|;
267               [% END %]
268             </td>
269
270             [% temp = "source_"_ i %]
271             <td align="center">
272               [% IF( changeable ) %]
273                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
274               [% ELSE %]
275                 [% $temp | html %]
276                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
277               [% END %]
278             </td>
279
280             [% temp = "memo_"_ i %]
281             <td align="center">
282               [% IF( changeable ) %]
283                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
284               [% ELSE %]
285                 [% $temp | html %]
286                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
287               [% END %]
288             </td>
289
290             [% temp = "paid_"_ i %]
291             <td align="center">
292               [% IF( changeable ) %]
293                 <input name="[% temp %]" size="11" value="[% $temp | html %]" onBlur="check_right_number_format(this);">
294               [% ELSE %]
295                 [% $temp | html %]
296                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
297               [% END %]
298             </td>
299
300             [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
301               <td align="center">
302                 [% temp = "exchangerate_"_ i %]
303                 [% temp_forex = "forex_"_ i %]
304
305                 [% IF( $temp_forex || !changeable ) %]
306                   [% $temp | html %]
307                   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
308                 [% ELSE %]
309                   <input name="[% temp %]" size="11" value="[% $temp | html %]">
310                 [% END %]
311
312                 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
313               </td>
314             [% END %]
315
316             [% temp = "AP_paid_"_ i %]
317             <td align="center">
318               [% IF( changeable ) %]
319                 [% temp = "select"_ temp %]
320                 [% $temp %]
321               [% ELSE %]
322                 [% $temp | html %]
323                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
324               [% END %]
325             </td>
326
327             [% temp = "paid_project_id_"_ i %]
328             <td align="center">
329               [% IF( changeable ) %]
330                 [% temp = "select"_ temp %]
331                 [% $temp %]
332               [% ELSE %]
333                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
334                 [% temp = "label"_ temp %]
335                 [% $temp | html %]
336               [% END %]
337             </td>
338           </tr>
339         [% END %]
340
341         <tr>
342           <td></td>
343           <td></td>
344           <td align="center">[% 'Total' | $T8 %]</td>
345           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
346         </tr>
347         <tr>
348           <td></td>
349           <td></td>
350           <td align="center">[% 'Missing amount' | $T8 %]</td>
351           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
352         </tr>
353       </table>
354     </td>
355   </tr>
356   <tr>
357     <td><hr size="3" noshade></td>
358   </tr>
359 </table>