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