Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ed4ab03f

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

  • ID ed4ab03f2d6411f0860f820504736b64430bd39a
  • Vorgänger f4a98169
  • Nachfolger 031251fb

ca strict

Unterschiede anzeigen:

bin/mozilla/ca.pl
39 39

  
40 40
require "bin/mozilla/reportgenerator.pl";
41 41

  
42
use strict;
43

  
42 44
1;
43 45

  
44 46
# end of main
......
72 74
# $locale->text('Dec')
73 75

  
74 76
sub chart_of_accounts {
75
  $lxdebug->enter_sub();
77
  $main::lxdebug->enter_sub();
78

  
79
  my $form     = $main::form;
80
  my %myconfig = %main::myconfig;
81
  my $locale   = $main::locale;
76 82

  
77
  $auth->assert('report');
83
  $main::auth->assert('report');
78 84

  
79 85
  $form->{title} = $locale->text('Chart of Accounts');
80 86

  
81
  if ($eur) {
87
  if ($main::eur) {
82 88
    $form->{method} = "cash";
83 89
  }
84 90

  
......
137 143

  
138 144
  $report->generate_with_headers();
139 145

  
140
  $lxdebug->leave_sub();
146
  $main::lxdebug->leave_sub();
141 147
}
142 148

  
143 149
sub list {
144
  $lxdebug->enter_sub();
150
  $main::lxdebug->enter_sub();
151

  
152
  my $form     = $main::form;
153
  my %myconfig = %main::myconfig;
154
  my $locale   = $main::locale;
145 155

  
146
  $auth->assert('report');
156
  $main::auth->assert('report');
147 157

  
148 158
  $form->{title} = $locale->text('List Transactions');
149 159
  $form->{title} .= " - " . $locale->text('Account') . " $form->{accno}";
150
  $year = (localtime)[5] + 1900;
160
  my $year = (localtime)[5] + 1900;
151 161

  
152 162
  # get departments
153 163
  $form->all_departments(\%myconfig);
......
160 170
    } (@{ $form->{all_departments} });
161 171
  }
162 172

  
163
  $department = qq|
173
  my $department = qq|
164 174
        <tr>
165 175
	  <th align=right nowrap>| . $locale->text('Department') . qq|</th>
166 176
	  <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
167 177
	</tr>
168 178
| if $form->{selectdepartment};
169
  $accrual = ($eur) ? ""        : "checked";
170
  $cash    = ($eur) ? "checked" : "";
179
  my $accrual = ($main::eur) ? ""        : "checked";
180
  my $cash    = ($main::eur) ? "checked" : "";
171 181

  
172
  $name_1    = "fromdate";
173
  $id_1      = "fromdate";
174
  $value_1   = "$form->{fromdate}";
175
  $trigger_1 = "trigger1";
176
  $name_2    = "todate";
177
  $id_2      = "todate";
178
  $value_2   = "";
179
  $trigger_2 = "trigger2";
182
  my $name_1    = "fromdate";
183
  my $id_1      = "fromdate";
184
  my $value_1   = "$form->{fromdate}";
185
  my $trigger_1 = "trigger1";
186
  my $name_2    = "todate";
187
  my $id_2      = "todate";
188
  my $value_2   = "";
189
  my $trigger_2 = "trigger2";
180 190

  
191
  my ($button1, $button1_2, $button2, $button2_2, $jsscript);
181 192

  
182 193
  # with JavaScript Calendar
183 194
  if ($form->{jsscript}) {
......
225 236
  }
226 237
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
227 238
  $form->header;
228
  $onload = qq|focus()|;
239
  my $onload = qq|focus()|;
229 240
  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
230 241
  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
231 242

  
......
242 253
<input type=hidden name=accno value=$form->{accno}>
243 254
<input type=hidden name=description value="$form->{description}">
244 255
<input type=hidden name=sort value=transdate>
245
<input type=hidden name=eur value=$eur>
256
<input type=hidden name=eur value=$main::eur>
246 257
<input type=hidden name=accounttype value=$form->{accounttype}>
247 258

  
248 259
<table border=0 width=100%>
......
263 274
	</tr>
