Revision 4baae198
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
435 | 435 |
my $transdate = $::form->{transdate} ? DateTime->from_kivitendo($::form->{transdate}) : DateTime->today_local; |
436 | 436 |
my $first_taxchart; |
437 | 437 |
|
438 |
# $form->{totalpaid} is used by the action bar setup to determine |
|
439 |
# whether or not canceling is allowed. Therefore it must be |
|
440 |
# calculated prior to the action bar setup. |
|
441 |
$form->{totalpaid} = sum map { $form->{"paid_${_}"} } (1..$form->{paidaccounts}); |
|
442 |
|
|
438 | 443 |
setup_ap_display_form_action_bar(); |
439 | 444 |
|
440 | 445 |
$form->header(); |
... | ... | |
483 | 488 |
$form->{invtotal_unformatted} = $form->{invtotal}; |
484 | 489 |
$form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2); |
485 | 490 |
|
486 |
$form->{totalpaid} = 0; |
|
487 |
|
|
488 | 491 |
_sort_payments(); |
489 | 492 |
|
490 | 493 |
if ( $form->{'paid_'. $form->{paidaccounts}} ) { |
... | ... | |
495 | 498 |
$form->{accno_arap} = IS->get_standard_accno_current_assets(\%myconfig, \%$form); |
496 | 499 |
|
497 | 500 |
for my $i (1 .. $form->{paidaccounts}) { |
498 |
$form->{totalpaid} += $form->{"paid_$i"}; |
|
499 |
|
|
500 | 501 |
# format amounts |
501 | 502 |
if ($form->{"paid_$i"}) { |
502 | 503 |
$form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); |
Auch abrufbar als: Unified diff
Kreditorenbuchungen: Storno von bezahlten Rechnungen verhindern
Das Action-Bar-Setup nutzt den Wert $::form->{totalpaid} als Indikator
dafür, ob bereits Zahlungen verbucht wurden. Ist das der Fall, so darf
die Rechnung nicht storniert werden können.
Daher muss dieser Wert berechnet werden, bevor das Action-Bar-Setup
durchgeführt wird.