Revision 2b3f8b3a
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
1497 | 1497 |
$form->error($locale->text("Transaction has already been cancelled!")); |
1498 | 1498 |
} |
1499 | 1499 |
|
1500 |
# negate amount/taxes |
|
1501 |
for my $i (1 .. $form->{rowcount}) { |
|
1502 |
$form->{"amount_$i"} *= -1; |
|
1503 |
$form->{"tax_$i"} *= -1; |
|
1504 |
} |
|
1505 |
|
|
1506 |
# format things |
|
1507 |
for my $i (1 .. $form->{rowcount}) { |
|
1508 |
for (qw(amount tax)) { |
|
1509 |
$form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) if $form->{"${_}_$i"}; |
|
1510 |
} |
|
1511 |
} |
|
1512 |
|
|
1513 |
$form->{storno} = 1; |
|
1514 |
$form->{storno_id} = $form->{id}; |
|
1515 |
$form->{id} = 0; |
|
1516 |
|
|
1517 |
$form->{invnumber} = "Storno-" . $form->{invnumber}; |
|
1518 |
|
|
1519 |
post(); |
|
1500 |
AP->storno($form, \%myconfig, $form->{id}); |
|
1520 | 1501 |
|
1521 | 1502 |
# saving the history |
1522 | 1503 |
if(!exists $form->{addition} && $form->{id} ne "") { |
... | ... | |
1526 | 1507 |
} |
1527 | 1508 |
# /saving the history |
1528 | 1509 |
|
1510 |
$form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id}); |
|
1511 |
|
|
1529 | 1512 |
$lxdebug->leave_sub(); |
1530 | 1513 |
} |
Auch abrufbar als: Unified diff
und das ganze nochmal für Kreditorenbuchungen und deren Stornos