ee3aa5cd3a8084ce41176732af39b375eccc5dd2
[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               <tr>
54                 <td></td>
55                 <td colspan=3>
56                   <table width=100%>
57                     <tr>
58                       <th align=left nowrap>[% 'Credit Limit' | $T8 %]</th>
59                       <td>[% LxERP.format_amount(creditlimit, 0) %][% L.hidden_tag('creditlimit', LxERP.format_amount(creditlimit, 0)) %]</td>
60                       <th align=left nowrap>[% 'Remaining' | $T8 %]</th>
61                       <td class="plus[% creditlimit < 0 ? 0 : 1 %]">[% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %]</td>
62                     </tr>
63                   </table>
64                 </td>
65               </tr>
66               <tr>
67                 <th align=right>[% 'Currency' | $T8 %]</th>
68                 <td><select name=currency>[% selectcurrency %]</select></td>
69                 [% L.hidden_tag('selectcurrency', selectcurrency) %]
70                 [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
71                 [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
72                 [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
73
74                 [% L.hidden_tag('forex', forex) %]
75                 [% IF show_exch %]
76                    <th align=right>[% 'Exchangerate' | $T8 %]</th>
77                    <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>
78                 [% END %]
79               </tr>
80               [% department_html %]
81               [%- IF selectdepartment %]
82               <tr>
83                 <th align="right" nowrap>[% 'Department' | $T8 %]</th>
84                 <td colspan=3><select name=department>[% selectdepartment %]</select>
85                 <input type=hidden name=selectdepartment value="[% selectdepartment | html %]">
86                 </td>
87               </tr>
88               [%- END %]
89               <tr>
90                 <td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
91                 <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
92               </tr>
93               <tr>
94                 <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
95                 <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
96               </tr>
97             </table>
98           </td>
99           <td align=right>
100             <table>
101 [%- IF selectemployee %]
102               <tr>
103                 <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
104                 <td  colspan=2><select name=employee>[% selectemployee %]</select>[% L.hidden_tag('selectemployee', selectemployee) %]</td>
105               </tr>
106 [%- ELSE %]
107                 [% L.hidden_tag('employee', employee) %]
108 [%- END %]
109               <tr>
110                 <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
111                 <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>
112               </tr>
113               <tr>
114                 <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
115                 <td><input name=ordnumber size=11 value="[% ordnumber | html %]"></td>
116               </tr>
117               <tr>
118                 <th align=right nowrap>[% 'Invoice Date' | $T8 %]</th>
119                 <td>[% L.date_tag('transdate', transdate) %]</td>
120               </tr>
121               <tr>
122                 <th align=right nowrap>[% 'Due Date' | $T8 %]</th>
123                 <td>[% L.date_tag('duedate', duedate) %]</td>
124               </tr>
125               <tr>
126                 <th align=right nowrap>[% 'Project Number' | $T8 %]</th>
127                 <td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1) %]</td>
128               </tr>
129      </table>
130           </td>
131         </tr>
132       </table>
133     </td>
134   </tr>
135
136                 [% L.hidden_tag('rowcount', rowcount) %]
137   <tr>
138       <td>
139           <table width=100%>
140            <tr class=listheading>
141           <th class=listheading style="width:15%">[% 'Account' | $T8 %]</th>
142           <th class=listheading style="width:10%">[% 'Amount' | $T8 %]</th>
143           <th class=listheading style="width:10%">[% 'Tax' | $T8 %]</th>
144           <th class=listheading style="width:5%">[% 'Taxkey' | $T8 %]</th>
145           <th class=listheading style="width:10%">[% 'Project' | $T8 %]</th>
146         </tr>
147
148
149 [%- FOREACH row IN transactions %]
150         <tr>
151           <td>[% row.selectAR_amount %]</td>
152           <td>[% L.input_tag('amount_' _ loop.count, LxERP.format_amount(row.amount, 2)) %]</td>
153           <td>[% L.hidden_tag('tax_' _ loop.count, LxERP.format_tax(row.tax, 2)) %][% LxERP.format_amount(row.tax, 2) | html %]</td>
154           <td>[% row.taxchart %]</td>
155           <td>[% L.select_tag('project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.project_id, with_empty = 1) %]</td>
156         </tr>
157 [%- END %]
158
159         <tr>
160           <td colspan=6>
161             <hr noshade>
162           </td>
163         </tr>
164         <tr>
165           <td>[% ARselected %]</td>
166           <th align=left>[% LxERP.format_amount(invtotal, 2) | html %]</th>
167
168           <input type=hidden name=oldinvtotal value='[% oldinvtotal %]'>
169           <input type=hidden name=oldtotalpaid value='[% oldtotalpaid %]'>
170
171           <input type=hidden name=taxaccounts value="[% taxaccounts | html %]">
172
173           <td colspan=4></td>
174
175
176         </tr>
177         </table>
178         </td>
179     </tr>
180     <tr>
181       <td>
182         <table width=100%>
183         <tr>
184           <th align=left width=1%>[% 'Notes' | $T8 %]</th>
185           <td align=left><textarea name=notes rows="[% rows %]" cols=50 wrap=soft>[% notes | html %]</textarea></td>
186
187           <th align=left width=1%>[% 'Notes for customer' | $T8 %]</th>
188           <td align=left><textarea name=intnotes rows="[% rows %]" cols=50 wrap=soft readonly>[% intnotes | html %]</textarea></td>
189         </tr>
190       </table>
191     </td>
192   </tr>
193   <tr>
194     <td>
195       <table width=100%>
196         <tr class=listheading>
197           <th colspan=7 class=listheading>[% 'Incoming Payments' | $T8 %]</th>
198         </tr>
199
200         <tr>
201          <th>[% 'Date' | $T8 %]</th>
202          <th>[% 'Source' | $T8 %]</th>
203          <th>[% 'Memo' | $T8 %]</th>
204          <th>[% 'Amount' | $T8 %]</th>
205          <th></th>
206 [%- IF show_exch %]
207          <th>[% 'Exch' | $T8 %]</th>
208 [%- END %]
209          <th>[% 'Account' | $T8 %]</th>
210          <th>[% 'Project Number' | $T8 %]</th>
211         </tr>
212
213 [%- FOREACH row IN payments %]
214         <tr>
215          <td align=center>
216   [%- IF row.changeable %]
217           [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
218   [%- ELSE %]
219          [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
220   [%- END %]
221          </td>
222          <td align=center>
223   [%- IF row.changeable %]
224           <input name="source_[% loop.count %]" size=11 value="[% row.source | html %]">
225   [%- ELSE %]
226          [% row.source | html %]<input type=hidden name="source_[% loop.count %]" value="[% row.source | html %]">
227   [%- END %]
228          </td>
229          <td align=center>
230   [%- IF row.changeable %]
231           <input name="memo_[% loop.count %]" size=11 value="[% row.memo | html %]">
232   [%- ELSE %]
233          [% row.memo | html %]<input type=hidden name="memo_[% loop.count %]" value="[% row.memo | html %]">
234   [%- END %]
235          </td>
236          <td align=center>
237   [%- IF row.changeable %]
238           <input name="paid_[% loop.count %]" size=11 value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" onBlur="check_right_number_format(this)">
239   [%- ELSE %]
240          [% row.paid | html %]<input type=hidden name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]">
241   [%- END %]
242          </td>
243          <td>
244            [% IF row.changeable && loop.last && paid_missing > 0 %]
245              <input type="button" id="ar_set_to_paid_missing" value="[% "Set to paid missing" | $T8 %]">
246            [% END %]
247          </td>
248 [%- IF show_exch %]
249          <td align=center>
250     [%- IF row.forex || !row.changeable%]
251           <input type=hidden name="exchangerate_[% loop.count %]" value='[% row.exchangerate | html %]'>[% row.exchangerate | html %]
252     [%- ELSE %]
253           <input name="exchangerate_[% loop.count %]" size=10 value='[% row.exchangerate | html %]'>
254     [%- END %]
255           <input type=hidden name="forex_[% loop.count %]" value='[% row.forex | html %]'>
256          </td>
257 [%- END %]
258          <td align=center>
259   [%- IF row.changeable %]
260           [% row.selectAR_paid %]
261   [%- ELSE %]
262          [% row.AR_paid | html %]<input type=hidden name="AR_paid_[% loop.count %]" value='[% row.AR_paid | html %]'>
263   [%- END %]
264          </td>
265          <td>
266   [%- IF row.changeable %]
267           [% L.select_tag('paid_project_id_' _ loop.count, ALL_PROJECTS, title_key = 'projectnumber', default = row.paid_project_id, with_empty=1) %]
268   [%- ELSE %]
269           [% project_labels.${row.paid_project_id} | html %]
270           <input type=hidden name="paid_project_id_[% loop.count %]" value='[% row.paid_project_id %]'>
271   [%- END %]
272          </td>
273
274          <input type=hidden name="acc_trans_id_[% loop.count %]" value='[% row.acc_trans_id | html %]'>
275          <input type=hidden name="gldate_[% loop.count %]" value='[% row.gldate | html %]'>
276         </tr>
277 [%- END %]
278         <tr>
279           <td></td>
280           <td></td>
281           <td align="center">[% 'Total' | $T8 %]</td>
282           <td align="center">[% LxERP.format_amount(totalpaid, 2) | html %]</td>
283         </tr>
284         <tr>
285           <td></td>
286           <td></td>
287           <td align="center">[% 'Missing amount' | $T8 %]</td>
288           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
289         </tr>
290         <input type=hidden name=paidaccounts value='[% paidaccounts %]'>
291
292       </table>
293     </td>
294   </tr>
295 </table>
296 </div>
297 </div>
298
299 <script type='text/javascript'>
300  $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val('[% LxERP.format_amount(paid_missing, 2) %]') });
301 </script>