X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=57822abc9e806c83969f4bba2b67b103c798df06;hb=4cedba163990bd449e05da972691ebf035d61de3;hp=1b2f652066315a6f955c5703a109ccf5c2817617;hpb=f5e4c22be81f5deb2affdb09b1524f9e9890498b;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index 1b2f65206..57822abc9 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -42,7 +42,7 @@ use SL::ReportGenerator;
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/drafts.pl";
-require "bin/mozilla/report_generator.pl";
+require "bin/mozilla/reportgenerator.pl";
1;
@@ -780,8 +780,8 @@ sub form_footer {
}
# ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
- print qq| |
- if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap') && !$form->{paid_1});
+ print qq| |
+ if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap'));
print qq|
@@ -793,13 +793,12 @@ sub form_footer {
}
# button for saving history
if($form->{id} ne "") {
- print qq| |;
+ print qq| |;
}
# /button for saving history
# mark_as_paid button
if($form->{id} ne "") {
- print qq||;
+ print qq| |;
}
# /mark_as_paid button
print "
@@ -1497,26 +1496,7 @@ sub storno {
$form->error($locale->text("Transaction has already been cancelled!"));
}
- # negate amount/taxes
- for my $i (1 .. $form->{rowcount}) {
- $form->{"amount_$i"} *= -1;
- $form->{"tax_$i"} *= -1;
- }
-
- # format things
- for my $i (1 .. $form->{rowcount}) {
- for (qw(amount tax)) {
- $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) if $form->{"${_}_$i"};
- }
- }
-
- $form->{storno} = 1;
- $form->{storno_id} = $form->{id};
- $form->{id} = 0;
-
- $form->{invnumber} = "Storno-" . $form->{invnumber};
-
- post();
+ AP->storno($form, \%myconfig, $form->{id});
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
@@ -1526,5 +1506,7 @@ sub storno {
}
# /saving the history
+ $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id});
+
$lxdebug->leave_sub();
}