Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision eca3a478

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

  • ID eca3a47857617e4283e53c30bba3588f5cf0d31c
  • Vorgänger a7b55dd7
  • Nachfolger 1a254be1

gl.pl:search -> templates

Unterschiede anzeigen:

bin/mozilla/gl.pl
211 211

  
212 212

  
213 213
sub search {
214
  $main::lxdebug->enter_sub();
215

  
216
  $main::auth->assert('general_ledger');
217

  
218
  my $form     = $main::form;
219
  my %myconfig = %main::myconfig;
220
  my $locale   = $main::locale;
221
  my $cgi      = $::request->{cgi};
222

  
223
  $form->{title} = $locale->text('Journal');
224

  
225
  $form->all_departments(\%myconfig);
226

  
227
  # departments
228
  if (@{ $form->{all_departments} || [] }) {
229
    $form->{selectdepartment} = "<option>\n";
230

  
231
    map {
232
      $form->{selectdepartment} .=
233
        "<option>$_->{description}--$_->{id}\n"
234
    } (@{ $form->{all_departments} || [] });
235
  }
236

  
237
  my $department;
238
  $department = qq|
239
        <tr>
240
          <th align=right nowrap>| . $locale->text('Department') . qq|</th>
241
          <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
242
        </tr>
243
| if $form->{selectdepartment};
244

  
245
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
246
                                   "all" => 1},
247
                                   "employees"    => "ALL_EMPLOYEES" );
248

  
249
  my %project_labels = ();
250
  my @project_values = ("");
251
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
252
    push(@project_values, $item->{"id"});
253
    $project_labels{$item->{"id"}} = $item->{"projectnumber"};
254
  }
255

  
256
  my $projectnumber =
257
    NTI($cgi->popup_menu('-name' => "project_id",
258
                         '-values' => \@project_values,
259
                         '-labels' => \%project_labels));
260

  
261
  my %employee_labels = ();
262
  my @employee_values = ("");
263
  foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
264
    # value in Form "1234--Name" ?bergeben
265
    my $id = "$item->{'id'}--$item->{'name'}";
266
    push(@employee_values, "$id");
267
    $employee_labels{$id} = $item->{"name"};
268
  }
269

  
270
  my $employeenumber =
271
    NTI($cgi->popup_menu('-name' => "employee",
272
                         '-values' => \@employee_values,
273
                         '-labels' => \%employee_labels));
214
  $::lxdebug->enter_sub;
215
  $::auth->assert('general_ledger');
274 216

  
275
  # use JavaScript Calendar or not
276
  $form->{jsscript} = 1;
277
  my $jsscript = "";
278
  my ($button1, $button2, $onload);
279
  if ($form->{jsscript}) {
280

  
281
    # with JavaScript Calendar
282
    $button1 = qq|
283
       <td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
284
       <input type=button name=datefrom id="trigger1" value=|
285
      . $locale->text('button') . qq|></td>
286
       |;
287
    $button2 = qq|
288
       <td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
289
       <input type=button name=dateto id="trigger2" value=|
290
      . $locale->text('button') . qq|></td>
291
     |;
292

  
293
    #write Trigger
294
    $jsscript =
295
      Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1",
296
                          "dateto", "BL", "trigger2");
297
  } else {
298

  
299
    # without JavaScript Calendar
300
    $button1 =
301
      qq|<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
302
    $button2 =
303
      qq|<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
304
  }
305
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
306
  $form->header;
307
  $onload = qq|focus()|;
308
  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
309
  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
310
  print qq|
311
<body onLoad="$onload">
312

  
313
<form method=post action=gl.pl>
314

  
315
<input type=hidden name=sort value=datesort>
316

  
317
<table width=100%>
318
  <tr>
319
    <th class=listtop>$form->{title}</th>
320
  </tr>
321
  <tr height="5"></tr>
322
  <tr>
323
    <td>
324
      <table>
325
        <tr>
