d42d70c187e475459a486614337b309ba0e39a0b
[kivitendo-erp.git] / templates / webpages / ar / form_header.html
1 [%- USE HTML %]
2 [%- USE L %]
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 name="arledger" action="[% script %]" id="form">
11
12 [% L.hidden_tag('id', id) %]
13 [% L.hidden_tag('sort', sort) %]
14 [% L.hidden_tag('closedto', closedto) %]
15 [% L.hidden_tag('locked', locked) %]
16 [% L.hidden_tag('title', title_str) %]
17 [% L.hidden_tag('follow_up_trans_id_1', id) %]
18 [% L.hidden_tag('follow_up_trans_type_1', 'ar_transaction') %]
19 [% L.hidden_tag('follow_up_trans_info_1', follow_up_trans_info) %]
20 [% L.hidden_tag('follow_up_rowcount', 1) %]
21 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
22
23 [%- IF saved_message %]<p>[% saved_message | html  %]</p>[% END %]
24
25 <div class="tabwidget">
26  <ul>
27   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
28 [%- IF id %]
29   [%- IF INSTANCE_CONF.get_doc_storage %]
30   <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
31   [%- END %]
32   [% IF AUTH.assert('record_links', 1) %]
33   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
34   [%- END %]
35   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
36 [%- END %]
37  </ul>
38
39 <div id="ui-tabs-basic-data">
40 <table width=100%>
41   <tr valign=top>
42     <td>
43       <table width=100%>
44         <tr valign=top>
45           <td>
46             <table>
47               <tr>
48                 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
49                 <td colspan=3>
50                  [% P.customer_vendor.picker("customer_id", customer_id, type="customer", style="width: 330px", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
51                  [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
52                  [% L.hidden_tag("previous_customer_id", customer_id) %]
53                  [% L.hidden_tag('terms', terms) %]
54                </td>
55               </tr>
56 [%- IF max_dunning_level || invoice_obj.dunning_config_id  %]
57               <tr>
58                 <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
59                 <td valign="top">
60                  [% IF invoice_obj.dunning_config_id %]
61                   <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
62                   [% IF max_dunning_level %]<br>[% END %]
63                  [% END %]
64                  [% IF max_dunning_level %]
65                   <span class="customer_dunning_level">
66                    [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
67                    <br>
68                    [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
69                   </span>
70                  [% END %]
71                 </td>
72               </tr>
73 [%- END %]
74               <tr>
75                 <th align="right" valign="top">[% LxERP.t8("Credit Limit") %]</th>
76                 <td>
77                  [% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %];
78                  [% LxERP.t8("Remaining") %]
79                  <span class="plus[% creditremaining < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</span>
80                 </td>
81               </tr>
82 [%- IF invoice_obj.sepa_exports.as_list.size %]
83               <tr>
84                 <th align="right">[% LxERP.t8("SEPA exports") %]</th>
85                 <td>
86                  [% FOREACH export = invoice_obj.sepa_exports.as_list %]
87                   <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
88                   [% UNLESS loop.last %], [% END %]
89                  [% END %]
90                 </td>
91               </tr>
92 [%- END %]
93               <tr>
94                 <th align=right>[% 'Currency' | $T8 %]</th>
95                 <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
96                 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
97                 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
98                 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
99
100                 [% L.hidden_tag('forex', forex) %]
101                 [% IF show_exch %]
102                    <th align=right>[% 'Exchangerate' | $T8 %]</th>
103                    <td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1)) %][% LxERP.format_amount(exchangerate, 5, 1) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5, 1), size=10) %][%- END %]</td>
104                 [% END %]
105               </tr>
106               [% IF ALL_DEPARTMENTS %]
107                 <tr>
108                   <th align="right" nowrap>[% 'Department' | $T8 %]</th>
109                   <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width:334px') %]</td>
110                 </tr>
111               [% END %]
112               <tr>
113                 <th align="right">[% 'Transaction description' | $T8 %]</th>
114                 <td colspan="3">[% L.input_tag("transaction_description", transaction_description, style="width:330px", "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
115               </tr>
116               <tr>
117                 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
118                 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
119               </tr>
120               <tr>
121                 <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
122                 <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
123               </tr>
124             </table>
125           </td>
126           <td align=right>
127             <table>
128               <tr>
129                 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
130                 <td  colspan=2>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
131               </tr>
132               <tr>
133                 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
134                 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
135               </tr>
136               <tr>
137                 <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
138                 <td><input name=ordnumber size=11 value="[% ordnumber | html %]"></td>
139               </tr>
140               <tr>
141                 <th align=right nowrap>[% 'Invoice Date' | $T8 %]</th>
142                 <td>[% L.date_tag('transdate', transdate) %]</td>
143               </tr>
144               <tr>
145                 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
146                 <td>[% L.date_tag('duedate', duedate) %]</td>
147               </tr>
148               <tr>
149                 <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
150                 <td>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
151               </tr>
152               <tr>
153                 <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
154                 <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
155               </tr>
156               <tr>
157                 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
158                 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]</td>
159               </tr>
160      </table>
161           </td>
162         </tr>
163       </table>
164     </td>
165   </tr>
166
167                 [% L.hidden_tag('rowcount', rowcount) %]
168   <tr>
169       <td>
170           <table width=100%>
171            <tr class=listheading>
172           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
173           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
174           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
175           <th class=listheading style="width:5%">[% 'Taxkey' | $T8 %]</th>
176           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
177         </tr>
178
179
180 [%- FOREACH row IN transactions %]
181         <tr>
182           <td>[% row.selectAR_amount %]</td>
183           <td>[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %]</td>
184           <td>[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
185           <td>[% row.taxchart %]</td>
186           <td>[% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]</td>
187         </tr>
188 [%- END %]
189
190         <tr>
191           <td colspan=6>
192             <hr noshade>
193           </td>
194         </tr>
195         <tr>
196           <td>[% P.chart.picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
197           <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
198
199           <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
200           <input type=hidden name=oldtotalpaid value='[% oldtotalpaid %]'>
201
202           <input type=hidden name=taxaccounts value="[% taxaccounts | html %]">
203
204           <td colspan=4></td>
205
206
207         </tr>
208         </table>
209         </td>
210     </tr>
211     <tr>
212       <td>
213         <table width=100%>
214         <tr>
215           <th align=left width=1%>[% 'Notes' | $T8 %]</th>
216           <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
217
218           <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
219           <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
220         </tr>
221       </table>
222     </td>
223   </tr>
224   <tr>
225     <td>
226       <table width=100%>
227         <tr class=listheading>
228           <th colspan=7 class=listheading>[% 'Incoming Payments' | $T8 %]</th>
229         </tr>
230
231         <tr>
232          <th>[% 'Date' | $T8 %]</th>
233          <th>[% 'Source' | $T8 %]</th>
234          <th>[% 'Memo' | $T8 %]</th>
235          <th>[% 'Amount' | $T8 %]</th>
236          <th></th>
237 [%- IF show_exch %]
238          <th>[% 'Exch' | $T8 %]</th>
239 [%- END %]
240          <th>[% 'Account' | $T8 %]</th>
241          <th>[% 'Project Number' | $T8 %]</th>
242         </tr>
243
244 [%- FOREACH row IN payments %]
245         <tr>
246          <td align=center>
247   [%- IF row.changeable %]
248           [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
249   [%- ELSE %]
250          [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
251   [%- END %]
252          </td>
253          <td align=center>
254   [%- IF row.changeable %]
255           <input name="source_[% loop.count %]" size=11 value="[% row.source | html %]">
256   [%- ELSE %]
257          [% row.source | html %]<input type=hidden name="source_[% loop.count %]" value="[% row.source | html %]">
258   [%- END %]
259          </td>
260          <td align=center>
261   [%- IF row.changeable %]
262           <input name="memo_[% loop.count %]" size=11 value="[% row.memo | html %]">
263   [%- ELSE %]
264          [% row.memo | html %]<input type=hidden name="memo_[% loop.count %]" value="[% row.memo | html %]">
265   [%- END %]
266          </td>
267          <td align=center>
268   [%- IF row.changeable %]
269           <input name="paid_[% loop.count %]" size=11 data-validate="number" class="numeric" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
270   [%- ELSE %]
271          [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
272   [%- END %]
273          </td>
274          <td>
275            [% IF row.changeable && loop.last && paid_missing > 0 %]
276              <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
277            [% END %]
278          </td>
279 [%- IF show_exch %]
280          <td align=center>
281     [%- IF row.forex || !row.changeable%]
282           <input type=hidden name="exchangerate_[% loop.count %]" value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]
283     [%- ELSE %]
284           <input name="exchangerate_[% loop.count %]" size=10 value="[%- LxERP.format_amount(row.exchangerate, 5, 1) -%]">
285     [%- END %]
286           <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
287          </td>
288 [%- END %]
289          <td align=center>
290   [%- IF row.changeable %]
291           [% row.selectAR_paid %]
292   [%- ELSE %]
293          [% row.AR_paid | html %]<input type=hidden name="AR_paid_[% loop.count %]" value='[% row.AR_paid | html %]'>
294   [%- END %]
295          </td>
296          <td>
297   [%- IF row.changeable %]
298           [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %]
299   [%- ELSE %]
300           [% project_labels.${row.paid_project_id} | html %]
301           <input type=hidden name="paid_project_id_[% loop.count %]" value='[% row.paid_project_id %]'>
302   [%- END %]
303          </td>
304
305          <input type=hidden name="acc_trans_id_[% loop.count %]" value='[% row.acc_trans_id | html %]'>
306          <input type=hidden name="gldate_[% loop.count %]" value='[% row.gldate | html %]'>
307         </tr>
308 [%- END %]
309         <tr>
310           <td></td>
311           <td></td>
312           <td align="center">[% 'Total' | $T8 %]</td>
313           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
314         </tr>
315         <tr>
316           <td></td>
317           <td></td>
318           <td align="center">[% 'Missing amount' | $T8 %]</td>
319           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
320         </tr>
321         <input type=hidden name=paidaccounts value='[% paidaccounts %]'>
322
323       </table>
324     </td>
325   </tr>
326 </table>
327 </div>
328 </div>
329
330 <script type='text/javascript'>
331  $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
332 </script>