X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c6a4a05a9ad2ae02dafff463fa7b49ce41d2ae2f..9ae7f1f9554c44bb7146be17c31acf224c249c7e:/SL/IC.pm diff --git a/SL/IC.pm b/SL/IC.pm index 5396c7add..9b224d62e 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -1007,12 +1007,6 @@ sub all_parts { $joins_needed{apoe} = 1 if $joins_needed{cv} || grep { $form->{$_} || $form->{"l_$_"} } @apoe_filters; $joins_needed{invoice_oi} = 1 if $joins_needed{apoe} || grep { $form->{$_} || $form->{"l_$_"} } @invoice_oi_filters; - # in bsoorq, use qtys instead of onhand - if ($joins_needed{invoice_oi}) { - $renamed_columns{onhand} = 'onhand_before_bsooqr'; - $renamed_columns{qty} = 'onhand'; - } - # special case for description search. # up in the simple filter section the description filter got interpreted as something like: WHERE description ILIKE '%$form->{description}%' # now we'd like to search also for the masked description entered in orderitems and invoice, so... @@ -1083,6 +1077,13 @@ sub all_parts { map { $_->{onhand} *= 1 } @{ $form->{parts} }; + # fix qty sign in ap. those are saved negative + if ($bsooqr && $form->{bought}) { + for my $row (@{ $form->{parts} }) { + $row->{qty} *= -1 if $row->{module} eq 'ir'; + } + } + # post processing for assembly parts lists (bom) # for each part get the assembly parts and add them into the partlist. my @assemblies;