X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fap.pl;h=627cbee87d1077a836caf8b6ed657fcb3d4c50a8;hb=82c41aacb54996848276f5cb00c6587bf20f03a7;hp=0c017140e0e30d29f68998e7f4f87277534f2bb6;hpb=89dd4ca84494de24ac1ecc7bd3b84fdd35e28020;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index 0c017140e..627cbee87 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', $form->{id}));
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 "
@@ -1387,6 +1386,8 @@ sub ap_transactions {
$report->set_export_options('ap_transactions', @hidden_variables);
+ $report->set_sort_indicator($form->{sort}, 1);
+
my @options;
if ($form->{vendor}) {
push @options, $locale->text('Vendor') . " : $form->{vendor}";
@@ -1495,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 "") {
@@ -1524,5 +1506,7 @@ sub storno {
}
# /saving the history
+ $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id});
+
$lxdebug->leave_sub();
}