X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=66aa4b8f2583e313fff9e7eae7ffe9fe4b60b8d4;hb=5f49de40a2c8c6eca92bb3fd88c1ee0126264bd1;hp=685e7b1828e374fcb444fab8176bea290b73c156;hpb=cb2abccdef0236f43a1712cb2b39db4ce57a2d40;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 685e7b182..66aa4b8f2 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -300,18 +300,20 @@ sub form_header { my @old_project_ids = ($form->{"globalproject_id"}); map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; - $form->get_lists("shipto" => "ALL_SHIPTO", - "projects" => { "key" => "ALL_PROJECTS", + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 0, "old_id" => \@old_project_ids }, - "employees" => "ALL_EMPLOYEES", - "salesmen" => "ALL_SALESMEN", "taxzones" => "ALL_TAXZONES", "currencies" => "ALL_CURRENCIES", "customers" => "ALL_CUSTOMERS", "departments" => "all_departments", "price_factors" => "ALL_PRICE_FACTORS"); + $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); + $TMPL_VAR{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]); + $TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [ + or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ] + ]); $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, @@ -321,8 +323,6 @@ sub form_header { ] ] ]); - $TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} }; - $TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) }; $TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" }; # customer @@ -576,7 +576,7 @@ sub update { $form->{creditremaining} -= $amount; - map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice listprice lastcost); + map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice lastcost); $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); @@ -938,6 +938,12 @@ sub credit_note { # map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } # qw(creditlimit creditremaining); + for my $i (1 .. $form->{rowcount}) { + for (qw(listprice)) { + $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"}; + } + } + my $currency = $form->{currency}; &invoice_links;