326
          <th align=right>| . $locale->text('Reference') . qq|</th>
327
          <td><input name=reference size=20></td>
328
          <th align=right>| . $locale->text('Source') . qq|</th>
329
          <td><input name=source size=20></td>
330
        </tr>
331
        $department
332
        <tr>
333
          <th align=right>| . $locale->text('Description') . qq|</th>
334
          <td><input name=description size=40></td>
335
          <th align=right>| . $locale->text('Account Number') . qq|</th>
336
          <td><input name=accno size=20></td>
337
        </tr>
338
        <tr>
339
          <th align=right>| . $locale->text('Notes') . qq|</th>
340
          <td colspan=3><input name=notes size=40></td>
341
        </tr>
342
        <tr>
343
          <th align=right>| . $locale->text('Project Number') . qq|</th>
344
          <td colspan=3>$projectnumber</td>
345
        </tr>
346
 <tr>
347
    <th align=right>| . $locale->text('Employee') . qq|</th>
348
    <td colspan=3>$employeenumber</td>
349
  </tr>
350
  <tr>
351
    <th align=right>| . $locale->text('Filter date by') . qq|</th>
352
    <td colspan=3>
353
    <input name=datesort class=radio type=radio value=gldate checked>&nbsp;| . $locale->text('Booking Date') . qq|
354
    <input name=datesort class=radio type=radio value=transdate>&nbsp;| . $locale->text('Invoice Date') . qq|
355
    </td>
356
  </tr>
357
  <tr>
358
    <th align=right>| . $locale->text('From') . qq|</th>
359
          $button1
360
          <th align=right>| . $locale->text('To (time)') . qq|</th>
361
          $button2
362
        </tr>
363
        <tr>
364
          <th align=right>| . $locale->text('Include in Report') . qq|</th>
365
          <td colspan=3>
366
            <table>
367
              <tr>
368
                <td>
369
                  <input name="category" class=radio type=radio value=X checked>&nbsp;|
370
    . $locale->text('All') . qq|
371
                  <input name="category" class=radio type=radio value=A>&nbsp;|
372
    . $locale->text('Asset') . qq|
373
                  <input name="category" class=radio type=radio value=L>&nbsp;|
374
    . $locale->text('Liability') . qq|
375
                  <input name="category" class=radio type=radio value=I>&nbsp;|
376
    . $locale->text('Revenue') . qq|
377
                  <input name="category" class=radio type=radio value=E>&nbsp;|
378
    . $locale->text('Expense') . qq|
379
                </td>
380
              </tr>
381
              <tr>
382
                <table>
383
                  <tr>
384
                    <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
385
                    <td>| . $locale->text('ID') . qq|</td>
386
                    <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
387
                    <td>| . $locale->text('Invoice Date') . qq|</td>
388
                    <td align=right><input name="l_gldate" class=checkbox type=checkbox value=Y checked></td>
389
                    <td>| . $locale->text('Booking Date') . qq|</td>
390
                    <td align=right><input name="l_reference" class=checkbox type=checkbox value=Y checked></td>
391
                    <td>| . $locale->text('Reference') . qq|</td>
392
                    <td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
393
                    <td>| . $locale->text('Description') . qq|</td>
394
                    <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
395
                    <td>| . $locale->text('Notes') . qq|</td>
396
                  </tr>
397
                  <tr>
398
                    <td align=right><input name="l_debit" class=checkbox type=checkbox value=Y checked></td>
399
                    <td>| . $locale->text('Debit') . qq|</td>
400
                    <td align=right><input name="l_credit" class=checkbox type=checkbox value=Y checked></td>
401
                    <td>| . $locale->text('Credit') . qq|</td>
402
                    <td align=right><input name="l_source" class=checkbox type=checkbox value=Y checked></td>
403
                    <td>| . $locale->text('Source') . qq|</td>
404
                    <td align=right><input name="l_accno" class=checkbox type=checkbox value=Y checked></td>
405
                    <td>| . $locale->text('Account') . qq|</td>
