Debitorenbuchungen: Währungs-/Verkäufer-Drop-Downs nicht als Hidden mitschleifen
[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 <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 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
18
19 <h1>[% title | html %]</h1>
20
21 [%- IF saved_message %]<p>[% saved_message | html  %]</p>[% END %]
22
23 <div class="tabwidget">
24  <ul>
25   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
26 [%- IF id %]
27   [% IF AUTH.assert('record_links', 1) %]
28   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
29   [%- END %]
30   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
31 [%- END %]
32  </ul>
33
34 <div id="ui-tabs-basic-data">
35 <table width=100%>
36   <tr valign=top>
37     <td>
38       <table width=100%>
39         <tr valign=top>
40           <td>
41             <table>
42               <tr>
43                 <th align="right" nowrap>[% 'Customer' | $T8 %]</th>
44                 <td colspan=3>
45 [%- IF selectcustomer %]
46     <select id='customer' name="customer" onchange="document.getElementById('update_button').click();"[% IF initial_focus == 'customer'%] class="initial_focus"[% END %]>[% selectcustomer %]</select>
47 [%- ELSE %]
48     <input id='customer' name=customer value="[% customer | html %]" size=35[% IF initial_focus == 'customer'%] class="initial_focus"[% END %]>
49 [%- END %]
50                 <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('customer')"></td>
51                 [% L.hidden_tag('selectcustomer', selectcustomer) %]
52                 [% L.hidden_tag('oldcustomer', oldcustomer) %]
53                 [% L.hidden_tag('customer_id', customer_id) %]
54                 [% L.hidden_tag('terms', terms) %]
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)) %][% LxERP.format_amount(exchangerate, 5) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5), 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) %]</td>
110                 </tr>
111               [% END %]
112               <tr>
113                 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
114                 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
115               </tr>
116               <tr>
117                 <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
118                 <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
119               </tr>
120             </table>
121           </td>
122           <td align=right>
123             <table>
124               <tr>
125                 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
126                 <td  colspan=2>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
127               </tr>
128               <tr>
129                 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
130                 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
131               </tr>
132               <tr>
133                 <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
134                 <td><input name=ordnumber size=11 value="[% ordnumber | html %]"></td>
135               </tr>
136               <tr>
137                 <th align=right nowrap>[% 'Invoice Date' | $T8 %]</th>
138                 <td>[% L.date_tag('transdate', transdate) %]</td>
139               </tr>
140               <tr>
141                 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
142                 <td>[% L.date_tag('duedate', duedate) %]</td>
143               </tr>
144               <tr>
145                 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
146                 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]</td>
147               </tr>
148      </table>
149           </td>
150         </tr>
151       </table>
152     </td>
153   </tr>
154
155                 [% L.hidden_tag('rowcount', rowcount) %]
156   <tr>
157       <td>
158           <table width=100%>
159            <tr class=listheading>
160           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
161           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
162           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
163           <th class=listheading style="width:5%">[% 'Taxkey' | $T8 %]</th>
164           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
165         </tr>
166
167
168 [%- FOREACH row IN transactions %]
169         <tr>
170           <td>[% row.selectAR_amount %]</td>
171           <td>[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %]</td>
172           <td>[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
173           <td>[% row.taxchart %]</td>
174           <td>[% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]</td>
175         </tr>
176 [%- END %]
177
178         <tr>
179           <td colspan=6>
180             <hr noshade>
181           </td>
182         </tr>
183         <tr>
184           <td>[% P.chart_picker("AR_chart_id", AR_chart_id, style="width: 400px", type="AR") %]</td>
185           <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
186
187           <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
188           <input type=hidden name=oldtotalpaid value='[% oldtotalpaid %]'>
189
190           <input type=hidden name=taxaccounts value="[% taxaccounts | html %]">
191
192           <td colspan=4></td>
193
194
195         </tr>
196         </table>
197         </td>
198     </tr>
199     <tr>
200       <td>
201         <table width=100%>
202         <tr>
203           <th align=left width=1%>[% 'Notes' | $T8 %]</th>
204           <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
205
206           <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
207           <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
208         </tr>
209       </table>
210     </td>
211   </tr>
212   <tr>
213     <td>
214       <table width=100%>
215         <tr class=listheading>
216           <th colspan=7 class=listheading>[% 'Incoming Payments' | $T8 %]</th>
217         </tr>
218
219         <tr>
220          <th>[% 'Date' | $T8 %]</th>
221          <th>[% 'Source' | $T8 %]</th>
222          <th>[% 'Memo' | $T8 %]</th>
223          <th>[% 'Amount' | $T8 %]</th>
224          <th></th>
225 [%- IF show_exch %]
226          <th>[% 'Exch' | $T8 %]</th>
227 [%- END %]
228          <th>[% 'Account' | $T8 %]</th>
229          <th>[% 'Project Number' | $T8 %]</th>
230         </tr>
231
232 [%- FOREACH row IN payments %]
233         <tr>
234          <td align=center>
235   [%- IF row.changeable %]
236           [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
237   [%- ELSE %]
238          [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
239   [%- END %]
240          </td>
241          <td align=center>
242   [%- IF row.changeable %]
243           <input name="source_[% loop.count %]" size=11 value="[% row.source | html %]">
244   [%- ELSE %]
245          [% row.source | html %]<input type=hidden name="source_[% loop.count %]" value="[% row.source | html %]">
246   [%- END %]
247          </td>
248          <td align=center>
249   [%- IF row.changeable %]
250           <input name="memo_[% loop.count %]" size=11 value="[% row.memo | html %]">
251   [%- ELSE %]
252          [% row.memo | html %]<input type=hidden name="memo_[% loop.count %]" value="[% row.memo | html %]">
253   [%- END %]
254          </td>
255          <td align=center>
256   [%- IF row.changeable %]
257           <input name="paid_[% loop.count %]" size=11 value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" onBlur="check_right_number_format(this)">
258   [%- ELSE %]
259          [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
260   [%- END %]
261          </td>
262          <td>
263            [% IF row.changeable && loop.last && paid_missing > 0 %]
264              <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
265            [% END %]
266          </td>
267 [%- IF show_exch %]
268          <td align=center>
269     [%- IF row.forex || !row.changeable%]
270           <input type=hidden name="exchangerate_[% loop.count %]" value='[% row.exchangerate | html %]'>[% row.exchangerate | html %]
271     [%- ELSE %]
272           <input name="exchangerate_[% loop.count %]" size=10 value='[% row.exchangerate | html %]'>
273     [%- END %]
274           <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
275          </td>
276 [%- END %]
277          <td align=center>
278   [%- IF row.changeable %]
279           [% row.selectAR_paid %]
280   [%- ELSE %]
281          [% row.AR_paid | html %]<input type=hidden name="AR_paid_[% loop.count %]" value='[% row.AR_paid | html %]'>
282   [%- END %]
283          </td>
284          <td>
285   [%- IF row.changeable %]
286           [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %]
287   [%- ELSE %]
288           [% project_labels.${row.paid_project_id} | html %]
289           <input type=hidden name="paid_project_id_[% loop.count %]" value='[% row.paid_project_id %]'>
290   [%- END %]
291          </td>
292
293          <input type=hidden name="acc_trans_id_[% loop.count %]" value='[% row.acc_trans_id | html %]'>
294          <input type=hidden name="gldate_[% loop.count %]" value='[% row.gldate | html %]'>
295         </tr>
296 [%- END %]
297         <tr>
298           <td></td>
299           <td></td>
300           <td align="center">[% 'Total' | $T8 %]</td>
301           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
302         </tr>
303         <tr>
304           <td></td>
305           <td></td>
306           <td align="center">[% 'Missing amount' | $T8 %]</td>
307           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
308         </tr>
309         <input type=hidden name=paidaccounts value='[% paidaccounts %]'>
310
311       </table>
312     </td>
313   </tr>
314 </table>
315 </div>
316 </div>
317
318 <script type='text/javascript'>
319  $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
320 </script>