Revision ef24ff5a
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
32 | 32 |
use SL::DB::TransferType; |
33 | 33 |
use SL::DB::ValidityToken; |
34 | 34 |
use SL::DB::Warehouse; |
35 |
use SL::Model::Record; |
|
35 | 36 |
|
36 | 37 |
use SL::Helper::CreatePDF qw(:all); |
37 | 38 |
use SL::Helper::PrintOptions; |
... | ... | |
103 | 104 |
|
104 | 105 |
my $order = SL::DB::Order->new(id => $self->{converted_from_oe_id})->load; |
105 | 106 |
|
106 |
$self->order(SL::DB::DeliveryOrder->new_from($order, type => $::form->{type})); |
|
107 |
my $target_type = $::form->{type}; |
|
108 |
my $delivery_order = SL::Model::Record->new_from_workflow($order, $target_type); |
|
109 |
$self->order($delivery_order); |
|
107 | 110 |
|
108 | 111 |
$self->action_add; |
109 | 112 |
} |
... | ... | |
112 | 115 |
my ($self) = @_; |
113 | 116 |
|
114 | 117 |
my $reclamation = SL::DB::Reclamation->new(id => $::form->{from_id})->load; |
115 |
my $delivery_order = SL::DB::DeliveryOrder->new_from($reclamation); |
|
118 |
my $target_type = $reclamation->is_sales ? 'rma_delivery_order' |
|
119 |
: 'supplier_delivery_order'; |
|
120 |
my $delivery_order = SL::Model::Record->new_from_workflow($reclamation, $target_type); |
|
116 | 121 |
$self->{converted_from_reclamation_id} = $::form->{from_id}; |
117 | 122 |
$self->order($delivery_order); |
118 | 123 |
|
... | ... | |
1751 | 1756 |
|
1752 | 1757 |
my $destination_type = $self->type_data->workflow("to_quotation_type"); |
1753 | 1758 |
|
1754 |
$self->order(SL::DB::DeliveryOrder->new_from($self->order, destination_type => $destination_type)); |
|
1759 |
my $delivery_order = SL::Model::Record->new_from_workflow($self->order, $destination_type, {}); |
|
1760 |
$self->order($delivery_order); |
|
1755 | 1761 |
$self->{converted_from_oe_id} = delete $::form->{id}; |
1756 | 1762 |
|
1757 | 1763 |
# set item ids to new fake id, to identify them as new items |
... | ... | |
1800 | 1806 |
$custom_shipto = $self->order->shipto->clone('SL::DB::DeliveryOrder'); |
1801 | 1807 |
} |
1802 | 1808 |
|
1803 |
$self->order(SL::DB::DeliveryOrder->new_from($self->order, destination_type => $destination_type)); |
|
1809 |
my $delivery_order = SL::Model::Record->new_from_workflow($self->order, $destination_type, {}); |
|
1810 |
$self->order($delivery_order); |
|
1804 | 1811 |
$self->{converted_from_oe_id} = delete $::form->{id}; |
1805 | 1812 |
|
1806 | 1813 |
# set item ids to new fake id, to identify them as new items |
Auch abrufbar als: Unified diff
Model::Record: new_from_workflow implementiert