Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 82684e3d

Von Sven Schöling vor etwa 13 Jahren hinzugefügt

  • ID 82684e3dd8e779081a7d8af2c24a477f107fc4a5
  • Vorgänger c97d8162
  • Nachfolger b93a2d44

chart of account suche in template ausgelagert

Unterschiede anzeigen:

bin/mozilla/ca.pl
149 149
}
150 150

  
151 151
sub list {
152
  $main::lxdebug->enter_sub();
152
  $::lxdebug->enter_sub;
153
  $::auth->assert('report');
153 154

  
154
  my $form     = $main::form;
155
  my %myconfig = %main::myconfig;
156
  my $locale   = $main::locale;
155
  $::form->{title} = $::locale->text('List Transactions') . " - " . $::locale->text('Account') . " $::form->{accno}";
157 156

  
158
  $main::auth->assert('report');
159

  
160
  $form->{title} = $locale->text('List Transactions');
161
  $form->{title} .= " - " . $locale->text('Account') . " $form->{accno}";
162
  my $year = (localtime)[5] + 1900;
163

  
164
  # get departments
165
  $form->all_departments(\%myconfig);
166
  if (@{ $form->{all_departments} || [] }) {
167
    $form->{selectdepartment} = "<option>\n";
168

  
169
    map {
170
      $form->{selectdepartment} .=
171
        "<option>$_->{description}--$_->{id}\n"
172
    } (@{ $form->{all_departments} || [] });
173
  }
174

  
175
  my $department = qq|
176
        <tr>
177
          <th align=right nowrap>| . $locale->text('Department') . qq|</th>
178
          <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
179
        </tr>
180
| if $form->{selectdepartment};
181
  my $accrual =  $::instance_conf->get_accounting_method eq 'cash' ? ""        : "checked";
182
  my $cash    =  $::instance_conf->get_accounting_method eq 'cash' ? "checked" : "";
183

  
184
  my $name_1    = "fromdate";
185
  my $id_1      = "fromdate";
186
  my $value_1   = "$form->{fromdate}";
187
  my $trigger_1 = "trigger1";
188
  my $name_2    = "todate";
189
  my $id_2      = "todate";
190
  my $value_2   = "";
191
  my $trigger_2 = "trigger2";
192

  
193
  my ($button1, $button1_2, $button2, $button2_2, $jsscript);
194

  
195
  # with JavaScript Calendar
196
  if ($form->{jsscript}) {
197
    if ($name_1 eq "") {
198

  
199
      $button1 = qq|
200
         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
201
      $button1_2 = qq|
202
        <input type=button name=$name_2 id="$trigger_2" value=|
203
        . $locale->text('button') . qq|>|;
204

  
205
      #write Trigger
206
      $jsscript =
207
        Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2");
208
    } else {
209
      $button1 = qq|
210
         <input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\" value="$value_1">|;
211
      $button1_2 = qq|
212
        <input type=button name=$name_1 id="$trigger_1" value=|
213
        . $locale->text('button') . qq|>|;
214
      $button2 = qq|
215
         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
216
      $button2_2 = qq|
217
         <input type=button name=$name_2 id="$trigger_2" value=|
218
        . $locale->text('button') . qq|>
219
       |;
220

  
221
      #write Trigger
222
      $jsscript =
223
        Form->write_trigger(\%myconfig, "2", "$name_1", "BR", "$trigger_1",
224
                            "$name_2", "BL", "$trigger_2");
225
    }
226
  } else {
227

  
228
    # without JavaScript Calendar
229
    if ($name_1 eq "") {
230
      $button1 =
231
        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
232
    } else {
233
      $button1 =
234
        qq|<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value="$value_1" onBlur=\"check_right_date_format(this)\">|;
235
      $button2 =
236
        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
237
    }
238
  }
239
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
240
  $form->header;
241 157
  my $onload = qq|focus()|;
242
  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
243
  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
244

  
245

  
246
  $form->header;
247

  
248
  $form->{description} =~ s/\"/&quot;/g;
249

  
250
  my $eur =  $::instance_conf->get_accounting_method eq 'cash' ? 1 : 0;
251

  
252
  print qq|
253
<body onLoad="$onload">
254

  
255
<form method=post action=$form->{script}>
256

  
257
<input type=hidden name=accno value=$form->{accno}>
258
<input type=hidden name=description value="$form->{description}">
259
<input type=hidden name=sort value=transdate>
260
<input type=hidden name=eur value=$eur>
261
<input type=hidden name=accounttype value=$form->{accounttype}>
262

  
263
<table border=0 width=100%>
264
  <tr>
265
    <th class=listtop>$form->{title}</th>
266
  </tr>
267

  
268
</table>
269
<table>
270
        <tr>
271
          <th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
272
      . $locale->text('Customized Report') . qq|</th>
273
        </tr>
274
        <tr>
275
          <th colspan=1>| . $locale->text('Year') . qq|</th>
276
          <td><input name=year size=11 title="|
277
      . $locale->text('YYYY') . qq|" value="$year"></td>
278
        </tr>
279
|;
280

  
281
    print qq|
282
        <tr>
283
                <td align=right>
284
<b> | . $locale->text('Yearly') . qq|</b> </td>
285
                <th align=left>| . $locale->text('Quarterly') . qq|</th>
286
                <th align=left colspan=3>| . $locale->text('Monthly') . qq|</th>
287
        </tr>
288
        <tr>
289
                <td align=right>&nbsp; <input name=duetyp class=radio type=radio value="13"></td>
290
                <td><input name=duetyp class=radio type=radio value="A">&nbsp;1. | . $locale->text('Quarter') . qq|</td>
291
                <td><input name=duetyp class=radio type=radio value="1" "checked">&nbsp;| . $locale->text('January') . qq|</td>
292
                <td><input name=duetyp class=radio type=radio value="5" >&nbsp;| . $locale->text('May') . qq|</td>
293
                <td><input name=duetyp class=radio type=radio value="9" >&nbsp;| . $locale->text('September') . qq|</td>
294

  
295
        </tr>
296
        <tr>
297
                <td align= right>&nbsp;</td>
298
                <td><input name=duetyp class=radio type=radio value="B">&nbsp;2. | . $locale->text('Quarter') . qq|</td>
299
                <td><input name=duetyp class=radio type=radio value="2" >&nbsp;| . $locale->text('February') . qq|</td>
300
                <td><input name=duetyp class=radio type=radio value="6" >&nbsp;| . $locale->text('June') . qq|</td>
301
                <td><input name=duetyp class=radio type=radio value="10" >&nbsp;| . $locale->text('October') . qq|</td>
302
        </tr>
303
        <tr>
304
                <td> &nbsp;</td>
305
                <td><input name=duetyp class=radio type=radio value="C">&nbsp;3. | . $locale->text('Quarter') . qq|</td>
306
                <td><input name=duetyp class=radio type=radio value="3" >&nbsp;| . $locale->text('March') . qq|</td>
307
                <td><input name=duetyp class=radio type=radio value="7" >&nbsp;| . $locale->text('July') . qq|</td>
308
                <td><input name=duetyp class=radio type=radio value="11" >&nbsp;| . $locale->text('November') . qq|</td>
309

  
310
        </tr>
311
        <tr>
312
                <td> &nbsp;</td>
313
                <td><input name=duetyp class=radio type=radio value="D">&nbsp;4. | . $locale->text('Quarter') . qq|&nbsp;</td>
314
                <td><input name=duetyp class=radio type=radio value="4" >&nbsp;| . $locale->text('April') . qq|</td>
315
                <td><input name=duetyp class=radio type=radio value="8" >&nbsp;| . $locale->text('August') . qq|</td>
316
                <td><input name=duetyp class=radio type=radio value="12" >&nbsp;| . $locale->text('December') . qq|</td>
317

  
318
        </tr>
319
        <tr>
320
                   <td colspan=5><hr size=3 noshade></td>
321
        </tr>
322
        <tr>
323
          <th align=left><input name=reporttype class=radio type=radio value="free"> | . $locale->text('Free report period') . qq|</th>
324
          <td align=left colspan=4>| . $locale->text('From') . qq|&nbsp;
325
              $button1
326
              $button1_2&nbsp;
327
              | . $locale->text('Bis') . qq|&nbsp;
328
              $button2
329
              $button2_2
330
          </td>
331
        </tr>
332
        <tr>
333
                   <td colspan=5><hr size=3 noshade></td>
334
        </tr>
335
        <tr>
336
          <th align=leftt>| . $locale->text('Method') . qq|</th>
337
          <td colspan=3><input name=method class=radio type=radio value=accrual $accrual>| . $locale->text('Accrual') . qq|
338
          &nbsp;<input name=method class=radio type=radio value=cash $cash>| . $locale->text('EUR') . qq|</td>
339
        </tr>
340
        <tr>
341
         <th align=right colspan=4>| . $locale->text('Decimalplaces') . qq|</th>
342
             <td><input name=decimalplaces size=3 value="2"></td>
343
         </tr>
344
         <tr>
345
            <td><input name="subtotal" class=checkbox type=checkbox value=1> | . $locale->text('Subtotal') . qq|</td>
346
         </tr>
347

  
348
$jsscript
349
  <tr><td colspan=5 ><hr size=3 noshade></td></tr>
350
</table>
351

  
352
<br><input class=submit type=submit name=action value="|
353
    . $locale->text('List Transactions') . qq|">
354
</form>
355

  
356
</body>
357
</html>
358
|;
158
  $onload .= qq|;setupDateFormat('$::myconfig{dateformat}', '|. $::locale->text("Falsches Datumsformat!") .qq|')|;
159
  $onload .= qq|;setupPoints('$::myconfig{numberformat}', '|. $::locale->text("wrongformat") .qq|')|;
359 160

  
360
  $main::lxdebug->leave_sub();
161
  $::form->header;
162
  print $::form->parse_html_template('ca/list', {
163
    onload => $onload,
164
    year => DateTime->today->year,
165
    cash => $::instance_conf->get_accounting_method eq 'cash',
166
  });
167

  
168
  $::lxdebug->leave_sub;
361 169
}
362 170

  
363 171
sub format_debit_credit {
templates/webpages/ca/list.html
1
[% USE L %]
2
[% USE T8 %]
3
[% USE HTML %]
4
[% USE LxERP %]
5

  
6
<body onLoad="[% onload %]">
7

  
8
<form method=post action="[% script %]">
9

  
10
[% L.hidden_tag('accno', accno) %]
11
[% L.hidden_tag('decription', description) %]
12
[% L.hidden_tag('sort', 'transdate') %]
13
[% L.hidden_tag('eur', cash) %]
14
[% L.hidden_tag('accounttype', accounttype) %]
15

  
16
<table border=0 width=100%>
17
  <tr>
18
    <th class=listtop>[% title | html %]</th>
19
  </tr>
20
</table>
21
<table>
22
        <tr>
23
          <th align=left>[% L.radio_button_tag('reporttype', value='custom', label=LxERP.t8('Customized Report')) %]</th>
24
        </tr>
25
        <tr>
26
          <th colspan=1>[% 'Year' | $T8 %]</th>
27
          <td><input name=year size=11 title="[% 'YYYY' | $T8 %]" value="[% year %]"></td>
28
        </tr>
29

  
30
        <tr>
31
                <td align=right><b>[% 'Yearly' | $T8 %]</b></td>
32
                <th align=left>[% 'Quarterly' | $T8 %]</th>
33
                <th align=left colspan=3>[% 'Monthly' | $T8 %]</th>
34
        </tr>
35
        <tr>
36
                <td align=right>[% L.radio_button_tag('duetyp', value=13) %]</td>
37
                <td>[% L.radio_button_tag('duetyp', value='A', label='1. ' _ LxERP.t8('Quarter')) %]</td>
38
                <td>[% L.radio_button_tag('duetyp', value='1', label=LxERP.t8('January')) %]</td>
39
                <td>[% L.radio_button_tag('duetyp', value='5', label=LxERP.t8('May')) %]</td>
40
                <td>[% L.radio_button_tag('duetyp', value='9', label=LxERP.t8('September')) %]</td>
41
        </tr>
42
        <tr>
43
                <td></td>
44
                <td>[% L.radio_button_tag('duetyp', value='B', label='2. ' _ LxERP.t8('Quarter')) %]</td>
45
                <td>[% L.radio_button_tag('duetyp', value='2', label=LxERP.t8('February')) %]</td>
46
                <td>[% L.radio_button_tag('duetyp', value='6', label=LxERP.t8('June')) %]</td>
47
                <td>[% L.radio_button_tag('duetyp', value='10', label=LxERP.t8('October')) %]</td>
48
        </tr>
49
        <tr>
50
                <td></td>
51
                <td>[% L.radio_button_tag('duetyp', value='C', label='3. ' _ LxERP.t8('Quarter')) %]</td>
52
                <td>[% L.radio_button_tag('duetyp', value='3', label=LxERP.t8('March')) %]</td>
53
                <td>[% L.radio_button_tag('duetyp', value='7', label=LxERP.t8('July')) %]</td>
54
                <td>[% L.radio_button_tag('duetyp', value='11', label=LxERP.t8('November')) %]</td>
55
        </tr>
56
        <tr>
57
                <td></td>
58
                <td>[% L.radio_button_tag('duetyp', value='D', label='4. ' _ LxERP.t8('Quarter')) %]</td>
59
                <td>[% L.radio_button_tag('duetyp', value='4', label=LxERP.t8('April')) %]</td>
60
                <td>[% L.radio_button_tag('duetyp', value='8', label=LxERP.t8('August')) %]</td>
61
                <td>[% L.radio_button_tag('duetyp', value='12', label=LxERP.t8('December')) %]</td>
62

  
63
        </tr>
64
        <tr>
65
                   <td colspan=5><hr size=3 noshade></td>
66
        </tr>
67
        <tr>
68
          <th align=left>[% L.radio_button_tag('reporttype', value='free', label=LxERP.t8('Free report period')) %]</th>
69
          <td align=left colspan=4>[% 'From' | $T8 %] [% L.date_tag('fromdate') %]
70
              [% 'Bis' | $T8 %] [% L.date_tag('todate') %]
71
          </td>
72
        </tr>
73
        <tr>
74
                   <td colspan=5><hr size=3 noshade></td>
75
        </tr>
76
        <tr>
77
          <th align=leftt>[% 'Method' | $T8 %]</th>
78
          <td colspan=3>[% L.radio_button_tag('method', value='accrual', checked=!cash, label=LxERP.t8('Accrual')) %]
79
                        [% L.radio_button_tag('method', value='cash', checked=cash, label=LxERP.t8('EUR')) %]</td>
80
        </tr>
81
        <tr>
82
         <th align=right colspan=4>[% 'Decimalplaces' | $T8 %]</th>
83
         <td><input name=decimalplaces size=3 value="2"></td>
84
        </tr>
85
        <tr>
86
           <td>[% L.checkbox_tag('subtotal', label=LxERP.t8('Subtotal')) %]</td>
87
        </tr>
88

  
89
  <tr><td colspan=5 ><hr size=3 noshade></td></tr>
90
</table>
91

  
92
<br>[% L.submit_tag('action', LxERP.t8('List Transactions')) %]
93
</form>
94

  
95
</body>
96
</html>

Auch abrufbar als: Unified diff