264 275
|;
265 276

  
277
    our $checked;
266 278
    print qq|
267 279
	<tr>
268 280
		<td align=right>
......
370 382
</html>
371 383
|;
372 384

  
373
  $lxdebug->leave_sub();
385
  $main::lxdebug->leave_sub();
374 386
}
375 387

  
376 388
sub format_debit_credit {
377
  $lxdebug->enter_sub();
389
  $main::lxdebug->enter_sub();
378 390

  
379 391
  my $dc = shift;
380 392

  
393
  my $form     = $main::form;
394
  my %myconfig = %main::myconfig;
395
  my $locale   = $main::locale;
396

  
381 397
  my $formatted_dc  = $form->format_amount(\%myconfig, abs($dc), 2) . ' ';
382 398
  $formatted_dc    .= ($dc > 0) ? $locale->text('Credit (one letter abbreviation)') : $locale->text('Debit (one letter abbreviation)');
383 399

  
384
  $lxdebug->leave_sub();
400
  $main::lxdebug->leave_sub();
385 401

  
386 402
  return $formatted_dc;
387 403
}
388 404

  
389 405

  
390 406
sub list_transactions {
391
  $lxdebug->enter_sub();
407
  $main::lxdebug->enter_sub();
408

  
409
  my $form     = $main::form;
410
  my %myconfig = %main::myconfig;
411
  my $locale   = $main::locale;
392 412

  
393
  $auth->assert('report');
413
  $main::auth->assert('report');
394 414

  
395 415
  $form->{title} = $locale->text('Account') . " $form->{accno} - $form->{description}";
396 416

  
......
438 458
        $form->{fromdate} = "1.2.$form->{year}";
439 459

  
440 460
        #this works from 1901 to 2099, 1900 and 2100 fail.
441
        $leap = ($form->{year} % 4 == 0) ? "29" : "28";
461
        my $leap = ($form->{year} % 4 == 0) ? "29" : "28";
442 462
        $form->{todate} = "$leap.2.$form->{year}";
443 463
        last SWITCH;
444 464
      };
......
558 578

  
559 579
  my %column_alignment = map { $_ => 'right' } qw(debit credit);
560 580

  
561
  @custom_headers = ();
581
  my @custom_headers = ();
562 582
 # Zeile 1:
563 583
 push @custom_headers, [
564 584
   { 'text' => 'Letzte Buchung', },
......
610 630

  
611 631
  $report->set_sort_indicator($form->{sort}, 1);
612 632

  
613
  $column_defs->{balance}->{visible} = 1;
633
  $column_defs{balance}->{visible} = 1;
614 634

  
615 635
  my $ml = ($form->{category} =~ /(A|E)/) ? -1 : 1;
616 636

  
......
706 726

  
707 727

  
708 728
  $report->add_separator();
709
  my $row = {
729
  $row = {
710 730
     'transdate' => {
711 731
       'data'    => "",
712 732
       'class' => 'listtotal',
......
736 756

  
737 757
  $report->add_data($row);
738 758
  my $saldo_new = format_debit_credit($form->{saldo_new});
739
  my $row = {
759
  $row = {
740 760
     'transdate' => {
741 761
       'data'    => "",
742 762
       'class' => 'listtotal',
......
769 789

  
770 790
  $report->generate_with_headers();
771 791

  
772
  $lxdebug->leave_sub();
792
  $main::lxdebug->leave_sub();
773 793
}
774 794

  
775 795
sub create_subtotal_row {
776
  $lxdebug->enter_sub();
796
  $main::lxdebug->enter_sub();
797

  
798
  my $form     = $main::form;
799
  my %myconfig = %main::myconfig;
777 800

  
778 801
  my ($totals, $columns, $column_alignment, $class) = @_;
779 802

  
......
783 806

  
784 807
  map { $totals->{$_} = 0 } qw(debit credit);
785 808

  
786
  $lxdebug->leave_sub();
809
  $main::lxdebug->leave_sub();
787 810

  
788 811
  return $row;
789 812
}

Auch abrufbar als: Unified diff