406
                  </tr>
407
                  <tr>
408
                    <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
409
                    <td>| . $locale->text('Subtotal') . qq|</td>
410
                    <td align=right><input name="l_projectnumbers" class=checkbox type=checkbox value=Y></td>
411
                    <td>| . $locale->text('Project Number') . qq|</td>
412
                    <td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
413
                    <td>| . $locale->text('Employee') . qq|</td>
414
                  </tr>
415
                </table>
416
              </tr>
417
            </table>
418
        </tr>
419
      </table>
420
    </td>
421
  </tr>
422
  <tr>
423
    <td><hr size=3 noshade></td>
424
  </tr>
425
</table>
217
  $::form->all_departments(\%::myconfig);
218
  $::form->get_lists(
219
    projects  => { key => "ALL_PROJECTS", all => 1 },
220
    employees => "ALL_EMPLOYEES",
221
  );
426 222

  
427
$jsscript
223
  my $onload = "focus()"
224
             . qq|;setupDateFormat('|. $::myconfig{dateformat} . qq|', '| . $::locale->text("Falsches Datumsformat!") . qq|')|
225
             . qq|;setupPoints('|. $::myconfig{numberformat} .   qq|', '| . $::locale->text("wrongformat") . qq|')|;
428 226

  
429
<input type=hidden name=nextsub value=generate_report>
227
  $::form->header;
228
  print $::form->parse_html_template('gl/search', {
229
    onload => $onload,
230
    department_label => sub { ("$_[0]{description}--$_[0]{id}")x2 },
231
    employee_label => sub { "$_[0]{id}--$_[0]{name}" },
232
  });
430 233

  
431
<br>
432
<input class=submit type=submit name=action value="|
433
    . $locale->text('Continue') . qq|">
434
</form>
435

  
436
</body>
437
</html>
438
|;
439
  $main::lxdebug->leave_sub();
234
  $::lxdebug->leave_sub;
