Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6f34b2db

Von Bernd Bleßmann vor 7 Monaten hinzugefügt

Lieferschein-Controller: Kommentar ergänzt; Kosmetik

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
130 130
  }
131 131

  
132 132
  my $record = SL::Model::Record->get_record($from_type, $from_id);
133

  
134
  # If we are coming from an order workflow, only consider not delivered
135
  # quantities.
133 136
  if (ref $record eq 'SL::DB::Order') {
134 137
    # Calculate shipped qtys here to prevent calling calculate for every item
135 138
    # via the items method.
136 139
    SL::Helper::ShippedQty->new->calculate($record)->write_to(\@{$record->items});
140

  
137 141
    my @items_with_not_delivered_qty =
138 142
      grep {$_->qty > 0}
139
      map {$_->qty($_->qty - $_->shipped_qty); $_}
143
      map  {$_->qty($_->qty - $_->shipped_qty); $_}
140 144
      @{$record->items_sorted};
145

  
141 146
    $flags{items} = \@items_with_not_delivered_qty;
142 147
  }
148

  
143 149
  my $delivery_order = SL::Model::Record->new_from_workflow($record, $self->type, %flags);
144 150
  $self->order($delivery_order);
145 151

  

Auch abrufbar als: Unified diff