]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/ap/form_header.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / ap / form_header.html
1 [% USE L %]
2 [% USE P %]
3 [% USE HTML %]
4 [% USE T8 %]
5 [% USE LxERP %]
6
7 <h1>
8   [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
9   [% title %]
10 </h1>
11
12 [% INCLUDE 'common/flash.html' %]
13
14 <form method="post" action="[% script | html %]" id="form">
15
16 <input type="hidden" name="terms" value="[% terms | html %]">
17 <input type="hidden" name="creditlimit" value="[% creditlimit | html %]">
18 <input type="hidden" name="creditremaining" value="[% creditremaining | html %]">
19 <input type="hidden" name="forex" value="[% forex | html %]">
20 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
21 <input id="id" 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 <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 <input type="hidden" name="defaultcurrency" value="[% defaultcurrency | html %]">
31 <input type="hidden" name="fxgain_accno" value="[% fxgain_accno | html %]">
32 <input type="hidden" name="fxloss_accno" value="[% fxloss_accno | html %]">
33 <input type="hidden" name="oldinvtotal" value="[% oldinvtotal | html %]">
34 <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid | html %]">
35 <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
36 <input type="hidden" name="rowcount" value="[% rowcount | html %]">
37 <input type="hidden" name="paidaccounts" value="[% paidaccounts | html %]">
38 [% L.hidden_tag('zugferd_session_file', zugferd_session_file) %]
39
40 [% P.hidden_tag('convert_from_oe_id', convert_from_oe_id) %]
41
42 [% IF !id %]
43 [%   L.hidden_tag('form_validity_token', form_validity_token) %]
44 [% END %]
45 [% L.hidden_tag('email_journal_id',             email_journal_id) %]
46 [% L.hidden_tag('email_attachment_id',          email_attachment_id) %]
47 [% L.hidden_tag('workflow_email_journal_id',    workflow_email_journal_id) %]
48 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
49 [% L.hidden_tag('workflow_email_callback',      workflow_email_callback) %]
50
51 [% FOREACH i IN [1..paidaccounts] %]
52   [% temp = "acc_trans_id_"_ i %]
53   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
54   [% temp = "gldate_"_ i %]
55   <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
56 [% END %]
57
58
59 [% IF ( saved_message ) %]
60   <p>[% saved_message | html %]</p>
61 [% END %]
62
63 <div id="ap_tabs" class="tabwidget">
64
65 <ul>
66   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
67   [% IF email_attachment_id || workflow_email_attachment_id %]
68     <li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(email_attachment_id || workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li>
69   [% END %]
70   [% IF INSTANCE_CONF.get_webdav %]
71     <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
72   [% END %]
73   [% IF id AND INSTANCE_CONF.get_doc_storage %]
74     <li><a href="#ui-tabs-docs">[% 'Documents' | $T8 %]</a></li>
75     <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
76   [% END %]
77   [% IF id %]
78     [% IF AUTH.assert('record_links', 1) %]
79   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
80     [% END %]
81   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
82   [% END %]
83 </ul>
84
85 [% IF id AND INSTANCE_CONF.get_doc_storage %]
86   <div id="ui-tabs-docs"></div>
87 [% END %]
88
89 <div id="ui-tabs-basic-data">
90
91 [% IF email_attachment_id || workflow_email_attachment_id%]
92   <div class="wrapper" id="email_attachment_wrapper">
93     [%
94       BLOCK panel_1;
95         P.email_journal.attachment_preview(
96              email_attachment_id || workflow_email_attachment_id,
97              style="height:600px"
98              );
99       END;
100       INCLUDE 'common/toggle_panel.html'
101         block_name='panel_1'
102         button_closed  = LxERP.t8('Show Attachment')
103         button_open    = LxERP.t8('Hide Attachment')
104         ;
105     %]
106   </div>
107 [% END %]
108
109 <div class="wrapper">
110
111 <table class="tbl-horizontal">
112   <caption>[% 'Vendor & Order' | $T8 %]</caption>
113   <colgroup> <col class="wi-mediumsmall"><col class="wi-lightwide"> </colgroup>
114   <tbody>
115     <tr>
116       <th>[% 'Vendor' | $T8 %]</th>
117       <td class="wi-lightwide">
118         [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", show_details="1") %]
119         [% L.hidden_tag("previous_vendor_id", vendor_id) %]
120       </td>
121     </tr>
122     <tr>
123       <th>[% LxERP.t8("Credit Limit") %]</th>
124       <td><span class="data wi-lightwide">[% creditlimit | html %], [% LxERP.t8("Remaining") %] <span class="plus[% creditremaining_plus %]">[% creditremaining | html %]</span></span> </td>
125     </tr>
126     [% IF invoice_obj.sepa_exports.as_list.size %]
127       <tr>
128         <th>[% LxERP.t8("SEPA exports") %]</th>
129         <td> [% FOREACH export = invoice_obj.sepa_exports.as_list %] <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a> [% UNLESS loop.last %], [% END %] [% END %] </td>
130       </tr>
131     [% END %]
132     <tr>
133       <th>[% 'Currency' | $T8 %]</th>
134       <td>
135         [%- IF readonly  %]
136           [% HTML.escape(currency) %]
137           [% L.hidden_tag("currency", currency) %]
138         [%- ELSE %]
139           [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name", class="wi-lightwide") %]
140         [%- END %]
141       </td>
142     </tr>
143     [% IF ( defaultcurrency && (currency != defaultcurrency) ) %]
144       <tr>
145         <th>[% 'Exchangerate' | $T8 %]</th>
146         <td>
147         [%- IF readonly  %]
148           [% LxERP.format_amount(exchangerate, 5) %]
149           [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
150         [%- ELSE %]
151           [% L.input_tag("exchangerate", LxERP.format_amount(exchangerate), class="wi-lightwide") %]
152         [%- END %]
153         [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
154         [% L.hidden_tag("record_forex", record_forex) %]
155         </td>
156       </tr>
157     [% END %]
158     [% IF ALL_DEPARTMENTS %]
159     <tr>
160       <th>[% 'Department' | $T8 %]</th>
161       <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-lightwide') %]</td>
162     </tr>
163     [% END %]
164     <tr>
165       <th>[% 'Transaction description' | $T8 %]</th>
166       <td>[% L.input_tag("transaction_description", transaction_description, class="wi-lightwide", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
167     </tr>
168     <tr>
169       <th></th>
170       <td>[% L.checkbox_tag('taxincluded', checked=taxincluded, label=LxERP.t8('Tax Included')) %]</td>
171     </tr>
172     <tr>
173       <th></th>
174       <td>[% L.checkbox_tag('direct_debit', checked=direct_debit, label=LxERP.t8('direct debit')) %]</td>
175     </tr>
176   </tbody>
177 </table>
178
179 <table class="tbl-horizontal">
180   <caption>[% 'Notes' | $T8 %]</caption>
181   <colgroup><col class="wi-wide"></colgroup>
182   <tbody>
183     <tr>
184       <td>
185         [% L.textarea_tag("notes", HTML.escape(notes), rows=textarea_rows, readonly=readonly, class="wi-wide") %]
186       </td>
187     </tr>
188     <tr>
189       <td>
190         <span class="label above">[% 'Internal Notes' | $T8 %]</span>
191         [% L.textarea_tag("intnotes", HTML.escape(intnotes), rows=textarea_rows, readonly=readonly, class="wi-wide") %]
192       </td>
193     </tr>
194     <tr>
195       <td>
196         <span class="label above">[% 'Payment Terms' | $T8 %]</span>
197         [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, class="wi-wide", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('transdate')") %]
198       </td>
199     </tr>
200   </tbody>
201 </table>
202
203 <table class="tbl-horizontal">
204   <caption>[% 'Numbers & Dates' | $T8 %]</caption>
205   <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
206   <tbody>
207     <tr>
208       <th>[% 'Invoice Number' | $T8 %]</th>
209       <td>[% L.input_tag("invnumber", invnumber, size="11", readonly=readonly) %]</td>
210     </tr>
211     <tr>
212       <th>[% 'Order Number' | $T8 %]</th>
213       <td>[% L.input_tag("ordnumber", ordnumber, size="11", readonly=readonly) %]</td>
214     </tr>
215     <tr>
216       <th>[% 'Invoice Date' | $T8 %]</th>
217       <td>[% L.date_tag('transdate', transdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("transdate")') %]</td>
218     </tr>
219     <tr>
220       <th>[% 'Due Date' | $T8 %]</th>
221       <td>[% L.date_tag('duedate', duedate) %]</td>
222     </tr>
223     <tr>
224       <th>[% 'Tax point' | $T8 %]</th>
225       <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
226     </tr>
227     <tr>
228       <th>[% 'Delivery Date' | $T8 %]</th>
229       <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
230     </tr>
231     <tr>
232       <th>[% 'Project Number' | $T8 %]</th>
233       <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]</td>
234     </tr>
235   </tbody>
236 </table>
237
238 </div><!-- /.wrapper -->
239
240 <div class="wrapper">
241
242 <table class="tbl-list">
243   <caption>[% 'Transactions' | $T8 %]</caption>
244   <thead>
245     <tr>
246       <th>[% 'Account' | $T8 %]</th>
247       <th class="right">[% 'Amount' | $T8 %]</th>
248       <th class="right">[% 'Tax' | $T8 %]</th>
249       <th>[% 'Taxkey' | $T8 %]</th>
250       <th>[% 'Project' | $T8 %]</th>
251     </tr>
252   </thead>
253   <tbody>
254     [% FOREACH i IN [1..rowcount] %]
255     <tr>
256       <td class="wi-wider">
257         [% SET selected_chart_id = "AP_amount_chart_id_"_ i %]
258         [% P.chart.picker("AP_amount_chart_id_" _ i, $selected_chart_id, type="AP_amount", invalid=0, disabled=readonly, class=(initial_focus == 'row_' _ i ? "initial_focus" : "")) %]
259         [% L.hidden_tag("previous_AP_amount_chart_id_" _ i, $selected_chart_id) %]
260         <input type="hidden" name="tax_[% i %]" value="[% temp = " tax"_ i %][% $temp | html %]">
261       </td>
262       <td class="numeric">
263         <input type="text" name="amount_[% i %]" [% readonly ? 'readonly' : '' %] value="[% temp = "amount_"_ i %][% $temp | html %]" class="numeric wi-small">
264       </td>
265       <td class="numeric">
266         [% temp_r = "tax_reverse_"_ i %]
267         [% IF ($temp_r) %]
268           [% $temp_r | html %]
269           &nbsp;&nbsp;&nbsp;
270           [% temp_c = "tax_charge_"_ i %][% $temp_c | html %]
271         [% ELSE %]
272           [% temp = "tax_"_ i %][% $temp | html %]
273         [% END %]
274       </td>
275       <td>
276         [% temp = 'selected_taxchart_'_ i %] [% taxcharts = 'taxcharts_' _ i %]
277         [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, class='wi-lightwide') %]
278       </td>
279       <td>
280         [% temp = "project_id_"_ i %]
281         [% P.project.picker(temp, loop.last ? globalproject_id : $temp) %]
282       </td>
283     </tr>
284     [% END %]
285   </tbody>
286   <tfoot>
287     <tr>
288       <td>[% P.chart.picker('AP_chart_id', AP_chart_id, type="AP", class="wi-wider") %] </td>
289       <td class="numeric">[% invtotal | html %]</td>
290       <td colspan="3"></td>
291     </tr>
292   </tfoot>
293 </table>
294
295 [% UNLESS no_payment_bookings %]
296   <table class="tbl-list">
297     <caption>[% 'Payments' | $T8 %]</caption>
298     <thead>
299       <tr>
300         <th>[% 'Date' | $T8 %]</th>
301         <th>[% 'Source' | $T8 %]</th>
302         <th>[% 'Memo' | $T8 %]</th>
303         <th class="right">[% 'Amount' | $T8 %]</th>
304         <th></th>
305         [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
306           <th>[% 'Exch' | $T8 %]</th>
307         [% END %]
308         <th>[% 'Account' | $T8 %]</th>
309         <th>[% 'Project Number' | $T8 %]</th>
310       </tr>
311     </thead>
312     <tbody>
313       [% FOREACH i IN [1..paidaccounts] %] [% temp = "paidaccount_changeable_"_ i %] [% changeable = $temp %]
314       <tr>
315         [% temp = "datepaid_"_ i %]
316         <td>
317           [% IF( changeable ) %] [% L.date_tag(temp, $temp ? $temp : today) %]
318           [% ELSE %] [% $temp | html %] <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% END %]
319         </td>
320         <td>
321           [% temp = "source_"_ i %]
322           [% IF( changeable ) %]  <input type="text" name="[% temp %]" size="11" value="[% $temp | html %]">
323           [% ELSE %] [% $temp | html %]  <input type="hidden" name="[% temp %]" value="[% $temp | html %]">[% END %]
324         </td>
325         <td>
326           [% temp = "memo_"_ i %]
327           [% IF( changeable ) %] <input type="text" name="[% temp %]" size="11" value="[% $temp | html %]">
328           [% ELSE %] [% $temp | html %] <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% END %]
329         </td>
330         <td class="numeric">
331           [% temp = "paid_"_ i %]
332           [% IF( changeable ) %]
333             <input name="[% temp %]" data-validate="number" value="[% $temp | html %]" id="[%- 'payment_' _ temp -%]" size="11" class="numeric">
334           [% ELSE %]
335             [% $temp | html %] [% defaultcurrency %]
336             <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
337           [% END %]
338         </td>
339         <td>
340           [% IF changeable && loop.last && paid_missing > 0 %] <input type="button" id="ap_set_to_paid_missing" value="[% 'Set to paid missing' | $T8 %]"> [% END %]
341         </td>
342         [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
343           <td>
344             [% temp = "exchangerate_"_ i %]
345             [% temp_forex = "forex_"_ i %]
346             [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
347             [% SET record_forex = 'record_forex_' _ i %]
348
349             [% IF( $temp_forex || !changeable ) %]
350               [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %] </br>
351               [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
352               <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
353             [% ELSE %]
354               <input type="text" name="[% temp %]" size="11" value="[% $temp | html %]">
355             [% END %]
356
357             <input type="hidden" name="[% temp_forex %]" value="[% $temp_forex | html %]">
358           </td>
359         [% END %]
360         <td>
361           [% temp     = "AP_paid_"_ i %]
362           [% readonly = "AP_paid_readonly_desc_"_ i %]
363           [% IF( changeable ) %] [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap)) %]
364           [% ELSE %] [% $readonly | html %] <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% END %]
365         </td>
366         <td>
367           [% temp = "paid_project_id_"_ i %]
368           [% IF( changeable ) %] [% P.project.picker(temp, $temp) %]
369           [% ELSE %] <input type="hidden" name="[% temp %]" value="[% $temp | html %]"> [% temp = "label"_ temp %] [% $temp | html %] [% END %]
370         </td>
371       </tr>
372       [% END %]
373     </tbody>
374     <tfoot>
375     <tr>
376       <td></td>
377       <td></td>
378       <th class="right">[% 'Total' | $T8 %]</th>
379       <td class="numeric">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
380       <td></td>
381       [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
382         <td align="numeric">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
383         <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
384         <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
385       [% END %]
386       <td></td>
387       <td></td>
388     </tr>
389     <tr>
390       <td></td>
391       <td></td>
392       <th class="right">[% 'Missing amount' | $T8 %]</th>
393       <td class="numeric">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
394       <td></td>
395       [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
396         <td></td>
397       [% END %]
398       <td></td>
399       <td></td>
400     </tr>
401     </tfoot>
402   </table>
403 [% END %]
404
405 </div><!-- /.wrapper -->
406
407 </div><!-- /#ui-tabs-basic-data -->
408
409 [% PROCESS 'webdav/_list.html' %]
410 <div id="ui-tabs-1">
411  [% LxERP.t8('Loading...') %]
412 </div>
413
414 </div>
415
416
417 <script type="text/javascript">
418  $('#ap_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
419 </script>