]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/ar/form_header.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / ar / form_header.html
1 [% USE HTML %]
2 [% USE L %]
3 [% USE T8 %]
4 [% USE LxERP %]
5 [% USE P %]
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" name="arledger" action="[% script %]" id="form">
15
16 [% L.hidden_tag('id', id) %]
17 [% L.hidden_tag('sort', sort) %]
18 [% L.hidden_tag('closedto', closedto) %]
19 [% L.hidden_tag('locked', locked) %]
20 [% L.hidden_tag('title', title_str) %]
21 [% L.hidden_tag('follow_up_trans_id_1', id) %]
22 [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %]
23 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
24 [% L.hidden_tag('follow_up_rowcount', 1) %]
25 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
26
27 [% IF !id %]
28 [%   L.hidden_tag('form_validity_token', form_validity_token) %]
29 [% END %]
30 [% L.hidden_tag('email_journal_id',             email_journal_id) %]
31 [% L.hidden_tag('email_attachment_id',          email_attachment_id) %]
32 [% L.hidden_tag('workflow_email_journal_id',    workflow_email_journal_id) %]
33 [% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
34 [% L.hidden_tag('workflow_email_callback',      workflow_email_callback) %]
35
36 [% IF saved_message %]<p class="message message_info">[% saved_message | html  %]</p>[% END %]
37
38 <div class="tabwidget">
39
40 <ul>
41   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
42   [% IF email_attachment_id || workflow_email_attachment_id %]
43     <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>
44   [% END %]
45   [% IF id %]
46     [% IF INSTANCE_CONF.get_doc_storage %]
47       <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
48     [% END %]
49     [% IF AUTH.assert('record_links', 1) %]
50       <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
51     [% END %]
52       <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
53   [% END %]
54 </ul>
55
56
57 <div id="ui-tabs-basic-data">
58
59 [% IF email_attachment_id || workflow_email_attachment_id %]
60   <div class="wrapper" id="email_attachment_wrapper">
61     [%
62       BLOCK panel_1;
63         P.email_journal.attachment_preview(
64              email_attachment_id || workflow_email_attachment_id,
65              style="height:600px"
66              );
67       END;
68       INCLUDE 'common/toggle_panel.html'
69         block_name='panel_1'
70         button_closed  = LxERP.t8('Show Attachment')
71         button_open    = LxERP.t8('Hide Attachment')
72         ;
73     %]
74   </div>
75 [% END %]
76
77 <div class="wrapper">
78
79   <table class="tbl-horizontal">
80     <caption>[% 'Customer &amp; Order' | $T8 %]</caption>
81     <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
82     <tbody>
83       <tr>
84         <th>[% 'Customer' | $T8 %]</th>
85         <td class="wi-lightwide">
86          [% P.customer_vendor.picker("customer_id", customer_id, type="customer", show_details="1") %]
87          [% L.hidden_tag("previous_customer_id", customer_id) %]
88          [% L.hidden_tag('terms', terms) %]
89        </td>
90       </tr>
91       [% IF max_dunning_level || invoice_obj.dunning_config_id  %]
92       <tr>
93         <th>[% LxERP.t8("Dunning status") %]</th>
94         <td>
95           [% IF invoice_obj.dunning_config_id %]
96           <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
97             [% IF max_dunning_level %]<br>[% END %]
98           [% END %]
99           [% IF max_dunning_level %]
100           <span class="customer_dunning_level">
101             [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %] <br>
102             [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
103           </span>
104          [% END %]
105         </td>
106       </tr>
107       [% END %]
108       <tr>
109         <th>[% LxERP.t8("Credit Limit") %]</th>
110         <td>
111           <span class="data wi-lightwide">
112             [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %],
113             [% LxERP.t8("Remaining") %]
114             <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
115           </span>
116         </td>
117       </tr>
118       [% IF invoice_obj.sepa_exports.as_list.size %]
119       <tr>
120         <th>[% LxERP.t8("SEPA exports") %]</th>
121         <td>
122          [% FOREACH export = invoice_obj.sepa_exports.as_list %]
123           <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
124           [% UNLESS loop.last %], [% END %]
125          [% END %]
126         </td>
127       </tr>
128       [% END %]
129       <tr>
130         <th>[% 'Currency' | $T8 %]</th>
131         <td>
132           [%- IF readonly  %]
133             [% HTML.escape(currency) %]
134             [% L.hidden_tag("currency", currency) %]
135           [%- ELSE %]
136             [% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name", class="wi-lightwide") %]
137           [%- END %]
138         </td>
139         [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
140         [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
141         [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
142         [% L.hidden_tag('forex', forex) %]
143       </tr>
144       [% IF show_exch %]
145       <tr>
146         <th>[% 'Exchangerate' | $T8 %]</th>
147         <td>
148           [%- IF readonly  %]
149             [% LxERP.format_amount(exchangerate, 5) %]
150             [% L.hidden_tag("exchangerate", LxERP.format_amount(exchangerate, 5)) %]
151           [%- ELSE %]
152             [% L.input_tag("exchangerate", LxERP.format_amount(exchangerate), class="wi-lightwide") %]
153           [%- END %]
154           [% IF record_forex %][% 'record exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
155         </td>
156       </tr>
157       [% END %]
158       </tr>
159       [% IF ALL_DEPARTMENTS %]
160         <tr>
161           <th>[% 'Department' | $T8 %]</th>
162           <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, default=department_id, title_key='description', with_empty=1, class="wi-lightwide") %]</td>
163         </tr>
164       [% END %]
165       <tr>
166         <th>[% 'Transaction description' | $T8 %]</th>
167         <td>[% L.input_tag("transaction_description", transaction_description, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '', class="wi-lightwide") %]</td>
168       </tr>
169       <tr>
170         <th></th>
171         <td>[% L.checkbox_tag('taxincluded', checked=taxincluded, label=LxERP.t8('Tax Included')) %]</td>
172       </tr>
173       <tr>
174         <th></th>
175         <td>[% L.checkbox_tag('direct_debit', checked=direct_debit, label=LxERP.t8('direct debit')) %]</td>
176       </tr>
177     </tbody>
178   </table>
179
180   <table class="tbl-horizontal">
181     <caption>[% 'Notes' | $T8 %]</caption>
182     <colgroup><col class="wi-wide"></colgroup>
183     <tbody>
184       <tr>
185         <td>
186           [% L.textarea_tag("notes", HTML.escape(notes), rows=rows, class="wi-wide") %]
187         </td>
188       </tr>
189       <tr>
190         <td>
191           <span class="label above">[% 'Notes for customer' | $T8 %]</span>
192           [% L.textarea_tag("intnotes", HTML.escape(intnotes), rows=rows, readonly=readonly, class="wi-wide") %]
193         </td>
194       </tr>
195     </tbody>
196   </table>
197
198   <table class="tbl-horizontal">
199     <caption>[% 'Numbers & Dates' | $T8 %]</caption>
200     <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
201     <tbody>
202       <tr>
203         <th>[% 'Salesperson' | $T8 %]</th>
204         <td>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
205       </tr>
206       <tr>
207         <th>[% 'Invoice Number' | $T8 %]</th>
208         <td>[% L.input_tag("invnumber", invnumber, size="11") %]</td>
209       </tr>
210       <tr>
211         <th>[% 'Order Number' | $T8 %]</th>
212         <td>[% L.input_tag("ordnumber", ordnumber, size="11") %]</td>
213       </tr>
214       <tr>
215         <th>[% 'Invoice Date' | $T8 %]</th>
216         <td>[% L.date_tag('transdate', transdate) %]</td>
217       </tr>
218       <tr>
219         <th>[% 'Due Date' | $T8 %]</th>
220         <td>[% L.date_tag('duedate', duedate) %]</td>
221       </tr>
222       <tr>
223         <th>[% LxERP.t8('Tax point') %]</th>
224         <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
225       </tr>
226       <tr>
227         <th>[% 'Delivery Date' | $T8 %]</th>
228         <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
229       </tr>
230       <tr>
231         <th>[% 'Project Number' | $T8 %]</th>
232         <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]</td>
233       </tr>
234     </tbody>
235   </table>
236
237 </div><!-- /.wrapper -->
238
239 [% L.hidden_tag('rowcount', rowcount) %]
240
241 <div class="wrapper">
242
243 <table class="tbl-list">
244   <caption>[% 'Transactions' | $T8 %]</caption>
245   <thead>
246     <tr>
247       <th>[% 'Account' | $T8 %]</th>
248       <th class="right">[% 'Amount' | $T8 %]</th>
249       <th class="right">[% 'Tax' | $T8 %]</th>
250       <th>[% 'Taxkey' | $T8 %]</th>
251       <th>[% 'Project' | $T8 %]</th>
252     </tr>
253   </thead>
254   <tbody>
255     [% FOREACH row IN transactions %]
256     <tr>
257       <td class="wi-wider">[% row.selectAR_amount %]</td>
258       <td class="numeric">[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2), class='wi-small numeric') %]</td>
259       <td class="numeric">[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
260       <td>[% row.taxchart %]</td>
261       <td>[% P.project.picker("project_id_"_ loop.count, row.project_id) %]</td>
262     </tr>
263     [% END %]
264   </tbody>
265   <tfoot>
266     <tr>
267       <td>[% P.chart.picker("AR_chart_id", AR_chart_id, type="AR", class="wi-wider") %]</td>
268       <th class="numeric">[% LxERP.format_amount(invtotal, 2) | html %]</th>
269         <input type="hidden" name="oldinvtotal" value="[% oldinvtotal %]">
270         <input type="hidden" name="oldtotalpaid" value="[% oldtotalpaid %]">
271         <input type="hidden" name="taxaccounts" value="[% taxaccounts | html %]">
272       <td colspan="3"></td>
273     </tr>
274   </tfoot>
275 </table>
276
277
278 <table class="tbl-list" style="width:90%;">
279   <caption>[% 'Incoming Payments' | $T8 %]</caption>
280   <thead>
281     <tr>
282       <th>[% 'Date' | $T8 %]</th>
283       <th>[% 'Source' | $T8 %]</th>
284       <th>[% 'Memo' | $T8 %]</th>
285       <th class="right">[% 'Amount' | $T8 %]</th>
286       <th></th>
287       [% IF show_exch %]
288         <th>[% 'Exch' | $T8 %]</th>
289       [% END %]
290       <th>[% 'Account' | $T8 %]</th>
291       <th>[% 'Project Number' | $T8 %]</th>
292     </tr>
293   </thead>
294   <tbody>
295     [% FOREACH row IN payments %]
296     <tr>
297       <td>
298         [% IF row.changeable %]
299           [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
300         [% ELSE %]
301           [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
302         [% END %]
303       </td>
304       <td>
305       [% IF row.changeable %]
306         <input type="text" name="source_[% loop.count %]" size="11" value="[% row.source | html %]">
307       [% ELSE %]
308         [% row.source | html %]<input type="hidden" name="source_[% loop.count %]" value="[% row.source | html %]">
309       [% END %]
310       </td>
311       <td>
312         [% IF row.changeable %]
313           <input type="text" name="memo_[% loop.count %]" size="11" value="[% row.memo | html %]">
314         [% ELSE %]
315           [% row.memo | html %]<input type="hidden" name="memo_[% loop.count %]" value="[% row.memo | html %]">
316         [% END %]
317       </td>
318       <td class="numeric">
319         [% IF row.changeable %]
320           <input name="paid_[% loop.count %]" id="payment_paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" size="11" type="text" data-validate="number" class="numeric">
321         [% ELSE %]
322           [% LxERP.format_amount(row.paid, 2) | html %]<input type="hidden" name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]"> [% defaultcurrency %]
323         [% END %]
324       </td>
325       <td>
326         [% IF row.changeable && loop.last && paid_missing > 0 %]
327           <input type="button" id="ar_set_to_paid_missing" value="[% 'Set to paid missing' | $T8 %]">
328         [% END %]
329       </td>
330       [% IF show_exch %]
331         <td class="numeric">
332           [% IF row.forex || !row.changeable%]
333             <input type="hidden" name="exchangerate_[% loop.count %]" value="[% LxERP.format_amount(row.exchangerate, 5, 1) %]">
334             [%- LxERP.format_amount(row.exchangerate, 5, 0) -%] = [% LxERP.format_amount(row.defaultcurrency_paid, 2) %] [% defaultcurrency %]</br>
335             [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
336           [% ELSE %]
337             <input type="text" name="exchangerate_[% loop.count %]" size="10" value="[% LxERP.format_amount(row.exchangerate, 5, 1) %]">
338           [% END %]
339             <input type="hidden" name="forex_[% loop.count %]" value="[% row.forex | html %]">
340         </td>
341       [% END %]
342       <td>
343         [% IF row.changeable %]
344           [% row.selectAR_paid %]
345         [% ELSE %]
346           [% row.AR_paid | html %]<input type="hidden" name="AR_paid_[% loop.count %]" value="[% row.AR_paid | html %]">
347         [% END %]
348       </td>
349       <td>
350         [% IF row.changeable %]
351           [% P.project.picker("paid_project_id_"_ loop.count, row.paid_project_id) %]
352         [% ELSE %]
353           [% project_labels.${row.paid_project_id} | html %]
354           <input type="hidden" name="paid_project_id_[% loop.count %]" value="[% row.paid_project_id %]">
355         [% END %]
356         <input type="hidden" name="acc_trans_id_[% loop.count %]" value="[% row.acc_trans_id | html %]">
357         <input type="hidden" name="gldate_[% loop.count %]" value="[% row.gldate | html %]">
358        </td>
359     </tr>
360     [% END %]
361   </tbody>
362   <tfoot>
363     <tr>
364       <td></td>
365       <td></td>
366       <th class="right">[% 'Total' | $T8 %]</th>
367       <td class="numeric">[% LxERP.format_amount(totalpaid, 2) | html %]  [% currency %] </td>
368       <td></td>
369       [% IF show_exch %]
370         <td align="numeric">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
371         <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
372         <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
373       [% END %]
374       <td></td>
375       <td></td>
376     </tr>
377     <tr>
378       <td></td>
379       <td></td>
380       <th class="right">[% 'Missing amount' | $T8 %]</th>
381       <td class="numeric">
382         [% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]
383         <input type="hidden" name="paidaccounts" value="[% paidaccounts %]">
384       </td>
385       <td></td>
386       [% IF show_exch %]
387         <td></td>
388       [% END %]
389       <td></td>
390       <td></td>
391     </tr>
392   </tfoot>
393 </table>
394
395 </div><!-- /.wrapper -->
396
397 </div><!-- /#ui-tabs-basic-data -->
398 </div><!-- ./tabwidget -->
399
400 <script type="text/javascript">
401  $('#ar_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
402 </script>