Revision b0bd83ba
Von Werner Hahn vor fast 2 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
105 | 105 |
|
106 | 106 |
require SL::DB::Reclamation; |
107 | 107 |
my $reclamation = SL::DB::Reclamation->new(id => $::form->{from_id})->load; |
108 |
my ($delivery_order, $error) = $reclamation->convert_to_delivery_order(); |
|
108 |
my $type = $reclamation->type eq 'sales_reclamation' ? 'rma_delivery_order' : 'supplier_delivery_order'; |
|
109 |
my ($delivery_order, $error) = $reclamation->convert_to_delivery_order(type => $type); |
|
109 | 110 |
if($error) { |
110 | 111 |
croak("Error while converting: " . $error); |
111 | 112 |
} |
... | ... | |
1075 | 1076 |
|
1076 | 1077 |
# TODO move to type data |
1077 | 1078 |
my $trans_type = $inout eq 'in' |
1078 |
? SL::DB::Manager::TransferType->find_by(direction => "id", description => "stock")
|
|
1079 |
? SL::DB::Manager::TransferType->find_by(direction => "in", description => "stock")
|
|
1079 | 1080 |
: SL::DB::Manager::TransferType->find_by(direction => "out", description => "shipped"); |
1080 | 1081 |
|
1082 |
|
|
1081 | 1083 |
my @transfer_requests; |
1082 | 1084 |
|
1083 | 1085 |
for my $item (@{ $order->items_sorted }) { |
... | ... | |
1085 | 1087 |
my $transfer = SL::DB::Inventory->new_from($stock); |
1086 | 1088 |
$transfer->trans_type($trans_type); |
1087 | 1089 |
$transfer->qty($transfer->qty * -1) if $inout eq 'out'; |
1090 |
$transfer->qty($transfer->qty * 1) if $inout eq 'in'; |
|
1088 | 1091 |
|
1089 | 1092 |
push @transfer_requests, $transfer if defined $transfer->qty && $transfer->qty != 0; |
1090 | 1093 |
}; |
Auch abrufbar als: Unified diff
ReclamationsController: Workflow Lieferschein neuer DeliveryController