Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 662ded38

Von Sven Schöling vor mehr als 14 Jahren hinzugefügt

  • ID 662ded382ad646d46d1e2613df42ed35ee2f6265
  • Vorgänger eed84962
  • Nachfolger 79fe937f

Globale Variablen entfernt/umgewandelt.

Conflicts:

bin/mozilla/ar.pl

Unterschiede anzeigen:

bin/mozilla/ap.pl
972 972

  
973 973
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
974 974

  
975
  my $invdate = $form->datetonum($form->{transdate}, \%myconfig);
976

  
975 977
  for my $i (1 .. $form->{paidaccounts}) {
976 978
    if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
977 979
      my $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
......
983 985

  
984 986
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
985 987
        $form->{"exchangerate_$i"} = $form->{exchangerate}
986
          if ($form->{transdate} == $datepaid);
988
          if ($invdate == $datepaid);
987 989
        $form->isblank("exchangerate_$i",
988 990
                       $locale->text('Exchangerate for payment missing!'));
989 991
      }
bin/mozilla/ar.pl
1035 1035

  
1036 1036
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
1037 1037

  
1038
  my $invdate = $form->datetonum($form->{transdate}, \%myconfig);
1039

  
1038 1040
  for my $i (1 .. $form->{paidaccounts}) {
1039 1041

  
1040 1042
    if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
bin/mozilla/io.pl
1952 1952

  
1953 1953
  $form->{script} = "licenses.pl";
1954 1954

  
1955
  our $name;
1956

  
1957 1955
  map { $form->{$_} = $form->{"old_$_"} } qw(partnumber description);
1958 1956
  map { $form->{$_} = $form->escape($form->{$_}, 1) }
1959 1957
    qw(partnumber description);
1960 1958
  $form->{callback} =
1961
    qq|$form->{script}?action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$name&type=$form->{type}&customer=$customer&partnumber=$form->{partnumber}&description=$form->{description}&previousform="$previousform"&initial=1|;
1959
    qq|$form->{script}?action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$form->{name}&type=$form->{type}&customer=$customer&partnumber=$form->{partnumber}&description=$form->{description}&previousform="$previousform"&initial=1|;
1962 1960
  $form->redirect;
1963 1961

  
1964 1962
  $main::lxdebug->leave_sub();
bin/mozilla/is.pl
285 285

  
286 286
  $main::auth->assert('invoice_edit');
287 287

  
288
  our %TMPL_VAR = ();
288
  my %TMPL_VAR = ();
289 289
  my @custom_hiddens;
290 290

  
291 291
  $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
......
596 596

  
597 597
  $main::auth->assert('invoice_edit');
598 598

  
599
  our $invdate;
599
  my $invdate = $form->datetonum($form->{invdate}, \%myconfig);
600 600

  
601 601
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
602 602
  for my $i (1 .. $form->{paidaccounts}) {
......
886 886

  
887 887
  $form->{title}  = $locale->text('Add Credit Note');
888 888
  $form->{script} = 'is.pl';
889
  our $script         = "is";
890
  our $buysell        = 'buy';
891 889

  
892 890

  
893 891
  # bo creates the id, reset it
......
906 904
  &invoice_links;
907 905

  
908 906
  $form->{currency}     = $currency;
909
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
907
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, 'buy');
910 908
  $form->{exchangerate} = $form->{forex} || '';
911 909

  
912 910
  $form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
bin/mozilla/rp.pl
107 107
  'balance_sheet'    => 'report',
108 108
};
109 109

  
110
# subs use these pretty freely, so declare them here
111
our (%column_data, @column_index);
112
our ($subtotalnetamount, $subtotaltax, $subtotal);
113

  
114 110
sub check_rp_access {
115 111
  my $form     = $main::form;
116 112

  
......
2115 2111
  my $descvar     = "$form->{accno}_description";
2116 2112
  my $description = $form->escape($form->{$descvar});
2117 2113
  my $ratevar     = "$form->{accno}_rate";
2118
  our $taxrate; # most likely error
2114
  my ($subtotalnetamount, $subtotaltax, $subtotal) = (0, 0, 0);
2119 2115

  
2120 2116
  my $department = $form->escape($form->{department});
2121 2117

  
2122 2118
  # construct href
2123 2119
  my $href =
2124
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
2120
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}";
2125 2121

  
2126 2122
  # construct callback
2127 2123
  $description = $form->escape($form->{$descvar},   1);
2128 2124
  $department  = $form->escape($form->{department}, 1);
2129 2125
  my $callback    =
