Revision b98b8e3f
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
76 | 76 |
sm.name AS salesman |
77 | 77 |
FROM delivery_orders dord |
78 | 78 |
LEFT JOIN $vc ct ON (dord.${vc}_id = ct.id) |
79 |
LEFT JOIN contacts cp ON (dord.cp_id = cp.cp_id) |
|
79 | 80 |
LEFT JOIN employee e ON (dord.employee_id = e.id) |
80 | 81 |
LEFT JOIN employee sm ON (dord.salesman_id = sm.id) |
81 | 82 |
LEFT JOIN project pr ON (dord.globalproject_id = pr.id) |
... | ... | |
106 | 107 |
push @values, '%' . $form->{$vc} . '%'; |
107 | 108 |
} |
108 | 109 |
|
110 |
if ($form->{"cp_name"}) { |
|
111 |
push @where, "(cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)"; |
|
112 |
push @values, ('%' . $form->{"cp_name"} . '%')x2; |
|
113 |
} |
|
114 |
|
|
109 | 115 |
foreach my $item (qw(employee_id salesman_id)) { |
110 | 116 |
next unless ($form->{$item}); |
111 | 117 |
push @where, "dord.$item = ?"; |
Auch abrufbar als: Unified diff
Belege: Filtern nach Ansprechpartner