Kreditorenbuchungen: Währungs-Drop-Down nicht als Hidden mitschleifen
[kivitendo-erp.git] / templates / webpages / ap / form_header.html
1 [%- USE L %]
2 [%- USE HTML %]
3 [%- USE T8 %]
4 [%- USE LxERP %][%- USE P -%]
5
6 <form method="post" action="[% script | html %]">
7
8 <input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
9
10 <input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
11 <input type="hidden" name="vendor_id" value="[% vendor_id | html %]">
12 <input type="hidden" name="terms" value="[% terms | html %]">
13
14 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
15 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
16
17 <input type="hidden" name="forex" value="[% forex | html %]">
18 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
19
20 <input type="hidden" name="id" value="[% id | html %]">
21 <input type="hidden" name="sort" value="[% sort | html %]">
22 <input type="hidden" name="closedto" value="[% closedto | html %]">
23 <input type="hidden" name="locked" value="[% locked | html %]">
24 <input type="hidden" name="title" value="[% title_ | html %]">
25
26 <input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
27 <input type="hidden" name="follow_up_trans_type_1" value="ap_transaction">
28 <input type="hidden" name="follow_up_trans_info_1" value="[% follow_up_trans_info | html %]">
29 <input type="hidden" name="follow_up_rowcount" value="1">
30
31 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
32 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
33 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
34
35 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
36 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
37
38 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
39
40 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
41
42 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
43
44 [% FOREACH i IN [1..paidaccounts] %]
45   [% temp = "acc_trans_id_"_ i %]
46   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
47
48   [% temp = "gldate_"_ i %]
49   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
50 [% END %]
51
52 <h1>[% title | html %]</h1>
53
54 [% IF ( saved_message ) %]
55   <p>[% saved_message | html %]</p>
56 [% END %]
57
58 <div id="ap_tabs" class="tabwidget">
59  <ul>
60   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
61 [%- IF INSTANCE_CONF.get_webdav %]
62   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
63 [%- END %]
64 [%- IF id %]
65   [%- IF AUTH.assert('record_links', 1) %]
66   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
67   [%- END %]
68   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
69 [%- END %]
70  </ul>
71
72 <div id="ui-tabs-basic-data">
73 <table width="100%">
74   <tr valign="top">
75     <td>
76       <table width="100%">
77         <tr valign="top">
78           <td>
79             <table>
80               <tr>
81                 <th align="right" nowrap>[% 'Vendor' | $T8 %]</th>
82                 <td colspan="3">
83                   [% IF ( selectvendor ) %]
84                     <select name="vendor" onchange="document.getElementById('update_button').click();"[% IF initial_focus == 'vendor' %] class="initial_focus"[% END %]>[% selectvendor %]</select>
85                   [% ELSE %]
86                     <input name=vendor value="[% vendor | html %]" size="35"[% IF initial_focus == 'vendor' %] class="initial_focus"[% END %]>
87                   [% END %]
88                   <input type="button" value="D" onclick="show_vc_details('vendor')">
89                 </td>
90               </tr>
91
92               <tr>
93                 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
94                 <td>
95                  [% creditlimit | html %];
96                  [% LxERP.t8("Remaining") %]
97                  <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span>
98                 </td>
99               </tr>
100
101 [%- IF invoice_obj.sepa_exports.as_list.size %]
102               <tr>
103                 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
104                 <td>
105                  [% FOREACH export = invoice_obj.sepa_exports.as_list %]
106                   <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
107                   [% UNLESS loop.last %], [% END %]
108                  [% END %]
109                 </td>
110               </tr>
111 [%- END %]
112
113               <tr>
114                 <th align="right" nowrap>[% 'Currency' | $T8 %]</th>
115                 <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
116
117                 [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
118                   <th align=right>[% 'Exchangerate' | $T8 %]</th>
119                   [% IF ( forex ) %]
120                     <td><input type="hidden" name="exchangerate" value="[% exchangerate | html %]">[% exchangerate | html %]</td>
121                   [% ELSE %]
122                     <td><input type="text" name="exchangerate" size="10" value="[% exchangerate | html %]"></td>
123                   [% END %]
124                 [% END %]
125
126               </tr>
127
128               [% IF ALL_DEPARTMENTS %]
129                 <tr>
130                   <th align="right" nowrap>[% 'Department' | $T8 %]</th>
131                   <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td>
132                 </tr>
133               [% END %]
134
135               <tr>
136                 <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
137                 <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
138               </tr>
139               <tr>
140                 <td align="right"><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
141                 <th align="left" nowrap>[% 'direct debit' | $T8 %]</th>
142               </tr>
143             </table>
144           </td>
145
146           <td align="right">
147             <table>
148               <tr>
149                 <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
150                 <td><input name="invnumber" size="11" value="[% invnumber | html %]" [% readonly %]></td>
151               </tr>
152               <tr>
153                 <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
154                 <td><input name="ordnumber" size="11" value="[% ordnumber | html %]" [% readonly %]></td>
155               </tr>
156               <tr>
157                 <th align="right" nowrap>[% 'Invoice Date' | $T8 %]</th>
158                 <td>[% L.date_tag('transdate', transdate) %]</td>
159               </tr>
160               <tr>
161                 <th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
162                 <td>[% L.date_tag('duedate', duedate) %]</td>
163               </tr>
164               <tr>
165                 <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
166                 <td>
167                   [% L.select_tag('globalproject_id', ALL_PROJECTS, with_empty = 1, default = globalproject_id, value_key = 'id', title_key = 'projectnumber', onChange = "document.getElementById('update_button').click();") %]
168                 </td>
169               </tr>
170             </table>
171           </td>
172         </tr>
173       </table>
174     </td>
175   </tr>
176
177   <tr>
178     <td>
179       <table width=100%>
180         <tr class=listheading>
181           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
182           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
183           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
184           <th class=listheading style="width:10%">[% 'Taxkey' | $T8 %]</th>
185           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
186         </tr>
187
188         [% FOREACH i IN [1..rowcount] %]
189           <tr>
190             <td>
191               [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
192               [% P.chart_picker("AP_amount_chart_id_" _ i, $selected_chart_id, style="width: 400px", type="AP_amount", class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
193               [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
194               <input type="hidden" name="tax_[% i %]" value="[% temp = "tax"_ i %][% $temp | html %]">
195             </td>
196             <td>
197               <input name="amount_[% i %]" size="10" value="[% temp = "amount_"_ i %][% $temp | html %]">
198             </td>
199             <td>
200               [% temp = "tax_"_ i %][% $temp | html %]
201             </td>
202             <td>
203               [% temp = 'selected_taxchart_'_ i %]
204               [% taxcharts = 'taxcharts_' _ i %]
205               [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, style="width: 250px") %]
206             </td>
207             <td>
208               [% temp = "project_id_"_ i %]
209               [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = loop.last ? globalproject_id : $temp, value_key = 'id', title_key = 'projectnumber') %]
210             </td>
211           </tr>
212         [% END %]
213
214         <tr>
215           <td colspan="6">
216             <hr noshade>
217           </td>
218         </tr>
219         <tr>
220           <td>
221             [% P.chart_picker('AP_chart_id', AP_chart_id, style="width: 400px", type="AP") %]
222           </td>
223           <th align="left">[% invtotal | html %]</th>
224           <td colspan="4"></td>
225         </tr>
226       </table>
227      </td>
228     </tr>
229     <tr>
230       <td>
231         <table width="100%">
232         <tr>
233           <th align="left" width="1%">[% 'Notes' | $T8 %]</th>
234           <td align="left">
235             <textarea name="notes" rows="[% textarea_rows %]" cols="50" wrap="soft" [% readonly %]>[% notes | html %]</textarea>
236           </td>
237
238           <th align="left" width=1%>[% 'Notes for vendor' | $T8 %]</th>
239           <td align="left">
240             <textarea name="intnotes" rows="[% textarea_rows %]" cols="50" wrap="soft" readonly>[% intnotes | html %]</textarea>
241           </td>
242         </tr>
243       </table>
244     </td>
245   </tr>
246   <tr>
247     <td>
248       <table width="100%">
249         <tr class="listheading">
250           <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
251         </tr>
252
253         <tr>
254           <th>[% 'Date' | $T8 %]</th>
255           <th>[% 'Source' | $T8 %]</th>
256           <th>[% 'Memo' | $T8 %]</th>
257           <th>[% 'Amount' | $T8 %]</th>
258           <th></th>
259           [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
260             <th>[% 'Exch' | $T8 %]</th>
261           [% END %]
262           <th>[% 'Account' | $T8 %]</th>
263           <th>[% 'Project Number' | $T8 %]</th>
264         </tr>
265
266         [% FOREACH i IN [1..paidaccounts] %]
267           [% temp = "paidaccount_changeable_"_ i %]
268           [% changeable = $temp %]
269
270           <tr>
271             [% temp = "datepaid_"_ i %]
272             <td align="center">
273               [% IF( changeable ) %]
274                 [% L.date_tag(temp, $temp ? $temp : today) %]
275               [% ELSE %]
276                 [% $temp | html %]
277                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
278               [% END %]
279             </td>
280
281             [% temp = "source_"_ i %]
282             <td align="center">
283               [% IF( changeable ) %]
284                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
285               [% ELSE %]
286                 [% $temp | html %]
287                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
288               [% END %]
289             </td>
290
291             [% temp = "memo_"_ i %]
292             <td align="center">
293               [% IF( changeable ) %]
294                 <input name="[% temp %]" size="11" value="[% $temp | html %]">
295               [% ELSE %]
296                 [% $temp | html %]
297                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
298               [% END %]
299             </td>
300
301             [% temp = "paid_"_ i %]
302             <td align="center">
303               [% IF( changeable ) %]
304                 <input name="[% temp %]" size="11" value="[% $temp | html %]" onBlur="check_right_number_format(this);">
305               [% ELSE %]
306                 [% $temp | html %]
307                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
308               [% END %]
309             </td>
310
311             <td>
312               [% IF changeable && loop.last && paid_missing > 0 %]
313                 <input type="button" id="ap_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
314               [% END %]
315             </td>
316
317             [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
318               <td align="center">
319                 [% temp = "exchangerate_"_ i %]
320                 [% temp_forex = "forex_"_ i %]
321
322                 [% IF( $temp_forex || !changeable ) %]
323                   [% $temp | html %]
324                   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
325                 [% ELSE %]
326                   <input name="[% temp %]" size="11" value="[% $temp | html %]">
327                 [% END %]
328
329                 <input type=hidden name="[% temp_forex %]" value="[% $temp_forex | html %]">
330               </td>
331             [% END %]
332
333             [% temp = "AP_paid_"_ i %]
334             <td align="center">
335               [% IF( changeable ) %]
336                 [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap))  %]
337               [% ELSE %]
338                 [% $temp | html %]
339                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
340               [% END %]
341             </td>
342
343             <td align="center">
344               [% temp = "paid_project_id_"_ i %]
345               [% IF( changeable ) %]
346                 [% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = $temp, value_key = 'id', title_key = 'projectnumber') %]
347               [% ELSE %]
348                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
349                 [% temp = "label"_ temp %]
350                 [% $temp | html %]
351               [% END %]
352             </td>
353           </tr>
354         [% END %]
355
356         <tr>
357           <td></td>
358           <td></td>
359           <td align="center">[% 'Total' | $T8 %]</td>
360           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
361         </tr>
362         <tr>
363           <td></td>
364           <td></td>
365           <td align="center">[% 'Missing amount' | $T8 %]</td>
366           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
367         </tr>
368       </table>
369     </td>
370   </tr>
371 </table>
372 </div>
373 [% PROCESS 'webdav/_list.html' %]
374 <div id="ui-tabs-1">
375  [% LxERP.t8('Loading...') %]
376 </div>
377 </div>
378
379 <hr size="3" noshade>
380
381 <script type='text/javascript'>
382  $('#ap_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
383 </script>