X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=f3d02605f465c8e7c40710844949711333492c99;hb=6bad0469c4f5bb92830f77cf7675e76730e79ae4;hp=343804690fd413895a8a923ab40f5291a312a762;hpb=5cfd34f0459bf58cee93d28a2cbe7e9f2684d1ca;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 343804690..f3d02605f 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -35,9 +35,9 @@ use SL::IR; use SL::IS; use SL::PE; -require "$form->{path}/io.pl"; -require "$form->{path}/arap.pl"; -require "$form->{path}/common.pl"; +require "bin/mozilla/io.pl"; +require "bin/mozilla/arap.pl"; +require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; 1; @@ -278,7 +278,8 @@ sub form_header { $form->get_lists("contacts" => "ALL_CONTACTS", "projects" => { "key" => "ALL_PROJECTS", "all" => 0, - "old_id" => \@old_project_ids }); + "old_id" => \@old_project_ids }, + "taxzones" => "ALL_TAXZONES"); my %labels; my @values = (undef); @@ -302,38 +303,40 @@ sub form_header { '-labels' => \%labels, '-default' => $form->{"globalproject_id"})); - if (@{ $form->{TAXZONE} }) { - $form->{selecttaxzone} = ""; - foreach $item (@{ $form->{TAXZONE} }) { - if ($item->{id} == $form->{taxzone_id}) { - $form->{selecttaxzone} .= - ""; - } else { - $form->{selecttaxzone} .= - ""; - } - - } - } else { - $form->{selecttaxzone} =~ s/ selected//g; - if ($form->{taxzone_id} ne "") { - $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/; - } + %labels = (); + @values = (); + foreach my $item (@{ $form->{"ALL_TAXZONES"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"description"}; } - $taxzone = qq| - - | . $locale->text('Steuersatz') . qq| - - - |; - + if (!$form->{"id"}) { + $taxzone = qq| + + | . $locale->text('Steuersatz') . qq| + | . + NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"}, + '-values' => \@values, '-labels' => \%labels)) . qq| + + |; + } else { + $taxzone = qq| + + | . $locale->text('Steuersatz') . qq| + + + | . H($labels{$form->{"taxzone_id"}}) . qq| + + |; + } $vendor = ($form->{selectvendor}) - ? qq|\n| + ? qq|\n| : qq||; $department = qq| @@ -354,12 +357,12 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - {invdate}> + text('button') . qq|> |; $button2 = qq| - {duedate}> + text('button') . qq|> |; @@ -372,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, @@ -385,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}> @@ -480,12 +486,12 @@ sub form_header { | . $locale->text('Order Date') . qq| - + | . $locale->text('Quotation Date') . qq| - + @@ -752,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"}>|; @@ -820,19 +826,8 @@ sub form_footer { '-class' => 'submit')); } - print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) . - qq| - -{rowcount}> - - - -{path}> -{login}> -{password}> -| - . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) - . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]); + print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers); + $form->hide_form(qw(rowcount callback draft_id draft_description login password)); # button for saving history if($form->{id} ne "") { @@ -986,12 +981,20 @@ sub storno { invoice_links(); prepare_invoice(); relink_accounts(); - + + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; + $form->{addition} = "CANCELED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->{storno_id} = $form->{id}; $form->{storno} = 1; $form->{id} = ""; $form->{invnumber} = "Storno zu " . $form->{invnumber}; - + $form->{rowcount}++; &post(); $lxdebug->leave_sub(); @@ -1035,7 +1038,9 @@ sub post_payment { if(!exists $form->{addition} && $form->{id} ne "") { # saving the history + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "PAYMENT POSTED"; + $form->{what_done} = $form->{currency} . qq| | . $form->{paid} . qq| | . $locale->text("POSTED"); $form->save_history($form->dbconnect(\%myconfig)); # /saving the history $form->redirect($locale->text(' Payment posted!')); @@ -1098,7 +1103,8 @@ 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)); } @@ -1151,6 +1157,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)); }