Revision 97eaf9e0
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/DeliveryPlan.pm | ||
---|---|---|
160 | 160 |
|
161 | 161 |
sub delivery_plan_query_linked_items { |
162 | 162 |
my ($self) = @_; |
163 |
my $vc = $self->vc;
|
|
163 |
my $record_type = ($self->vc eq 'customer' ? SALES_ORDER_TYPE() : PURCHASE_ORDER_TYPE());
|
|
164 | 164 |
my $employee_id = SL::DB::Manager::Employee->current->id; |
165 | 165 |
my $oe_owner = $_[0]->all_edit_right ? '' : " oe.employee_id = $employee_id AND"; |
166 | 166 |
|
167 | 167 |
[ |
168 |
"order.${vc}_id" => { gt => 0 },
|
|
168 |
record_type => $record_type,
|
|
169 | 169 |
'order.closed' => 0, |
170 |
or => [ 'order.quotation' => 0, 'order.quotation' => undef ], |
|
171 | 170 |
|
172 | 171 |
# filter by shipped_qty < qty, read from innermost to outermost |
173 | 172 |
'id' => [ \" |
... | ... | |
176 | 175 |
FROM orderitems oi, oe, record_links rl, delivery_order_items doi |
177 | 176 |
WHERE |
178 | 177 |
oe.id = oi.trans_id AND |
179 |
oe.${vc}_id IS NOT NULL AND |
|
180 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND |
|
178 |
oe.record_type = '$record_type' AND |
|
181 | 179 |
NOT oe.closed AND |
182 | 180 |
$oe_owner |
183 | 181 |
doi.id = rl.to_id AND |
... | ... | |
195 | 193 |
SELECT oi.id FROM orderitems oi, oe |
196 | 194 |
WHERE |
197 | 195 |
oe.id = oi.trans_id AND |
198 |
oe.${vc}_id IS NOT NULL AND |
|
199 |
(oe.quotation = 'f' OR oe.quotation IS NULL) AND |
|
196 |
oe.record_type = '$record_type' AND |
|
200 | 197 |
NOT oe.closed AND |
201 | 198 |
$oe_owner |
202 | 199 |
NOT EXISTS ( |
Auch abrufbar als: Unified diff
Angebotsflag aus Datenbankzugriffen entfernt