Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6923fcd4

Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt

  • ID 6923fcd42c74560e2d65b6a3c750d7a3f99e512a
  • Vorgänger ecf7739c
  • Nachfolger 44703001

DeliveryPlan: Entfernt Einstellung, um nur ausgelagerte Lieferscheine zu berücksichtigen.

Diese Option lieferte hier ungenaue Ergebnisse, da dennoch auch Positionen
angezeigt wurden, für die überhaupt kein Lieferschein erstellt wurde.

Unterschiede anzeigen:

SL/Controller/DeliveryPlan.pm
208 208
  my $vc     = $self->vc;
209 209
  my $employee_id = SL::DB::Manager::Employee->current->id;
210 210
  my $oe_owner = $_[0]->all_edit_right ? '' : " oe.employee_id = $employee_id AND";
211
  # check delivered state for delivery_orders (transferred out) if enabled
212
  my $filter_delivered = ($::instance_conf->get_delivery_plan_calculate_transferred_do) ?
213
      "AND (SELECT delivered from delivery_orders where id = doi.delivery_order_id)" : '';
211

  
214 212
  [
215 213
  "order.${vc}_id" => { gt => 0 },
216 214
  'order.closed' => 0,
......
239 237
          rl.to_table = 'delivery_orders' AND
240 238
          rl.to_id = doi.delivery_order_id AND
241 239
          oi.parts_id = doi.parts_id
242
          $filter_delivered
243 240
      ) tuples GROUP BY parts_id, trans_id, qty
244 241
    ) partials
245 242
    LEFT JOIN orderitems oi ON partials.parts_id = oi.parts_id AND partials.trans_id = oi.trans_id
......
292 289
          (oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed
293 290
      ) rl
294 291
      LEFT JOIN delivery_order_items doi ON (rl.to_id = doi.delivery_order_id)
295
      WHERE 1 = 1
296
      $filter_delivered
297 292
      GROUP BY rl.from_id, doi.parts_id
298 293
    ) agg ON (agg.oid = oi.trans_id AND agg.parts_id = oi.parts_id)
299 294
    LEFT JOIN oe ON oe.id = oi.trans_id
......
316 311
  my $vc     = $self->vc;
317 312
  my $employee_id = SL::DB::Manager::Employee->current->id;
318 313
  my $oe_owner = $_[0]->all_edit_right ? '' : " oe.employee_id = $employee_id AND";
319
  # check delivered state for delivery_orders (transferred out) if enabled
320
  my $filter_delivered = ($::instance_conf->get_delivery_plan_calculate_transferred_do) ?
321
      "AND (SELECT delivered from delivery_orders where id = doi.delivery_order_id)" : '';
322 314

  
323 315
  [
324 316
  "order.${vc}_id" => { gt => 0 },
......
340 332
        rl.from_table = 'orderitems'AND
341 333
        rl.to_table   = 'delivery_order_items' AND
342 334
        rl.from_id = oi.id
343
        $filter_delivered
344 335
      GROUP BY oi.id
345 336
    ) linked
346 337
    WHERE qty > doi_qty

Auch abrufbar als: Unified diff