162c59c843188a5870bd60bd65c43222ceb7fa84
[kivitendo-erp.git] / templates / webpages / rp / report.html
1 [%- USE HTML %]
2 [%- USE LxERP %]
3 [%- USE L %]
4 [%- USE T8 %]
5
6 [%- BLOCK customized_report %]
7   <tr>
8     <th align=left><input name=reporttype class=radio type=radio value="custom" checked>[% 'Customized Report' | $T8 %]</th>
9   </tr>
10   <tr>
11     <th colspan=1>[% 'Year' | $T8 %]</th>
12     <td>
13       <input name=year size=11 title="[% 'YYYY' | $T8 %]" value="[% year %]" class="initial_focus" oninput='set_from_to(duetyp.value, this.value)'>
14     </td>
15   </tr>
16   <tr>
17     <td align=right> <b>[% 'Yearly' | $T8 %]</b> </td>
18     <th align=left>[% 'Quarterly' | $T8 %]</th>
19     <th align=left colspan=3>[% 'Monthly' | $T8 %]</th>
20   </tr>
21   <tr>
22     <td align=right>&nbsp;
23       <input name=duetyp class=radio type=radio value="13" checked onchange='set_from_to(this.value, year.value)'>
24     </td>
25     <td><input name=duetyp class=radio type=radio value="A" onchange='set_from_to(this.value, year.value)'>
26       &nbsp;1. [% 'Quarter' | $T8 %]
27     </td>
28     <td><input name=duetyp class=radio type=radio value="1" onchange='set_from_to(this.value, year.value)'>
29       &nbsp;[% 'January' | $T8 %]
30     </td>
31     <td><input name=duetyp class=radio type=radio value="5" onchange='set_from_to(this.value, year.value)'>
32       &nbsp;[% 'May' | $T8 %]
33     </td>
34     <td><input name=duetyp class=radio type=radio value="9" onchange='set_from_to(this.value, year.value)'>
35       &nbsp;[% 'September' | $T8 %]
36     </td>
37   </tr>
38   <tr>
39     <td align= right>&nbsp;</td>
40     <td><input name=duetyp class=radio type=radio value="B" onchange='set_from_to(this.value, year.value)'>
41       &nbsp;2. [% 'Quarter' | $T8 %]
42     </td>
43     <td><input name=duetyp class=radio type=radio value="2" onchange='set_from_to(this.value, year.value)'>
44       &nbsp;[% 'February' | $T8 %]
45     </td>
46     <td><input name=duetyp class=radio type=radio value="6" onchange='set_from_to(this.value, year.value)'>
47       &nbsp;[% 'June' | $T8 %]
48     </td>
49     <td><input name=duetyp class=radio type=radio value="10" onchange='set_from_to(this.value, year.value)'>
50       &nbsp;[% 'October' | $T8 %]
51     </td>
52   </tr>
53   <tr>
54     <td> &nbsp;</td>
55     <td><input name=duetyp class=radio type=radio value="C" onchange='set_from_to(this.value, year.value)'>
56       &nbsp;3. [% 'Quarter' | $T8 %]
57     </td>
58     <td><input name=duetyp class=radio type=radio value="3" onchange='set_from_to(this.value, year.value)'>
59       &nbsp;[% 'March' | $T8 %]
60     </td>
61     <td><input name=duetyp class=radio type=radio value="7" onchange='set_from_to(this.value, year.value)'>
62       &nbsp;[% 'July' | $T8 %]
63     </td>
64     <td><input name=duetyp class=radio type=radio value="11" onchange='set_from_to(this.value, year.value)'>
65       &nbsp;[% 'November' | $T8 %]
66     </td>
67   </tr>
68   <tr>
69     <td> &nbsp;</td>
70     <td><input name=duetyp class=radio type=radio value="D" onchange='set_from_to(this.value, year.value)'>
71       &nbsp;4. [% 'Quarter' | $T8 %]
72     </td>
73     <td><input name=duetyp class=radio type=radio value="4" onchange='set_from_to(this.value, year.value)'>
74       &nbsp;[% 'April' | $T8 %]
75     </td>
76     <td><input name=duetyp class=radio type=radio value="8" onchange='set_from_to(this.value, year.value)'>
77       &nbsp;[% 'August' | $T8 %]
78     </td>
79     <td><input name=duetyp class=radio type=radio value="12" onchange='set_from_to(this.value, year.value)'>
80       &nbsp;[% 'December' | $T8 %]
81     </td>
82   </tr>
83   <tr>
84     <td colspan=5><hr size=3 noshade></td>
85   </tr>
86   <tr>
87     <th align=left><input name=reporttype class=radio type=radio value="free">[% 'Free report period' | $T8 %]</th>
88     <td align=left colspan=4>
89       [% 'From' | $T8 %] [% L.date_tag('fromdate', fromdate) %]
90       [% 'Bis' | $T8 %] [% L.date_tag('todate', todate)  %]
91     </td>
92   </tr>
93   <tr>
94     <td colspan=5><hr size=3 noshade></td>
95   </tr>
96 [%- END %]
97 [%- BLOCK cash_or_accrual %]
98   <tr>
99     <th align=left>[% 'Method' | $T8 %]</th>
100     <td colspan=3>
101       [% L.radio_button_tag('method', value='accrual', checked=(INSTANCE_CONF.get_accounting_method=='accrual'), label=LxERP.t8('Accrual')) %]
102       [% L.radio_button_tag('method', value='cash', checked=(INSTANCE_CONF.get_accounting_method=='cash'), label=LxERP.t8('cash')) %]
103     </td>
104   </tr>
105 [%- END %]
106 [%- BLOCK customer %]
107   <tr>
108     <th align=right nowrap>[% 'Customer' | $T8 %]</th>
109     <td colspan=3>[% L.customer_vendor_picker('customer_id', '', type='customer') %]</td>
110   </tr>
111 [%- END %]
112 [%- BLOCK projectnumber %]
113   <tr>
114     <th align=right nowrap>[% 'Project' | $T8 %]</th>
115     <td colspan=3>[% L.project_picker('project_id', '') %]</td>
116   </tr>
117 [%- END %]
118
119 <h1>[% title %]</h1>
120
121 <form method='post' action='[% script %]' id='form'>
122
123 <input type=hidden name=title value="[% title %]">
124
125 <table border="0">
126 [%- IF selectdepartment %]
127   <tr>
128     <th align="left" nowrap>[% 'Department' | $T8 %]</th>
129     <td colspan=3><select name=department>[% selectdepartment %]</select></td>
130   </tr>
131 [%- END %]
132
133 [%- IF is_projects %]
134   [% INCLUDE projectnumber %]
135   <input type=hidden name=nextsub value=generate_projects>
136   <tr>
137     <th align=right>[% 'From' | $T8 %]</th>
138     <td> [% L.date_tag('fromdate', fromdate, class='initial_focus') %]</td>
139     <th align=right nowrap>[% 'Bis' | $T8 %]</th>
140     <td>[% L.date_tag('todate') %]</td>
141   </tr>
142 </table>
143 <table>
144   <tr>
145     <th align=right nowrap>[% 'Include in Report' | $T8 %]</th>
146     <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;[% 'Heading' | $T8 %]
147     <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;[% 'Subtotal' | $T8 %]</td>
148   </tr>
149 [%- END %]
150
151 [%- IF is_income_statement %]
152 [%- PROCESS projectnumber %]
153   <input type=hidden name=nextsub value=generate_income_statement>
154 </table>
155 <table>
156 [%- PROCESS customized_report %]
157 [%- PROCESS cash_or_accrual %]
158   <tr>
159     <th align=left nowrap>[% 'Include in Report' | $T8 %]</th>
160     <td><input name=l_cb class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]</td>
161   </tr>
162 [%- END %]
163
164
165 [%- IF is_bwa %]
166 [%- PROCESS projectnumber %]
167   <input type=hidden name=nextsub value=generate_bwa>
168 </table>
169 <table>
170 [%- PROCESS customized_report %]
171 [%- PROCESS cash_or_accrual %]
172   <tr>
173   <th align=right colspan=4>[% 'Decimalplaces' | $T8 %]</th>
174     <td><input name=decimalplaces size=3 value="2"></td>
175   </tr>
176 [%- END %]
177
178
179 [%- IF is_erfolgsrechnung %]
180   <input type=hidden name=nextsub value=generate_erfolgsrechnung>
181 </table>
182 <table>
183 [%- PROCESS customized_report %]
184 [%- END %]
185
186
187 [%- IF is_balance_sheet %]
188   <input type=hidden name=nextsub value=generate_balance_sheet>
189   <tr>
190     <th align=right>[% 'as at' | $T8 %]</th>
191     <td> [% L.date_tag('asofdate', asofdate, class="initial_focus") %]</td>
192     <td><input name=l_cb class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]</td>
193     <td><input name=l_ob class=checkbox type=checkbox value=Y>&nbsp;[% 'only OB Transactions' | $T8 %]</td>
194   </tr>
195   </tr>
196     <th align=right nowrap>[% 'Compare to' | $T8 %]</th>
197     <td>[% L.date_tag('compareasofdate', compareasofdate) %]</td>
198     <td><input name=l_cb_compared class=checkbox type=checkbox value=Y>&nbsp;[% 'CB Transactions' | $T8 %]</td>
199     <td><input name=l_ob_compared class=checkbox type=checkbox value=Y>&nbsp;[% 'only OB Transactions' | $T8 %]</td>
200   </tr>
201   <tr>
202     <th align=right>[% 'Decimalplaces' | $T8 %]</th>
203     <td><input name=decimalplaces size=3 value="2"></td>
204   </tr>
205 </table>
206 <table>
207 [%- PROCESS cash_or_accrual %]
208   <tr>
209     <th align=right nowrap>[% 'Include in Report' | $T8 %]</th>
210     <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;[% 'Heading' | $T8 %]
211     <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;[% 'Subtotal' | $T8 %]
212     <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;[% 'Account Number' | $T8 %]</td>
213   </tr>
214 [%- END %]
215
216 [%- IF is_trial_balance %]
217 [%- PROCESS customer %]
218 [%- PROCESS projectnumber %]
219   <input type=hidden name=nextsub value=generate_trial_balance>
220 </table>
221 <table>
222 [%- PROCESS customized_report %]
223 [%- PROCESS cash_or_accrual %]
224  <tr>
225    <th align=right colspan=4>[% 'All Accounts' | $T8 %]</th>
226    <td><input name=all_accounts type=checkbox value=1></td>
227  </tr>
228  <tr>
229    <th align=right colspan=4>[% 'Decimalplaces' | $T8 %]</th>
230    <td><input name=decimalplaces size=3 value="2"></td>
231  </tr>
232 [%- END %]
233
234 [%- IF is_aging %]
235   <tr>
236     <th align=left>[% label %]</th>
237     <td>[% vc %]</td>
238   </tr>
239 </table>
240 <table border="0">
241   <tr>
242     <td colspan=5><hr size=1 noshade></td>
243   </tr>
244   <tr>
245     <th align=left><input name=reporttype class=radio type=radio value="custom" checked><b>[% 'Reference day' | $T8 %]</b> ([% 'Due Date' | $T8 %][% ', if set' | $T8 %])</b>&nbsp; </th>
246      <td align="right" colspan="4">[% 'Review of Aging list' | $T8 %] <select name="review_of_aging_list">
247         <option></option>
248         <option>0-30</option>
249         <option>30-60</option>
250         <option>60-90</option>
251         <option>90-120</option>
252         <option>&gt; 120</option>
253         </select> [% 'for date' | $T8 %] [% L.date_tag('fordate', today) %]
254     </td>
255   </tr>
256   <tr>
257     <td colspan=5><hr size=3 noshade></td>
258  </tr>
259  <tr>
260     <th align=left><input name=reporttype class=radio type=radio value="free"><b>[% 'Free report period' | $T8 %]</b> ([% 'Invoice Date' | $T8 %])&nbsp; </th>
261     <td align="right" colspan=4>
262       [% 'From' | $T8 %] [% L.date_tag('fromdate', fromdate) %]
263       [% 'Bis' | $T8 %] [% L.date_tag('todate') %]
264     </td>
265   </tr>
266   <input type=hidden name=type value=statement>
267   [% L.hidden_tag("format", format) %]
268   <input type=hidden name=media value=screen>
269
270   <input type=hidden name=nextsub value='[% nextsub %]'>
271   <input type=hidden name=action value='[% nextsub %]'>
272 [%- END %]
273
274 [%- IF is_payments %]
275   <input type=hidden name=nextsub value=list_payments>
276   <tr>
277     <th align=right nowrap>[% 'Account' | $T8 %]</th>
278     <td colspan=3><select name=account>[% selection %]</select>
279       <input type=hidden name=paymentaccounts value="[% paymentaccounts %]">
280     </td>
281   </tr>
282   <tr>
283     <th align=right>[% 'Reference' | $T8 %]</th>
284     <td colspan=3><input name=reference class="initial_focus"></td>
285   </tr>
286   <tr>
287     <th align=right nowrap>[% 'Source' | $T8 %]</th>
288     <td colspan=3><input name=source></td>
289   </tr>
290   <tr>
291     <th align=right nowrap>[% 'Memo' | $T8 %]</th>
292     <td colspan=3><input name=memo size=30></td>
293   </tr>
294   <tr>
295     <th align=right>[% 'From' | $T8 %]</th>
296     <td>[% L.date_tag('fromdate', fromdate) %]</td>
297     <th align=right>[% 'Bis' | $T8 %]</th>
298     <td>[% L.date_tag('todate') %]</td>
299   </tr>
300   <tr>
301     <td align=right><input type=checkbox style=checkbox name=fx_transaction value=1 checked></td>
302     <th align=left colspan=3>[% 'Include Exchangerate Difference' | $T8 %]</td>
303   </tr>
304
305   <input type=hidden name=db value='[% db %]'>
306   <input type=hidden name=sort value=transdate>
307 [%- END %]
308
309 [%- IF 0 # is_taxreport %]
310   <input type=hidden name=nextsub value=generate_tax_report>
311   <tr>
312     <th align=right>[% 'From' | $T8 %]</th>
313     <td>[% L.date_tag('fromdate', fromdate) %]</td>
314     <th align=right>[% 'Bis' | $T8 %]</th>
315     <td>[% L.date_tag('todate', todate) %]</td>
316   </tr>
317   <tr>
318     <th align=right>[% 'Report for' | $T8 %]</th>
319     <td colspan=3>
320 [% FOREACH row IN taxaccounts %]
321       <input name=accno class=radio type=radio value='[% row.accno %]' [% loop.first ? 'checked' : '' %]>&nbsp;[% row.description %]
322       <input name="[% row.accno %]_description" type=hidden value="[% row.description %]">
323       <input name="[% row.accno %]_rate" type=hidden value="[% row.rate %]">
324 [%- END %]
325       <input type=hidden name=db value='[% db %]'>
326       <input type=hidden name=sort value=transdate>
327     </td>
328   </tr>
329 [%- PROCESS cash_or_accrual %]
330 </table>
331 <table>
332   <tr>
333     <th align=right>[% 'Include in Report' | $T8 %]</th>
334     <td>
335       <table>
336         <tr>
337           <td><input name="l_id" class=checkbox type=checkbox value=Y></td>
338           <td>[% 'ID' | $T8 %]</td>
339           <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
340           <td>[% 'Invoice' | $T8 %]</td>
341           <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
342           <td>[% 'Date' | $T8 %]</td>
343         </tr>
344         <tr>
345           <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
346           <td>
347             [% LxERP.t8('Customer') IF db == 'ar' %]
348             [% LxERP.t8('Vendor')   IF db == 'ap' %]
349          </td>
350           <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td>
351           <td>[% 'Amount' | $T8 %]</td>
352           <td><input name="l_tax" class=checkbox type=checkbox value=Y checked></td>
353           <td>[% 'Tax' | $T8 %]</td>
354           <td><input name="l_amount" class=checkbox type=checkbox value=Y></td>
355           <td>[% 'Total' | $T8 %]</td>
356         </tr>
357         <tr>
358           <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
359           <td>[% 'Subtotal' | $T8 %]</td>
360         </tr>
361       </table>
362     </td>
363   </tr>
364 [%- END %]
365 </table>
366 </form>
367
368 <script type="text/javascript">
369 function set_from_to(duetyp, year) {
370   var date = {
371     1:  [ 1,  1, 1,  31 ],
372     2:  [ 2,  1, 2,  new Date(year, 1, 29).getMonth() == 1 ? 29 : 28 ],
373     3:  [ 3,  1, 3,  31 ],
374     4:  [ 4,  1, 4,  30 ],
375     5:  [ 5,  1, 5,  31 ],
376     6:  [ 6,  1, 6,  30 ],
377     7:  [ 7,  1, 7,  31 ],
378     8:  [ 8,  1, 8,  31 ],
379     9:  [ 9,  1, 9,  30 ],
380     10: [ 10, 1, 10, 31 ],
381     11: [ 11, 1, 11, 30 ],
382     12: [ 12, 1, 12, 31 ],
383     13: [  1, 1, 12, 31 ],
384     'A': [ 1,  1, 3,  31 ],
385     'B': [ 4,  1, 6,  30 ],
386     'C': [ 7,  1, 9,  30 ],
387     'D': [ 10, 1, 12, 31 ]
388   }[duetyp];
389
390   $('#fromdate').val(kivi.format_date(new Date(year, date[0]-1, date[1])));
391   $('#todate').val(kivi.format_date(new Date(year, date[2]-1, date[3])));
392
393   return true;
394 }
395 </script>