Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f0ad2143

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

  • ID f0ad214336550a429014c0e496511dada80be935
  • Vorgänger fcf445e5
  • Nachfolger 38f974a2

Weitere Positionen verknüpft

Alle Workflows von Angebot bis Rechnung im Einkauf und Verkauf umgesetzt

Offen: Gutschrift und Rückwartsverknüpfungen

Unterschiede anzeigen:

SL/DO.pm
404 404
                                name_postfix => "_$i",
405 405
                                dbh          => $dbh);
406 406
    # link order items with doi
407
    if ($form->{"converted_from_order_orderitems_id_$i"}) {
407
    if ($form->{"converted_from_orderitems_id_$i"}) {
408 408
      RecordLinks->create_links('dbh'        => $dbh,
409 409
                                'mode'       => 'ids',
410 410
                                'from_table' => 'orderitems',
411
                                'from_ids'   => $form->{"converted_from_order_orderitems_id_$i"},
411
                                'from_ids'   => $form->{"converted_from_orderitems_id_$i"},
412 412
                                'to_table'   => 'delivery_order_items',
413 413
                                'to_id'      =>  $form->{"delivery_order_items_id_$i"},
414 414
      );
415
      delete $form->{"converted_from_order_orderitems_id_$i"};
415
      delete $form->{"converted_from_orderitems_id_$i"};
416 416
    }
417 417
  }
418 418

  
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"};
431
    }
410 432
  }
411 433

  
412 434
  $h_item_unit->finish();
SL/IS.pm
796 796
                                  name_postfix => "_$i",
797 797
                                  dbh          => $dbh);
798 798
    }
799
    # link oe items with invoice
800
    if ($form->{"converted_from_orderitems_id_$i"}) {
801
      RecordLinks->create_links('dbh'        => $dbh,
802
                                'mode'       => 'ids',
803
                                'from_table' => 'orderitems',
804
                                'from_ids'   => $form->{"converted_from_orderitems_id_$i"},
805
                                'to_table'   => 'invoice',
806
                                'to_id'      => $form->{"invoice_id_$i"},
807
      );
808
      delete $form->{"converted_from_orderitems_id_$i"};
809
    }
810
    # link doi items with invoice
811
    if ($form->{"converted_from_delivery_order_items_id_$i"}) {
812
      RecordLinks->create_links('dbh'        => $dbh,
813
                                'mode'       => 'ids',
814
                                'from_table' => 'delivery_order_items',
815
                                'from_ids'   => $form->{"converted_from_delivery_order_items_id_$i"},
816
                                'to_table'   => 'invoice',
817
                                'to_id'      => $form->{"invoice_id_$i"},
818
      );
819
      delete $form->{"converted_from_delivery_order_items_id_$i"};
820
    }
799 821
  }
800 822

  
801 823
  # total payments, don't move we need it here
bin/mozilla/do.pl
785 785
    }
786 786
    map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor);
787 787
    $form->{"donumber_$i"} = $form->{donumber};
788
    $form->{"converted_from_delivery_order_items_id_$i"} = delete $form->{"delivery_order_items_id_$i"};
788 789
  }
789 790

  
790 791
  $form->{type} = "invoice";
......
922 923
    $ref->{reqdate} ||= $ref->{dord_transdate}; # copy transdates into each invoice row
923 924
    map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{ $ref };
924 925
    map { $form->{"${_}_$form->{rowcount}"} = $form->format_amount(\%myconfig, $ref->{$_}) } qw(qty sellprice lastcost);
926
    $form->{"converted_from_delivery_order_items_id_$form->{rowcount}"} = delete $form->{"delivery_order_items_id_$form->{rowcount}"};
925 927

  
926 928
    if ($vc_discount){ # falls wir einen Lieferanten/Kundenrabatt haben
927 929
      # und keinen anderen discount wert an $i ...
bin/mozilla/io.pl
442 442
      push @hidden_vars, qw(orderitems_id converted_from_quotation_orderitems_id);
443 443
    }
444 444
    if ($is_invoice) {
445
      push @hidden_vars, qw(invoice_id converted_from_quotation_orderitems_id converted_from_order_orderitems_id
446
                            converted_from_delivery_order_items_id);
445
      push @hidden_vars, qw(invoice_id converted_from_orderitems_id converted_from_delivery_order_items_id);
447 446
    }
448 447
    if ($::form->{type} =~ /credit_note/) {
449 448
      push @hidden_vars, qw(invoice_id converted_from_invoice_id);
......
452 451
      map { $form->{"${_}_${i}"} = $form->format_amount(\%myconfig, $form->{"${_}_${i}"}) } qw(sellprice discount lastcost);
453 452
      push @hidden_vars, grep { defined $form->{"${_}_${i}"} } qw(sellprice discount not_discountable price_factor_id lastcost);
454 453
      push @hidden_vars, "stock_${stock_in_out}_sum_qty", "stock_${stock_in_out}";
455
      push @hidden_vars, qw(delivery_order_items_id converted_from_order_orderitems_id);
454
      push @hidden_vars, qw(delivery_order_items_id converted_from_orderitems_id);
456 455
    }
457 456

  
458 457
    my @HIDDENS = map { value => $_}, (
......
744 743
                stock_out stock_in has_sernumber reqdate orderitems_id
745 744
                active_price_source active_discount_source delivery_order_items_id
746 745
                invoice_id converted_from_quotation_orderitems_id
747
                converted_from_order_orderitems_id converted_from_delivery_order_items_id);
746
                converted_from_orderitems_id converted_from_delivery_order_items_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
1423 1423
    for (qw(ship qty sellprice listprice basefactor)) {
1424 1424
      $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"};
1425 1425
    }
1426
    $form->{"converted_from_orderitems_id_$i"} = delete $form->{"orderitems_id_$i"};
1426 1427
  }
1427 1428

  
1428 1429
  my ($buysell, $orddate, $exchangerate);
......
1472 1473

  
1473 1474
  # bo creates the id, reset it
1474 1475
  map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued);
1475
  delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
1476 1476
  $form->{ $form->{vc} } =~ s/--.*//g;
1477 1477
  $form->{type} = "invoice";
1478 1478

  
......
1896 1896

  
1897 1897
  for my $i (1 .. $form->{rowcount}) {
1898 1898
    map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice lastcost basefactor discount);
1899
    $form->{"converted_from_order_orderitems_id_$i"} = $form->{"orderitems_id_$i"};
1900
    delete $form->{"orderitems_id_$i"}; # even if they don't exist in form. cvars checks them before display_row
1899
    $form->{"converted_from_orderitems_id_$i"} = delete $form->{"orderitems_id_$i"};
1901 1900
  }
1902 1901

  
1903 1902
  my %old_values = map { $_ => $form->{$_} } qw(customer_id oldcustomer customer vendor_id oldvendor vendor shipto_id);

Auch abrufbar als: Unified diff