Revision 4d0f405c
Von Sven Schöling vor fast 14 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
1 |
#=====================================================================
|
|
1 |
#===================================================================== |
|
2 | 2 |
# LX-Office ERP |
3 | 3 |
# Copyright (C) 2004 |
4 | 4 |
# Based on SQL-Ledger Version 2.1.9 |
... | ... | |
789 | 789 |
my @makemodel_filters = qw(make model); |
790 | 790 |
my @invoice_oi_filters = qw(serialnumber soldtotal); |
791 | 791 |
my @apoe_filters = qw(transdate); |
792 |
my @like_filters = (@simple_filters, @makemodel_filters, @invoice_oi_filters);
|
|
792 |
my @like_filters = (@simple_filters, @invoice_oi_filters); |
|
793 | 793 |
my @all_columns = (@simple_filters, @makemodel_filters, @apoe_filters, qw(serialnumber)); |
794 | 794 |
my @simple_l_switches = (@all_columns, qw(listprice sellprice lastcost priceupdate weight unit bin rop image)); |
795 | 795 |
my @oe_flags = qw(bought sold onorder ordered rfq quoted); |
... | ... | |
824 | 824 |
SELECT id, name, 'customer' AS cv FROM customer UNION |
825 | 825 |
SELECT id, name, 'vendor' AS cv FROM vendor |
826 | 826 |
) AS cv ON cv.id = apoe.customer_id OR cv.id = apoe.vendor_id|, |
827 |
mv => 'LEFT JOIN vendor AS mv ON mv.id = mm.make', |
|
827 | 828 |
); |
828 |
my @join_order = qw(partsgroup makemodel invoice_oi apoe cv pfac); |
|
829 |
my @join_order = qw(partsgroup makemodel mv invoice_oi apoe cv pfac);
|
|
829 | 830 |
|
830 | 831 |
my %table_prefix = ( |
831 | 832 |
deliverydate => 'apoe.', serialnumber => 'ioi.', |
... | ... | |
942 | 943 |
WHERE (a_lc.id = p.id)) AS lastcost|; |
943 | 944 |
$table_prefix{$q_assembly_lastcost} = ' '; |
944 | 945 |
|
946 |
# special case makemodel search |
|
947 |
# all_parts is based upon the assumption that every parameter is named like the column it represents |
|
948 |
# unfortunately make would have to match vendor.name which is already taken for vendor.name in bsooqr mode. |
|
949 |
# fortunately makemodel doesn't need to be displayed later, so adding a special clause to where_token is sufficient. |
|
950 |
if ($form->{make}) { |
|
951 |
push @where_tokens, 'mv.name ILIKE ?'; |
|
952 |
push @bind_vars, "%$form->{make}%"; |
|
953 |
} |
|
954 |
if ($form->{model}) { |
|
955 |
push @where_tokens, 'mm.model ILIKE ?'; |
|
956 |
push @bind_vars, "%$form->{model}%"; |
|
957 |
} |
|
958 |
|
|
945 | 959 |
# special case: sorting by partnumber |
946 | 960 |
# since partnumbers are expected to be prefixed integers, a special sorting is implemented sorting first lexically by prefix and then by suffix. |
947 | 961 |
# and yes, that expression is designed to hold that array of regexes only once, so the map is kinda messy, sorry about that. |
... | ... | |
976 | 990 |
$joins_needed{partsgroup} = 1; |
977 | 991 |
$joins_needed{pfac} = 1; |
978 | 992 |
$joins_needed{makemodel} = 1 if grep { $form->{$_} || $form->{"l_$_"} } @makemodel_filters; |
993 |
$joins_needed{mv} = 1 if $joins_needed{makemodel}; |
|
979 | 994 |
$joins_needed{cv} = 1 if $bsooqr; |
980 | 995 |
$joins_needed{apoe} = 1 if $joins_needed{cv} || grep { $form->{$_} || $form->{"l_$_"} } @apoe_filters; |
981 | 996 |
$joins_needed{invoice_oi} = 1 if $joins_needed{apoe} || grep { $form->{$_} || $form->{"l_$_"} } @invoice_oi_filters; |
Auch abrufbar als: Unified diff
Lieferanten in Warensuche nicht nach id sondern nach Namen suchen.
Fix für Bug 1440.