X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=4f40da73f3eaf0f5b7809dbac9496b11462a3e12;hb=87c7db6a14d2276b72c85a8423e3995f20255b6a;hp=1515fa450dda1133dbb539fac95b397fc21d04a2;hpb=db68b6fd72b9f0d7d8be953746c0e7d6154f5eaf;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 1515fa450..4f40da73f 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"; @@ -239,6 +240,9 @@ sub form_header { #quote selectvendor Bug 133 $form->{"selectvendor"} = $form->quote($form->{"selectvendor"}); + #substitute \n and \r to \s (bug 543) + $form->{"selectvendor"} =~ s/[\n\r]/ /g; + $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -276,7 +280,8 @@ sub form_header { "all" => 0, "old_id" => \@old_project_ids }); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . @@ -328,7 +333,10 @@ sub form_header { $vendor = ($form->{selectvendor}) - ? qq|\n| + ? qq|\n| : qq||; $department = qq| @@ -558,7 +566,8 @@ sub form_footer { $tax .= qq| - $form->{"${item}_description"} + $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} |; @@ -599,7 +608,8 @@ sub form_footer { $tax .= qq| - Enthaltene $form->{"${item}_description"} + Enthaltene $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} @@ -783,12 +793,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 +982,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} = "";