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