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