Revision d447f948
Von Werner Hahn vor mehr als 2 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
|
||
require SL::DB::Reclamation;
|
||
my $reclamation = SL::DB::Reclamation->new(id => $::form->{from_id})->load;
|
||
my ($delivery_order, $error) = $reclamation->convert_to_delivery_order();
|
||
my $type = $reclamation->type eq 'sales_reclamation' ? 'rma_delivery_order' : 'supplier_delivery_order';
|
||
my ($delivery_order, $error) = $reclamation->convert_to_delivery_order(type => $type);
|
||
if($error) {
|
||
croak("Error while converting: " . $error);
|
||
}
|
||
... | ... | |
|
||
# TODO move to type data
|
||
my $trans_type = $inout eq 'in'
|
||
? SL::DB::Manager::TransferType->find_by(direction => "id", description => "stock")
|
||
? SL::DB::Manager::TransferType->find_by(direction => "in", description => "stock")
|
||
: SL::DB::Manager::TransferType->find_by(direction => "out", description => "shipped");
|
||
|
||
|
||
my @transfer_requests;
|
||
|
||
for my $item (@{ $order->items_sorted }) {
|
||
... | ... | |
my $transfer = SL::DB::Inventory->new_from($stock);
|
||
$transfer->trans_type($trans_type);
|
||
$transfer->qty($transfer->qty * -1) if $inout eq 'out';
|
||
$transfer->qty($transfer->qty * 1) if $inout eq 'in';
|
||
|
||
push @transfer_requests, $transfer if defined $transfer->qty && $transfer->qty != 0;
|
||
};
|
SL/Presenter/DeliveryOrder.pm | ||
---|---|---|
croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
|
||
|
||
my $text = join '', (
|
||
$params{no_link} ? '' : '<a href="contoller.pl?action=DeliveryOrder/edit&type=' . $type . '&id=' . escape($delivery_order->id) . '">',
|
||
$params{no_link} ? '' : '<a href="controller.pl?action=DeliveryOrder/edit&type=' . $type . '&id=' . escape($delivery_order->id) . '">',
|
||
escape($delivery_order->donumber),
|
||
$params{no_link} ? '' : '</a>',
|
||
);
|
Auch abrufbar als: Unified diff
ReclamationsController: Workflow Lieferschein neuer DeliveryController