2130
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
2126
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}";
2131 2127

  
2132 2128
  my $title = $form->escape($form->{title});
2133 2129
  $href .= "&title=$title";
......
2138 2134

  
2139 2135
  my @columns =
2140 2136
    $form->sort_columns(qw(id transdate invnumber name netamount tax amount));
2137
  my @column_index;
2141 2138

  
2142 2139
  foreach my $item (@columns) {
2143 2140
    if ($form->{"l_$item"} eq "Y") {
......
2242 2239

  
2243 2240
    if ($form->{l_subtotal} eq 'Y') {
2244 2241
      if ($sameitem ne $ref->{ $form->{sort} }) {
2245
        &tax_subtotal;
2242
        tax_subtotal(\@column_index, \$subtotalnetamount, \$subtotaltax, \$subtotal);
2246 2243
        $sameitem = $ref->{ $form->{sort} };
2247 2244
      }
2248 2245
    }
......
2258 2255
      $ref->{$_} = $form->format_amount(\%myconfig, $ref->{$_}, 2, " ");
2259 2256
    } qw(netamount tax amount);
2260 2257

  
2258
    my %column_data;
2261 2259
    $column_data{id}        = qq|<td>$ref->{id}</td>|;
2262 2260
    $column_data{invnumber} =
2263 2261
      qq|<td><a href=$module?action=edit&id=$ref->{id}&callback=$callback>$ref->{invnumber}</a></td>|;
......
2282 2280
  }
2283 2281

  
2284 2282
  if ($form->{l_subtotal} eq 'Y') {
2285
    &tax_subtotal;
2283
    tax_subtotal(\@column_index, \$subtotalnetamount, \$subtotaltax, \$subtotal);
2286 2284
  }
2287 2285

  
2286
  my %column_data;
2288 2287
  map { $column_data{$_} = qq|<th>&nbsp;</th>| } @column_index;
2289 2288

  
2290 2289
  print qq|
......
2322 2321
sub tax_subtotal {
2323 2322
  $main::lxdebug->enter_sub();
2324 2323

  
2324
  my ($column_index, $subtotalnetamount, $subtotaltax, $subtotal) = @_;
2325

  
2325 2326
  my $form     = $main::form;
2326 2327
  my %myconfig = %main::myconfig;
2327 2328
  my $locale   = $main::locale;
2328 2329

  
2329
  map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
2330
  my %column_data;
2331
  map { $column_data{$_} = "<td>&nbsp;</td>" } @{ $column_index };
2330 2332

  
2331
  $subtotalnetamount = $form->format_amount(\%myconfig, $subtotalnetamount, 2, "&nbsp;");
2332
  $subtotaltax       = $form->format_amount(\%myconfig, $subtotaltax, 2, "&nbsp;");
2333
  $subtotal          = $form->format_amount(\%myconfig, $subtotalnetamount + $subtotaltax, 2, "&nbsp;");
2333
  $$subtotalnetamount = $form->format_amount(\%myconfig, $$subtotalnetamount, 2, "&nbsp;");
2334
  $$subtotaltax       = $form->format_amount(\%myconfig, $$subtotaltax, 2, "&nbsp;");
2335
  $$subtotal          = $form->format_amount(\%myconfig, $$subtotalnetamount + $$subtotaltax, 2, "&nbsp;");
2334 2336

  
2335
  $column_data{netamount} = "<th class=listsubtotal align=right>$subtotalnetamount</th>";
2336
  $column_data{tax}       = "<th class=listsubtotal align=right>$subtotaltax</th>";
2337
  $column_data{amount}    = "<th class=listsubtotal align=right>$subtotal</th>";
2337
  $column_data{netamount} = "<th class=listsubtotal align=right>$$subtotalnetamount</th>";
2338
  $column_data{tax}       = "<th class=listsubtotal align=right>$$subtotaltax</th>";
2339
  $column_data{amount}    = "<th class=listsubtotal align=right>$$subtotal</th>";
2338 2340

  
2339
  $subtotalnetamount = 0;
2340
  $subtotaltax       = 0;
2341
  $$subtotalnetamount = 0;
2342
  $$subtotaltax       = 0;
2341 2343

  
2342 2344
  print qq|
2343 2345
        <tr class=listsubtotal>
2344 2346
|;
2345
  map { print "\n$column_data{$_}" } @column_index;
2347
  map { print "\n$column_data{$_}" } @{ $column_index };
2346 2348

  
2347 2349
  print qq|
2348 2350
        </tr>

Auch abrufbar als: Unified diff