Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1c77d03f

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 1c77d03f93b0b05d824096a9c752c39d1302bc3b
  • Vorgänger abed526f
  • Nachfolger db52ddd7

Angebotsflag/Intakeflag aus Datenbankzugriffen entfernt

Unterschiede anzeigen:

SL/IC.pm
216 216
       ) AS ioi ON ioi.parts_id = p.id|,
217 217
    apoe       =>
218 218
      q|LEFT JOIN (
219
         SELECT id, transdate, 'ir' AS module, ordnumber, quonumber,         invnumber, FALSE AS quotation, NULL AS customer_id,         vendor_id,    NULL AS deliverydate, globalproject_id, 'invoice'    AS ioi FROM ap UNION
220
         SELECT id, transdate, 'is' AS module, ordnumber, quonumber,         invnumber, FALSE AS quotation,         customer_id, NULL AS vendor_id,            deliverydate, globalproject_id, 'invoice'    AS ioi FROM ar UNION
221
         SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber,          quotation,         customer_id,         vendor_id, reqdate AS deliverydate, globalproject_id, 'orderitems' AS ioi FROM oe
219
         SELECT id, transdate, 'ir' AS module, ordnumber, quonumber,         invnumber, 'purchase_invoice' AS record_type, NULL AS customer_id,         vendor_id,    NULL AS deliverydate, globalproject_id, 'invoice'    AS ioi FROM ap UNION
220
         SELECT id, transdate, 'is' AS module, ordnumber, quonumber,         invnumber, 'sales_invoice'    AS record_type,         customer_id, NULL AS vendor_id,            deliverydate, globalproject_id, 'invoice'    AS ioi FROM ar UNION
221
         SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber,                       record_type,         customer_id,         vendor_id, reqdate AS deliverydate, globalproject_id, 'orderitems' AS ioi FROM oe
222 222
       ) AS apoe ON ((ioi.trans_id = apoe.id) AND (ioi.ioi = apoe.ioi))|,
223 223
    cv         =>
224 224
      q|LEFT JOIN (
......
244 244
     description  => 'p.',
245 245
     qty          => 'ioi.',
246 246
     serialnumber => 'ioi.',
247
     quotation    => 'apoe.',
247
     record_type  => 'apoe.',
248 248
     cv           => 'cv.',
249 249
     "ioi.id"     => ' ',
250 250
     "ioi.ioi"    => ' ',
......
441 441
  my $bsooqr        = any { $form->{$_} } @oe_flags;
442 442
  my @bsooqr_tokens = ();
443 443

  
444
  push @select_tokens, @qsooqr_flags, 'quotation', 'cv', 'ioi.id', 'ioi.ioi'  if $bsooqr;
444
  push @select_tokens, @qsooqr_flags, 'record_type', 'cv', 'ioi.id', 'ioi.ioi'  if $bsooqr;
445 445
  push @select_tokens, @deliverydate_flags                                    if $bsooqr && $form->{l_deliverydate};
446 446
  push @select_tokens, $q_assembly_lastcost                                   if $form->{l_assembly} && $form->{l_lastcost};
447 447
  push @bsooqr_tokens, q|module = 'ir' AND NOT ioi.assemblyitem|              if $form->{bought};
448 448
  push @bsooqr_tokens, q|module = 'is' AND NOT ioi.assemblyitem|              if $form->{sold};
449
  push @bsooqr_tokens, q|module = 'oe' AND NOT quotation AND cv = 'customer'| if $form->{ordered};
450
  push @bsooqr_tokens, q|module = 'oe' AND NOT quotation AND cv = 'vendor'|   if $form->{onorder};
451
  push @bsooqr_tokens, q|module = 'oe' AND     quotation AND cv = 'customer'| if $form->{quoted};
452
  push @bsooqr_tokens, q|module = 'oe' AND     quotation AND cv = 'vendor'|   if $form->{rfq};
449
  push @bsooqr_tokens, q|module = 'oe' AND record_type = 'sales_order'|       if $form->{ordered};
450
  push @bsooqr_tokens, q|module = 'oe' AND record_type = 'purchase_order'|    if $form->{onorder};
451
  push @bsooqr_tokens, q|module = 'oe' AND record_type = 'sales_quotation'|   if $form->{quoted};
452
  push @bsooqr_tokens, q|module = 'oe' AND record_type = 'request_quotation'| if $form->{rfq};
453 453
  push @where_tokens, join ' OR ', map { "($_)" } @bsooqr_tokens              if $bsooqr;
454 454

  
455 455
  $joins_needed{partsgroup}  = 1;

Auch abrufbar als: Unified diff