Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fece0d1b

Von Moritz Bunkus vor fast 2 Jahren hinzugefügt

  • ID fece0d1bf7faaf2335ce487638ea8217767f5053
  • Vorgänger babc3c0a
  • Nachfolger 057d4622

Lieferantenauftrag→Einkaufslieferschein: Lieferantenartikelnummer anzeigen

Unterschiede anzeigen:

SL/Controller/Order.pm
44 44

  
45 45
use List::Util qw(first sum0);
46 46
use List::UtilsBy qw(sort_by uniq_by);
47
use List::MoreUtils qw(any none pairwise first_index);
47
use List::MoreUtils qw(uniq any none pairwise first_index);
48 48
use English qw(-no_match_vars);
49 49
use File::Spec;
50 50
use Cwd;
......
1546 1546
  $self->redirect_to(@redirect_params);
1547 1547
}
1548 1548

  
1549
sub action_show_conversion_to_purchase_delivery_order_item_selection {
1550
  my ($self) = @_;
1551

  
1552
  my @items = @{ $::form->{order}->{orderitems} // [] };
1553

  
1554
  if (@items) {
1555
    my @part_ids          = uniq map { $_->{parts_id} } @items;
1556
    my %parts_by_id       = map { ($_->id => $_) } @{ SL::DB::Manager::Part->get_all(where => [ id => \@part_ids ]) };
1557
    my %make_models_by_id = map { ($_->parts_id => $_->model) } @{
1558
      SL::DB::Manager::MakeModel->get_all(
1559
        where => [
1560
          parts_id => \@part_ids,
1561
          make     => $::form->{order}->{vendor_id},
1562
        ])
1563
    };
1564

  
1565
    foreach my $item (@items) {
1566
      $item->{partnumber}        = $parts_by_id{ $item->{parts_id} }->partnumber;
1567
      $item->{vendor_partnumber} = $make_models_by_id{ $item->{parts_id} };
1568
    }
1569
  }
1570

  
1571
  $self->render(
1572
    'order/tabs/_purchase_delivery_order_item_selection',
1573
    { layout => 0 },
1574
    ITEMS => \@items,
1575
  );
1576
}
1577

  
1549 1578
sub js_load_second_row {
1550 1579
  my ($self, $item, $item_id, $do_parse) = @_;
1551 1580

  

Auch abrufbar als: Unified diff