X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=d72ca7ed852868aa8f7bbb34edbfeeab35a04d57;hb=71196b75e9beb984ead25c605ab91443269de88d;hp=a915146f42b042dde6724d629c3ae8bd550da56d;hpb=15f549fdb43fba2d99817c659533dfa02638bf27;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index a915146f4..d72ca7ed8 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -32,6 +32,7 @@
#======================================================================
use SL::IR;
+use SL::IS;
use SL::PE;
require "$form->{path}/io.pl";
@@ -558,7 +559,8 @@ sub form_footer {
$tax .= qq|
- $form->{"${item}_description"} |
+ $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
|;
@@ -599,7 +601,8 @@ sub form_footer {
$tax .= qq|
- Enthaltene $form->{"${item}_description"} |
+ Enthaltene $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
@@ -783,12 +786,14 @@ sub form_footer {
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
if ($form->{id}) {
+ my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap");
+
print qq|
|;
print qq|
-| unless ($form->{storno});
+| if ($show_storno);
if ($form->{radier}) {
print qq|
{"description_$i"} eq "")
@@ -970,6 +975,14 @@ sub storno {
$form->error($locale->text('Cannot storno storno invoice!'));
}
+ if (IS->has_storno(\%myconfig, $form, "ap")) {
+ $form->error($locale->text("Invoice has already been storno'd!"));
+ }
+
+ invoice_links();
+ prepare_invoice();
+ relink_accounts();
+
$form->{storno_id} = $form->{id};
$form->{storno} = 1;
$form->{id} = "";
@@ -1086,7 +1099,7 @@ sub post {
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
- remove_draft();
+ remove_draft() if $form->{remove_draft};
$form->redirect( $locale->text('Invoice')
. " $form->{invnumber} "
. $locale->text('posted!'));