X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=627cbee87d1077a836caf8b6ed657fcb3d4c50a8;hb=3138b5c71a57c5cf7ce31a96432563f663063c22;hp=fc9d9defc01c4375d2cea248d54a647127f6d78d;hpb=e71494c125864eaeff3afa997189cc4531363034;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index fc9d9defc..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 " @@ -1348,7 +1347,7 @@ sub ap_transactions { due duedate transaction_description notes employee globalprojectnumber); my @hidden_variables = map { "l_${_}" } @columns; - push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber activity_description notes project_id transdatefrom transdateto); + push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto); my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables); @@ -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(); }