Revision 82ef3a72
Von Sven Schöling vor fast 3 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
1040 | 1040 |
return $self->js->flash("error", t8('The parts for this order have already been transferred'))->render; |
1041 | 1041 |
} |
1042 | 1042 |
|
1043 |
my $inout = $self->type_data->properties('transfer'); |
|
1044 |
|
|
1043 | 1045 |
my $errors = $self->save; |
1044 | 1046 |
|
1045 | 1047 |
if (@$errors) { |
... | ... | |
1050 | 1052 |
my $order = $self->order; |
1051 | 1053 |
|
1052 | 1054 |
# TODO move to type data |
1053 |
my $trans_type = $self->type_data->properties('transfer') eq 'in'
|
|
1055 |
my $trans_type = $inout eq 'in'
|
|
1054 | 1056 |
? SL::DB::Manager::TransferType->find_by(direction => "id", description => "stock") |
1055 | 1057 |
: SL::DB::Manager::TransferType->find_by(direction => "out", description => "shipped"); |
1056 | 1058 |
|
... | ... | |
1060 | 1062 |
for my $stock (@{ $item->delivery_order_stock_entries }) { |
1061 | 1063 |
my $transfer = SL::DB::Inventory->new_from($stock); |
1062 | 1064 |
$transfer->trans_type($trans_type); |
1065 |
$transfer->qty($transfer->qty * -1) if $inout eq 'out'; |
|
1063 | 1066 |
|
1064 | 1067 |
push @transfer_requests, $transfer if defined $transfer->qty && $transfer->qty != 0; |
1065 | 1068 |
}; |
Auch abrufbar als: Unified diff
DeliveryOrder: in/out weiche in transfer_stock