X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=26fa922cd15f7271b1449d529be6cb0f1725ea24;hb=8cef58b276ce4005c0e2ada350fecd5d7a103e89;hp=bb419895642d5cc20fe2c8e43a95061e22bceace;hpb=bde667c235b2347bdd1322f118b032a2f0d93367;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index bb4198956..26fa922cd 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| @@ -349,12 +357,12 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - {invdate}> + text('button') . qq|> |; $button2 = qq| - {duedate}> + text('button') . qq|> |; @@ -367,12 +375,13 @@ sub form_header { # without JavaScript Calendar $button1 = - qq|{invdate}>|; + qq||; $button2 = - qq|{duedate}>|; + qq||; } $form->{"javascript"} .= qq||; + $form->{"javascript"} .= qq||; $jsscript .= $form->write_trigger(\%myconfig, 2, @@ -380,9 +389,11 @@ sub form_header { "quodate", "BL", "trigger_quodate"); $form->header; - + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; + $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; print qq| - +
{script}> @@ -475,12 +486,12 @@ sub form_header { | . $locale->text('Order Date') . qq| - + | . $locale->text('Quotation Date') . qq| - + @@ -559,7 +570,7 @@ sub form_footer { $tax .= qq| $form->{"${item}_description"} | - . $form->{"${item}_rate"} * 100 .qq|% + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} |; @@ -601,7 +612,7 @@ sub form_footer { $tax .= qq| Enthaltene $form->{"${item}_description"} | - . $form->{"${item}_rate"} * 100 .qq|% + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} @@ -747,12 +758,12 @@ sub form_footer { |; $column_data{"paid_$i"} = - qq|{"paid_$i"}>|; + qq||; $column_data{"exchangerate_$i"} = qq|$exchangerate|; $column_data{"AP_paid_$i"} = qq||; $column_data{"datepaid_$i"} = - qq|{"datepaid_$i"}> + qq| |; $column_data{"source_$i"} = qq|{"source_$i"}>|; @@ -785,12 +796,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 "") @@ -972,6 +985,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} = ""; @@ -1020,6 +1041,7 @@ sub post_payment { if(!exists $form->{addition} && $form->{id} ne "") { # saving the history + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "PAYMENT POSTED"; $form->save_history($form->dbconnect(\%myconfig)); # /saving the history @@ -1083,12 +1105,13 @@ sub post { if (IR->post_invoice(\%myconfig, \%$form)){ # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{addition} = "POSTED"; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; + $form->{addition} = "POSTED"; #$form->{what_done} = $locale->text("Rechnungsnummer") . qq| | . $form->{invnumber}; $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!')); @@ -1136,6 +1159,7 @@ sub yes { if (IR->delete_invoice(\%myconfig, \%$form)) { # saving the history if(!exists $form->{addition}) { + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); }