Revision 78dd0bdc
Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
32 | 32 |
use SL::DB::Shipto; |
33 | 33 |
use SL::DB::Translation; |
34 | 34 |
use SL::DB::ValidityToken; |
35 |
use SL::DB::Helper::RecordLink qw(set_record_link_conversions); |
|
35 |
use SL::DB::Helper::RecordLink qw(set_record_link_conversions RECORD_ID RECORD_ITEM_ID);
|
|
36 | 36 |
use SL::DB::Helper::TypeDataProxy; |
37 | 37 |
use SL::Model::Record; |
38 | 38 |
use SL::DB::Order::TypeData qw(:types); |
... | ... | |
865 | 865 |
$custom_shipto = $self->order->shipto->clone('SL::DB::Order'); |
866 | 866 |
} |
867 | 867 |
|
868 |
$self->order(SL::DB::Order->new_from($self->order, destination_type => $destination_type)); |
|
868 |
my $no_linked_records = (any { $destination_type eq $_ } (SALES_QUOTATION_TYPE(), REQUEST_QUOTATION_TYPE())) |
|
869 |
&& $from_side eq $to_side; |
|
869 | 870 |
|
870 |
# no linked records to quotations from the same side (sales -> sales or purchase -> purchase)
|
|
871 |
if ( (any { $destination_type eq $_ } (SALES_QUOTATION_TYPE(), REQUEST_QUOTATION_TYPE())) |
|
872 |
&& $from_side eq $to_side) {
|
|
873 |
delete $::form->{id}; |
|
874 |
delete $::form->{$_} for qw(converted_from_oe_id converted_from_orderitems_ids);
|
|
875 |
} else {
|
|
876 |
$self->{converted_from_oe_id} = delete $::form->{id};
|
|
871 |
$self->order(SL::Model::Record->new_from_workflow($self->order, $destination_type, no_linked_records => $no_linked_records));
|
|
872 |
|
|
873 |
delete $::form->{id};
|
|
874 |
|
|
875 |
if (!$no_linked_records) {
|
|
876 |
$self->{converted_from_oe_id} = $self->order->{ RECORD_ID() };
|
|
877 |
$_ ->{converted_from_orderitems_id} = $_ ->{ RECORD_ITEM_ID() } for @{ $self->order->items_sorted };
|
|
877 | 878 |
} |
878 | 879 |
|
879 | 880 |
# set item ids to new fake id, to identify them as new items |
Auch abrufbar als: Unified diff
Order-Controller: Workflow zu Angebot/Auftrag mit S:M:R->new_from_workflow
Und converted_from_... gefixt.