440 235
}
441 236

  
442 237
sub create_subtotal_row {
templates/webpages/gl/search.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
[%- USE LxERP %]
4
[%- USE L %]
5
<body onLoad="[% onload %]">
6

  
7
<form method=post action=gl.pl>
8

  
9
<input type=hidden name=sort value=datesort>
10

  
11
<table width=100%>
12
  <tr>
13
    <th class=listtop>[% 'Journal' | $T8 %]</th>
14
  </tr>
15
  <tr height="5"></tr>
16
  <tr>
17
    <td>
18
      <table>
19
        <tr>
20
          <th align=right>[% 'Reference' | $T8 %]</th>
21
          <td><input name=reference size=20></td>
22
          <th align=right>[% 'Source' | $T8 %]</th>
23
          <td><input name=source size=20></td>
24
        </tr>
25
        [%- IF all_departments %]
26
        <tr>
27
          <th align=right nowrap>[% 'Department' | $T8 %]</th>
28
          <td colspan=3>[% L.select_tag('department', L.options_for_select(all_departments, value_title_sub=\department_label, with_empty=1)) %]</td>
29
        </tr>
30
        [%- END %]
31
        <tr>
32
          <th align=right>[% 'Description' | $T8 %]</th>
33
          <td><input name=description size=40></td>
34
          <th align=right>[% 'Account Number' | $T8 %]</th>
35
          <td><input name=accno size=20></td>
36
        </tr>
37
        <tr>
38
          <th align=right>[% 'Notes' | $T8 %]</th>
39
          <td colspan=3><input name=notes size=40></td>
40
        </tr>
41
        <tr>
42
          <th align=right>[% 'Project Number' | $T8 %]</th>
43
          <td colspan=3>[% L.select_tag('project_id', L.options_for_select(ALL_PROJECTS, title='projectnumber', with_empty=1)) %]</td>
44
        </tr>
45
 <tr>
46
    <th align=right>[% 'Employee' | $T8 %]</th>
47
    <td colspan=3>[% L.select_tag('employee', L.options_for_select(ALL_EMPLOYEES, value_sub=\employee_label, title='name', with_empty=1)) %]</td>
48
  </tr>
49
  <tr>
50
    <th align=right>[% 'Filter date by' | $T8 %]</th>
51
    <td colspan=3>
52
    <input name=datesort class=radio type=radio value=gldate checked> [% 'Booking Date' | $T8 %]
53
    <input name=datesort class=radio type=radio value=transdate> [% 'Invoice Date' | $T8 %]
54
  </td>
55
  </tr>
56
  <tr>
57
    <th align=right>[% 'From' | $T8 %]</th>
58
          <td>[% L.date_tag('datefrom') %]</td>
59
          <th align=right>[% 'To (time)' | $T8 %]</th>
60
          <td>[% L.date_tag('dateto') %]</td>
61
        </tr>
62
        <tr>
63
          <th align=right>[% 'Include in Report' | $T8 %]</th>
64
          <td colspan=3>
65
            <table>
66
              <tr>
67
                <td>
68
                  <input name="category" class=radio type=radio value=X checked> [% 'All' | $T8 %]
69
                  <input name="category" class=radio type=radio value=A> [% 'Asset' | $T8 %]
70
                  <input name="category" class=radio type=radio value=L> [% 'Liability' | $T8 %]
71
                  <input name="category" class=radio type=radio value=I> [% 'Revenue' | $T8 %]
72
                  <input name="category" class=radio type=radio value=E> [% 'Expense' | $T8 %]
73
                </td>
74
              </tr>
75
              <tr>
76
                <table>
77
                  <tr>
78
                    <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
79
                    <td>[% 'ID' | $T8 %]</td>
80
                    <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
81
                    <td>[% 'Invoice Date' | $T8 %]</td>
82
                    <td align=right><input name="l_gldate" class=checkbox type=checkbox value=Y checked></td>
83
                    <td>[% 'Booking Date' | $T8 %]</td>
84
                    <td align=right><input name="l_reference" class=checkbox type=checkbox value=Y checked></td>
85
                    <td>[% 'Reference' | $T8 %]</td>
86
                    <td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
87
                    <td>[% 'Description' | $T8 %]</td>
88
                    <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
89
                    <td>[% 'Notes' | $T8 %]</td>
90
                  </tr>
91
                  <tr>
92
                    <td align=right><input name="l_debit" class=checkbox type=checkbox value=Y checked></td>
93
                    <td>[% 'Debit' | $T8 %]</td>
94
                    <td align=right><input name="l_credit" class=checkbox type=checkbox value=Y checked></td>
95
                    <td>[% 'Credit' | $T8 %]</td>
96
                    <td align=right><input name="l_source" class=checkbox type=checkbox value=Y checked></td>
97
                    <td>[% 'Source' | $T8 %]</td>
98
                    <td align=right><input name="l_accno" class=checkbox type=checkbox value=Y checked></td>
99
                    <td>[% 'Account' | $T8 %]</td>
100
                  </tr>
101
                  <tr>
102
                    <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
103
                    <td>[% 'Subtotal' | $T8 %]</td>
104
                    <td align=right><input name="l_projectnumbers" class=checkbox type=checkbox value=Y></td>
105
                    <td>[% 'Project Number' | $T8 %]</td>
106
                    <td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
107
                    <td>[% 'Employee' | $T8 %]</td>
108
                  </tr>
109
                </table>
110
              </tr>
111
            </table>
112
        </tr>
113
      </table>
114
    </td>
115
  </tr>
116
  <tr>
117
    <td><hr size=3 noshade></td>
118
  </tr>
119
</table>
120

  
121
<input type=hidden name=nextsub value=generate_report>
122

  
123
<br>
124
<input class=submit type=submit name=action value="[% 'Continue' | $T8 %]">
125
</form>
126

  
127
</body>
128
</html>

Auch abrufbar als: Unified diff