Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2f9a5220

Von Jan Büren vor fast 10 Jahren hinzugefügt

  • ID 2f9a52209e4bea503cebf447e498b4a5848eb02c
  • Vorgänger 6934a717
  • Nachfolger 942291e4

Aufräumarbeiten verknüpfte Positionen

- converted_from_quotation_orderitems_id entfernt, da es keine
tabelle quotation_orderitems gibt und die variable langfristig nur
verwirrend in der form ist.
- IR.pm auch auf foreach $table_name umgestellt

Unterschiede anzeigen:

SL/IR.pm
407 407
                                name_prefix  => 'ic_',
408 408
                                name_postfix => "_$i",
409 409
                                dbh          => $dbh);
410
    # link oe items with invoice
411
    if ($form->{"converted_from_orderitems_id_$i"}) {
412
      RecordLinks->create_links('dbh'        => $dbh,
413
                                'mode'       => 'ids',
414
                                'from_table' => 'orderitems',
415
                                'from_ids'   => $form->{"converted_from_orderitems_id_$i"},
416
                                'to_table'   => 'invoice',
417
                                'to_id'      => $form->{"invoice_id_$i"},
418
      );
419
      delete $form->{"converted_from_orderitems_id_$i"};
420
    }
421
    # link doi items with invoice
422
    if ($form->{"converted_from_delivery_order_items_id_$i"}) {
423
      RecordLinks->create_links('dbh'        => $dbh,
424
                                'mode'       => 'ids',
425
                                'from_table' => 'delivery_order_items',
426
                                'from_ids'   => $form->{"converted_from_delivery_order_items_id_$i"},
427
                                'to_table'   => 'invoice',
428
                                'to_id'      => $form->{"invoice_id_$i"},
429
      );
430
      delete $form->{"converted_from_delivery_order_items_id_$i"};
410
    # link previous items with invoice items See IS.pm (no credit note -> no invoice item)
411
    foreach (qw(delivery_order_items orderitems)) {
412
      if ($form->{"converted_from_${_}_id_$i"}) {
413
        RecordLinks->create_links('dbh'        => $dbh,
414
                                  'mode'       => 'ids',
415
                                  'from_table' => $_,
416
                                  'from_ids'   => $form->{"converted_from_${_}_id_$i"},
417
                                  'to_table'   => 'invoice',
418
                                  'to_id'      => $form->{"invoice_id_$i"},
419
        );
420
        delete $form->{"converted_from_${_}_id_$i"};
421
      }
431 422
    }
432 423
  }
433 424

  
SL/OE.pm
579 579
                                  name_postfix => "_$i",
580 580
                                  dbh          => $dbh);
581 581
      # link previous items with orderitems
582
      foreach (qw(quotation_orderitems orderitems invoice)) {
582
      foreach (qw(orderitems invoice)) {
583 583
        if ($form->{"converted_from_${_}_id_$i"}) {
584
          my $table = $_;
585
          $table    = 'orderitems' if $table eq 'quotation_orderitems';
586 584
          RecordLinks->create_links('dbh'        => $dbh,
587 585
                                    'mode'       => 'ids',
588
                                    'from_table' => $table,
586
                                    'from_table' => $_,
589 587
                                    'from_ids'   => $form->{"converted_from_${_}_id_$i"},
590 588
                                    'to_table'   => 'orderitems',
591 589
                                    'to_id'      => $orderitems_id,
bin/mozilla/io.pl
439 439
      push @hidden_vars, qw(orderitems_id converted_from_orderitems_id);
440 440
    }
441 441
    if ($is_s_p_order) {
442
      push @hidden_vars, qw(orderitems_id converted_from_quotation_orderitems_id converted_from_invoice_id);
442
      push @hidden_vars, qw(orderitems_id converted_from_orderitems_id converted_from_invoice_id);
443 443
    }
444 444
    if ($is_invoice) {
445 445
      push @hidden_vars, qw(invoice_id converted_from_orderitems_id converted_from_delivery_order_items_id);
......
742 742
                marge_price_factor lastcost price_factor_id partnotes
743 743
                stock_out stock_in has_sernumber reqdate orderitems_id
744 744
                active_price_source active_discount_source delivery_order_items_id
745
                invoice_id converted_from_quotation_orderitems_id
746
                converted_from_orderitems_id converted_from_delivery_order_items_id
747
                converted_from_invoice_id);
745
                invoice_id converted_from_orderitems_id
746
                converted_from_delivery_order_items_id converted_from_invoice_id);
748 747

  
749 748
  my $ic_cvar_configs = CVar->get_configs(module => 'IC');
750 749
  push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
bin/mozilla/oe.pl
1821 1821
  # reset
1822 1822
  map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered ordnumber);
1823 1823
  # this converted variable is also used for sales_order to purchase order and vice versa
1824
  $form->{"converted_from_quotation_orderitems_id_$_"} = delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
1824
  $form->{"converted_from_orderitems_id_$_"} = delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
1825 1825

  
1826 1826
  # if purchase_order was generated from sales_order, use  lastcost_$i as sellprice_$i
1827 1827
  # also reset discounts

Auch abrufbar als: Unified diff