Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e80aa4c8

Von Sven Schöling vor mehr als 7 Jahren hinzugefügt

  • ID e80aa4c85d2e548d1c4e11bdf598e42b1f367a7f
  • Vorgänger ecb95993
  • Nachfolger 78c1cb32

io::_update_ship: SL::Helper::ShippedQty benutzen

Unterschiede anzeigen:

bin/mozilla/io.pl
63 63
use SL::Helper::CreatePDF;
64 64
use SL::Helper::Flash;
65 65
use SL::Helper::PrintOptions;
66
use SL::Helper::ShippedQty;
66 67

  
67 68
require "bin/mozilla/common.pl";
68 69

  
......
1669 1670
}
1670 1671

  
1671 1672
sub _update_ship {
1672
  $main::lxdebug->enter_sub();
1673

  
1674
  my $form     = $main::form;
1675
  my %myconfig = %main::myconfig;
1676

  
1677
  if (!$form->{ordnumber} || !$form->{id}) {
1678
    map { $form->{"ship_$_"} = 0 } (1..$form->{rowcount});
1679
    $main::lxdebug->leave_sub();
1680
    return;
1681
  }
1682

  
1683
  my $all_units = AM->retrieve_all_units();
1684

  
1685
  my %ship = DO->get_shipped_qty('oe_id' => $form->{id});
1673
  my $helper = SL::Helper::ShippedQty->new->calculate($::form->{id});
1686 1674

  
1687
  foreach my $i (1..$form->{rowcount}) {
1688
    next unless ($form->{"id_${i}"});
1689

  
1690
    $form->{"ship_$i"} = 0;
1691

  
1692
    my $ship_entry = $ship{$i};
1693

  
1694
    next if (!$ship_entry || ($ship_entry->{qty_ordered} <= 0));
1695

  
1696
    my $rowqty = $ship_entry->{qty_ordered} - $ship_entry->{qty_notdelivered};
1697
    $rowqty   *= $all_units->{$form->{"unit_$i"}}->{factor} /
1698
                 $all_units->{$form->{"partunit_$i"}}->{factor} if !$form->{simple_save};
1699
    $form->{"ship_$i"}  = $rowqty;
1675
  for my $i (1..$::form->{rowcount}) {
1676
    if (my $oid = $::form->{"orderitems_id_$i"}) {
1677
      $::form->{"ship_$i"} = $helper->shipped_qty->{$oid};
1678
    }
1700 1679
  }
1701

  
1702
  $main::lxdebug->leave_sub();
1703 1680
}
1704 1681

  
1705 1682
sub _update_custom_variables {

Auch abrufbar als: Unified diff