push @filter_vars, like($filter{description});
}
+ if ($filter{classification_id}) {
+ push @filter_ary, "p.classification_id = ?";
+ push @filter_vars, $filter{classification_id};
+ }
+
if ($filter{chargenumber}) {
push @filter_ary, "i1.chargenumber ILIKE ?";
push @filter_vars, like($filter{chargenumber});
"qty" => "ABS(SUM(i1.qty))",
"partnumber" => "p.partnumber",
"partdescription" => "p.description",
+ "classification_id" => "p.classification_id",
+ "part_type" => "p.part_type",
"bindescription" => "b.description",
"chargenumber" => "i1.chargenumber",
"bestbefore" => "i1.bestbefore",
"warehouse_from" => "'$filter{na}'",
};
+ $form->{l_classification_id} = 'Y';
$form->{l_invoice_id} = $form->{l_oe_id} if $form->{l_oe_id};
# build the select clauses.
# - warehouse_id - will return matches with this warehouse_id only
# - partnumber - will return only matches where the given string is a substring of the partnumber
# - partsid - will return matches with this parts_id only
+# - classification_id - will return matches with this parts with this classification only
# - description - will return only matches where the given string is a substring of the description
# - chargenumber - will return only matches where the given string is a substring of the chargenumber
# - bestbefore - will return only matches with this bestbefore date
push @filter_vars, like($filter{partnumber});
}
+ if ($filter{classification_id}) {
+ push @filter_ary, "p.classification_id = ?";
+ push @filter_vars, $filter{classification_id};
+ }
+
if ($filter{description}) {
push @filter_ary, "p.description ILIKE ?";
push @filter_vars, like($filter{description});
"warehouseid" => "i.warehouse_id",
"partnumber" => "p.partnumber",
"partdescription" => "p.description",
+ "classification_id" => "p.classification_id",
+ "part_type" => "p.part_type",
"bindescription" => "b.description",
"binid" => "b.id",
"chargenumber" => "i.chargenumber",
"partunit" => "p.unit",
"stock_value" => "p.lastcost / COALESCE(pfac.factor, 1)",
);
+ $form->{l_classification_id} = 'Y';
+ $form->{l_part_type} = 'Y';
+
my $select_clause = join ', ', map { +/^l_/; "$select_tokens{$'} AS $'" }
( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
qw(l_parts_id l_qty l_partunit) );