Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8f35ef1f

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

  • ID 8f35ef1f31e9ffefdc1d6a094d5470dfb37063e4
  • Vorgänger 2ff46003
  • Nachfolger 088b52b5

rc strict

Unterschiede anzeigen:

bin/mozilla/rc.pl
35 35

  
36 36
require "bin/mozilla/common.pl";
37 37

  
38
use strict;
39

  
38 40
1;
39 41

  
40 42
# end of main
41 43

  
42 44
sub reconciliation {
43
  $lxdebug->enter_sub();
45
  $main::lxdebug->enter_sub();
46

  
47
  my $form     = $main::form;
48
  my %myconfig = %main::myconfig;
49
  my $locale   = $main::locale;
44 50

  
45
  $auth->assert('cash');
51
  $main::auth->assert('cash');
46 52

  
47 53
  RC->paymentaccounts(\%myconfig, \%$form);
48 54

  
49
  $selection = "";
55
  my $selection = "";
50 56
  map { $selection .= "<option>$_->{accno}--$_->{description}\n" }
51 57
    @{ $form->{PR} };
52 58

  
......
54 60
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
55 61
  $form->{"jsscript"} = 1;
56 62
  $form->header;
57
  $onload = qq|focus()|;
63
  my $onload = qq|focus()|;
58 64
  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
59 65

  
60 66
  print qq|
......
107 113
</html>
108 114
|;
109 115

  
110
  $lxdebug->leave_sub();
116
  $main::lxdebug->leave_sub();
111 117
}
112 118

  
113
sub continue { call_sub($form->{"nextsub"}); }
119
sub continue { call_sub($main::form->{"nextsub"}); }
114 120

  
115 121
sub get_payments {
116
  $lxdebug->enter_sub();
122
  $main::lxdebug->enter_sub();
123

  
124
  my $form     = $main::form;
125
  my %myconfig = %main::myconfig;
117 126

  
118
  $auth->assert('cash');
127
  $main::auth->assert('cash');
119 128

  
120 129
  ($form->{accno}, $form->{account}) = split /--/, $form->{accno};
121 130

  
......
123 132

  
124 133
  &display_form;
125 134

  
126
  $lxdebug->leave_sub();
135
  $main::lxdebug->leave_sub();
127 136
}
128 137

  
129 138
sub display_form {
130
  $lxdebug->enter_sub();
139
  $main::lxdebug->enter_sub();
131 140

  
132
  $auth->assert('cash');
141
  my $form     = $main::form;
142
  my %myconfig = %main::myconfig;
143
  my $locale   = $main::locale;
133 144

  
134
  @column_index = qw(cleared transdate source name credit debit balance);
145
  $main::auth->assert('cash');
135 146

  
147
  my @column_index = qw(cleared transdate source name credit debit balance);
148
  my %column_header;
136 149
  $column_header{cleared} = "<th>&nbsp;</th>";
137 150
  $column_header{source}  =
138 151
    "<th class=listheading>" . $locale->text('Source') . "</a></th>";
......
156 169
  $column_header{balance} =
157 170
    "<th class=listheading>" . $locale->text('Balance') . "</a></th>";
158 171

  
172
  my $option;
159 173
  if ($form->{fromdate}) {
160 174
    $option .= "\n<br>" if ($option);
161 175
    $option .=
......
198 212
        </tr>
199 213
|;
200 214

  
201
  $ml = ($form->{category} eq 'A') ? -1 : 1;
215
  my $ml = ($form->{category} eq 'A') ? -1 : 1;
202 216
  $form->{beginningbalance} *= $ml;
203
  $clearedbalance = $balance = $form->{beginningbalance};
204
  $i              = 0;
205
  $id             = 0;
217
  my $balance        = $form->{beginningbalance};
218
  my $clearedbalance = $balance;
219
  my $i              = 0;
220
  my $id             = 0;
206 221

  
222
  my %column_data;
207 223
  map { $column_data{$_} = "<td>&nbsp;</td>" }
208 224
    qw(cleared transdate source name debit credit);
209 225
  $column_data{balance} =
210 226
    "<td align=right>"
211 227
    . $form->format_amount(\%myconfig, $balance, 2, 0) . "</td>";
212
  $j = 0;
228
  my $j = 0;
213 229
  print qq|
214 230
	<tr class=listrow$j>
215 231
|;
......
220 236
	</tr>
221 237
|;
222 238

  
223
  foreach $ref (@{ $form->{PR} }) {
239
  my $cleared;
240
  my $totaldebits;
241
  my $totalcredits;
242
  my $fx_transaction;
243
  my $fx;
244
  foreach my $ref (@{ $form->{PR} }) {
224 245

  
225 246
    $balance += $ref->{amount} * $ml;
226 247
    $cleared += $ref->{amount} * $ml if $ref->{cleared};
......
300 321

  
301 322
  $form->{statementbalance} =
302 323
    $form->parse_amount(\%myconfig, $form->{statementbalance});
303
  $difference =
324
  my $difference =
304 325
    $form->format_amount(\%myconfig,
305 326
                        $form->{statementbalance} - $clearedbalance - $cleared,
306 327
                        2, 0);
......
310 331

  
311 332
  $clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
312 333

  
334
  my $exchdiff;
313 335
  if ($fx) {
314 336
    $fx       = $form->format_amount(\%myconfig, $fx, 2, 0);
315 337
    $exchdiff = qq|
......
386 408
</html>
387 409
|;
388 410

  
389
  $lxdebug->leave_sub();
411
  $main::lxdebug->leave_sub();
390 412
}
391 413

  
392 414
sub update {
393
  $lxdebug->enter_sub();
415
  $main::lxdebug->enter_sub();
394 416

  
395
  $auth->assert('cash');
417
  my $form     = $main::form;
418
  my %myconfig = %main::myconfig;
419

  
420
  $main::auth->assert('cash');
396 421

  
397 422
  RC->payment_transactions(\%myconfig, \%$form);
398 423

  
399
  foreach $ref (@{ $form->{PR} }) {
424
  my $i;
425
  foreach my $ref (@{ $form->{PR} }) {
400 426
    if (!$ref->{fx_transaction}) {
401 427
      $i++;
402 428
      $ref->{cleared} = ($form->{"cleared_$i"}) ? "checked" : "";
......
405 431

  
406 432
  &display_form;
407 433

  
408
  $lxdebug->leave_sub();
434
  $main::lxdebug->leave_sub();
409 435
}
410 436

  
411 437
sub select_all {
412
  $lxdebug->enter_sub();
438
  $main::lxdebug->enter_sub();
439

  
440
  my $form     = $main::form;
441
  my %myconfig = %main::myconfig;
413 442

  
414
  $auth->assert('cash');
443
  $main::auth->assert('cash');
415 444

  
416 445
  RC->payment_transactions(\%myconfig, \%$form);
417 446

  
......
420 449

  
421 450
  &display_form;
422 451

  
423
  $lxdebug->leave_sub();
452
  $main::lxdebug->leave_sub();
424 453
}
425 454

  
426 455
sub done {
427
  $lxdebug->enter_sub();
456
  $main::lxdebug->enter_sub();
457

  
458
  my $form     = $main::form;
459
  my %myconfig = %main::myconfig;
460
  my $locale   = $main::locale;
428 461

  
429
  $auth->assert('cash');
462
  $main::auth->assert('cash');
430 463

  
431 464
  $form->{callback} = "$form->{script}?action=reconciliation";
432 465

  
......
435 468
  RC->reconcile(\%myconfig, \%$form);
436 469
  $form->redirect;
437 470

  
438
  $lxdebug->leave_sub();
471
  $main::lxdebug->leave_sub();
439 472
}
440 473

  

Auch abrufbar als: Unified diff