X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDO.pm;h=4ef285461b645d6fe745f7b8c3502f6e978715c2;hb=daaac66a83e3dbdcc910731a1695e7e59b9cbbc6;hp=f73d0a39462a178657494ace7db05133773621ba;hpb=79ece53cee7f15d7ba1c6621860ae33053f2da54;p=kivitendo-erp.git diff --git a/SL/DO.pm b/SL/DO.pm index f73d0a394..4ef285461 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -33,6 +33,7 @@ package DO; +use Carp; use List::Util qw(max); use YAML; @@ -180,6 +181,33 @@ sub transactions { push @values, conv_date($form->{insertdateto}); } + if ($form->{parts_partnumber}) { + push @where, <{parts_partnumber}); + } + + if ($form->{parts_description}) { + push @where, <{parts_description}); + } + if (@where) { $query .= " WHERE " . join(" AND ", map { "($_)" } @where); } @@ -284,7 +312,7 @@ sub save { my $items_reqdate; $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS'); - my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} }; + my %price_factors = map { $_->{id} => $_->{factor} *1 } @{ $form->{ALL_PRICE_FACTORS} }; my $price_factor; my %part_id_map = map { $_ => 1 } grep { $_ } map { $form->{"id_$_"} } (1 .. $form->{rowcount}); @@ -886,7 +914,7 @@ sub order_details { push @arrays, map { "project_cvar_$_->{name}" } @{ $project_cvar_configs }; $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS'); - my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} }; + my %price_factors = map { $_->{id} => $_->{factor} *1 } @{ $form->{ALL_PRICE_FACTORS} }; my $totalweight = 0; my $sameitem = ""; @@ -1027,9 +1055,9 @@ sub order_details { $h_pg->finish(); $h_bin_wh->finish(); + $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id}; $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; - $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id}; $form->{username} = $myconfig->{name};