Revision ad4a0fc9
Von Jan Büren vor etwa 5 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
377 | 377 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
378 | 378 |
$ref->{billed_amount} = $billed_amount{$ref->{id}}; |
379 | 379 |
$ref->{billed_netamount} = $billed_netamount{$ref->{id}}; |
380 |
$ref->{remaining_amount} = $ref->{amount} - $ref->{billed_amount}; |
|
381 |
$ref->{remaining_netamount} = $ref->{netamount} - $ref->{billed_netamount}; |
|
380 |
if ($ref->{billed_amount} < 0) { # case: credit note(s) higher than invoices |
|
381 |
$ref->{remaining_amount} = $ref->{amount} + $ref->{billed_amount}; |
|
382 |
$ref->{remaining_netamount} = $ref->{netamount} + $ref->{billed_netamount}; |
|
383 |
} else { |
|
384 |
$ref->{remaining_amount} = $ref->{amount} - $ref->{billed_amount}; |
|
385 |
$ref->{remaining_netamount} = $ref->{netamount} - $ref->{billed_netamount}; |
|
386 |
} |
|
382 | 387 |
$ref->{exchangerate} = 1 unless $ref->{exchangerate}; |
383 | 388 |
push @{ $form->{OE} }, $ref if $ref->{id} != $id{ $ref->{id} }; |
384 | 389 |
$id{ $ref->{id} } = $ref->{id}; |
Auch abrufbar als: Unified diff
Bugfix #406 Fehlerhafte abzurechnende Werte, falls Gutschriften höher als Auftragswert