Revision 98c122d1
Von Tamino Steinert vor etwa 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 |
|
... | ... | |
1755 | 1760 |
|
1756 | 1761 |
my $destination_type = $self->type_data->workflow("to_quotation_type"); |
1757 | 1762 |
|
1758 |
$self->order(SL::DB::DeliveryOrder->new_from($self->order, destination_type => $destination_type)); |
|
1763 |
my $delivery_order = SL::Model::Record->new_from_workflow($self->order, $destination_type, {}); |
|
1764 |
$self->order($delivery_order); |
|
1759 | 1765 |
$self->{converted_from_oe_id} = delete $::form->{id}; |
1760 | 1766 |
|
1761 | 1767 |
# set item ids to new fake id, to identify them as new items |
... | ... | |
1804 | 1810 |
$custom_shipto = $self->order->shipto->clone('SL::DB::DeliveryOrder'); |
1805 | 1811 |
} |
1806 | 1812 |
|
1807 |
$self->order(SL::DB::DeliveryOrder->new_from($self->order, destination_type => $destination_type)); |
|
1813 |
my $delivery_order = SL::Model::Record->new_from_workflow($self->order, $destination_type, {}); |
|
1814 |
$self->order($delivery_order); |
|
1808 | 1815 |
$self->{converted_from_oe_id} = delete $::form->{id}; |
1809 | 1816 |
|
1810 | 1817 |
# set item ids to new fake id, to identify them as new items |
Auch abrufbar als: Unified diff
Model::Record: new_from_workflow implementiert