Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 37fd9da9

Von Sven Schöling vor etwa 3 Jahren hinzugefügt

  • ID 37fd9da9053960cb1c8ee745a3b8c745d9b17b7d
  • Vorgänger 49d361ce
  • Nachfolger 764b7109

DeliveryOrder: transfer_inventory fixes

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
1059 1059
    $self->js->flash("error", t8("No stock to transfer"))->render;
1060 1060
  }
1061 1061

  
1062
  SL::DB->with_transaction(sub {
1062
  SL::DB->client->with_transaction(sub {
1063 1063
    $_->save for @transfer_requests;
1064
    $self->order->update_attributes(deliverd => 1);
1064
    $self->order->update_attributes(delivered => 1);
1065 1065
  });
1066 1066

  
1067 1067
  $self->js->flash("info", t8("Stock transfered"))->render;
SL/DB/DeliveryOrderItem.pm
51 51
sub effective_project {
52 52
  my ($self) = @_;
53 53

  
54
  $self->project // $self->delivery_order->project;
54
  $self->project // $self->delivery_order->globalproject;
55 55
}
56 56

  
57 57
__END__
SL/DB/Inventory.pm
33 33
}
34 34

  
35 35
sub new_from_delivery_order_stock {
36
  my ($stock) = @_;
36
  my ($class, $stock) = @_;
37 37

  
38 38
  my $project = $stock->delivery_order_item->effective_project;
39 39

  
40
  return __PACKAGE__->new(
40
  return $class->new(
41 41
    delivery_order_items_stock_id => $stock->id,
42 42
    parts_id                      => $stock->delivery_order_item->parts_id,
43
    qty                           => $stock->unit->convert_to($stock->qty => $stock->delivery_order_item->part->unit_obj),
44
    unit                          => $stock->delivery_order_item->part->unit_obj,
43
    qty                           => $stock->unit_obj->convert_to($stock->qty => $stock->delivery_order_item->part->unit_obj),
45 44
    warehouse_id                  => $stock->warehouse_id,
46 45
    bin_id                        => $stock->bin_id,
47 46
    chargenumber                  => $stock->chargenumber,

Auch abrufbar als: Unified diff