X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/79ece53cee7f15d7ba1c6621860ae33053f2da54..616e9f78d6740437a76278630fe0ded8078463ad:/SL/DO.pm diff --git a/SL/DO.pm b/SL/DO.pm index f73d0a394..c066f99be 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 = ""; @@ -1028,7 +1056,11 @@ sub order_details { $h_bin_wh->finish(); $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}; + if ($form->{delivery_term} && $form->{language_id}) { + $form->{delivery_term}->description_long( $form->{delivery_term}->translated_attribute('description_long', $form->{language_id})); + $form->{delivery_term}->description_long_invoice($form->{delivery_term}->translated_attribute('description_long_invoice', $form->{language_id})); + } + $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id}; $form->{username} = $myconfig->{name};