Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8bee4bac

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

  • ID 8bee4bac5b3e562f26e866ca9ab337af20c97314
  • Vorgänger 5c285a79
  • Nachfolger c22cbab9

strictness

Unterschiede anzeigen:

SL/AP.pm
60 60
    $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
61 61
  }
62 62

  
63
  for $i (1 .. $form->{rowcount}) {
63
  for my $i (1 .. $form->{rowcount}) {
64 64
    $form->{AP_amounts}{"amount_$i"} =
65 65
      (split(/--/, $form->{"AP_amount_$i"}))[0];
66 66
  }
......
86 86
  # taxincluded doesn't make sense if there is no amount
87 87
  $form->{taxincluded} = 0 if ($form->{amount} == 0);
88 88

  
89
  for $i (1 .. $form->{rowcount}) {
90
    ($form->{"tax_id_$i"}, $NULL) = split /--/, $form->{"taxchart_$i"};
89
  for my $i (1 .. $form->{rowcount}) {
90
    ($form->{"tax_id_$i"}, undef) = split /--/, $form->{"taxchart_$i"};
91 91

  
92
    $query =
92
    my $query =
93 93
      qq|SELECT c.accno, t.taxkey, t.rate | .
94 94
      qq|FROM tax t LEFT JOIN chart c on (c.id=t.chart_id) | .
95 95
      qq|WHERE t.id = ? | .
96 96
      qq|ORDER BY c.accno|;
97
    $sth = $dbh->prepare($query);
97
    my $sth = $dbh->prepare($query);
98 98
    $sth->execute($form->{"tax_id_$i"}) || $form->dberror($query . " (" . $form->{"tax_id_$i"} . ")");
99 99
    ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = $sth->fetchrow_array();
100 100

  
101 101
    $sth->finish;
102

  
103
    my ($tax, $diff);
102 104
    if ($form->{taxincluded} *= 1) {
103 105
      if (!$form->{"korrektur_$i"}) {
104 106
        $tax =
......
160 162
                               $form->{exchangerate});
161 163
  }
162 164

  
163
  my ($query, $sth);
165
  my ($query, $sth, @values);
164 166

  
165 167
  if (!$payments_only) {
166 168
    # if we have an id delete old records
......
194 196
                amount = ?, duedate = ?, paid = ?, datepaid = ?, netamount = ?,
195 197
                curr = ?, notes = ?, department_id = ?, storno = ?, storno_id = ?
196 198
               WHERE id = ?|;
197
    my @values = ($form->{invnumber}, conv_date($form->{transdate}),
199
    @values = ($form->{invnumber}, conv_date($form->{transdate}),
198 200
                  $form->{ordnumber}, conv_i($form->{vendor_id}),
199 201
                  $form->{taxincluded} ? 't' : 'f', $form->{invtotal},
200 202
                  conv_date($form->{duedate}), $form->{invpaid},
......
205 207
    do_query($form, $dbh, $query, @values);
206 208

  
207 209
    # add individual transactions
208
    for $i (1 .. $form->{rowcount}) {
210
    for my $i (1 .. $form->{rowcount}) {
209 211
      if ($form->{"amount_$i"} != 0) {
210 212
        my $project_id;
211 213
        $project_id = conv_i($form->{"project_id_$i"});
......
470 472
    $query .= $where;
471 473
  }
472 474

  
473
  my @a = (transdate, invnumber, name);
475
  my @a = qw(transdate invnumber name);
474 476
  push @a, "employee" if $self->{l_employee};
475 477
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
476 478
  my $sortorder = join(', ', map { "$_ $sortdir" } @a);
......
616 618

  
617 619
  my ($self, $form) = @_;
618 620

  
619
  my ($exchangerate, $i, $j, $k, $key, $akey, $ref, $index, $taxamount, $totalamount);
621
  my ($exchangerate, $i, $j, $k, $key, $akey, $ref, $index, $taxamount, $totalamount, $totaltax, $totalwithholding, $withholdingrate,
622
      $taxincluded, $tax, $diff);
620 623

  
621 624
  # forex
622 625
  $form->{forex} = $form->{exchangerate};

Auch abrufbar als: Unified diff