X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=f05d158239a74555dc1e7f2d68e3bbe582939077;hb=723b79bdf889207b36f5ab0edcfd4a6d81c6f8b6;hp=1b2f652066315a6f955c5703a109ccf5c2817617;hpb=f5e4c22be81f5deb2affdb09b1524f9e9890498b;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 1b2f65206..f05d15823 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 " @@ -1423,7 +1422,7 @@ sub ap_transactions { } $report->set_options('top_info_text' => join("\n", @options), - 'raw_bottom_info_text' => $form->parse_html_template('ap/ap_transactions_bottom'), + 'raw_bottom_info_text' => $form->parse_html_template2('ap/ap_transactions_bottom'), 'output_format' => 'HTML', 'title' => $form->{title}, 'attachment_basename' => $locale->text('invoice_list') . strftime('_%Y%m%d', localtime time), @@ -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(); }