Revision cfb00178
Von Sven Schöling vor etwa 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
2197 | 2197 |
$self->order->add_phone_notes($phone_note) if $is_new; |
2198 | 2198 |
} |
2199 | 2199 |
|
2200 |
my @converted_from_oe_ids; |
|
2201 |
if ($::form->{converted_from_oe_id}) { |
|
2202 |
@converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; |
|
2203 |
set_record_link_conversions( |
|
2204 |
$self->order, |
|
2205 |
'SL::DB::Order' => \@converted_from_oe_ids, |
|
2206 |
'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids}, |
|
2207 |
); |
|
2208 |
} |
|
2209 |
if ($::form->{converted_from_reclamation_id}) { |
|
2210 |
my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id}; |
|
2211 |
set_record_links_conversions( |
|
2212 |
$self->order, |
|
2213 |
'SL::DB::Reclamation' => \@converted_from_reclamation_ids, |
|
2214 |
'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids}, |
|
2215 |
); |
|
2216 |
} |
|
2217 |
|
|
2200 | 2218 |
my $is_new = !$self->order->id; |
2201 | 2219 |
$db->with_transaction(sub { |
2202 | 2220 |
my $validity_token; |
... | ... | |
2221 | 2239 |
SL::DB::OrderVersion->new(oe_id => $self->order->id, version => 1)->save unless scalar @{ $self->order->order_version }; |
2222 | 2240 |
|
2223 | 2241 |
# link records |
2224 |
if ($::form->{converted_from_oe_id}) { |
|
2225 |
my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; |
|
2226 |
set_record_link_conversions( |
|
2227 |
$self->order, |
|
2228 |
'SL::DB::Order' => \@converted_from_oe_ids, |
|
2229 |
'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids}, |
|
2230 |
); |
|
2231 |
|
|
2242 |
if (@converted_from_oe_ids) { |
|
2232 | 2243 |
$self->link_requirement_specs_linking_to_created_from_objects(@converted_from_oe_ids); |
2233 | 2244 |
} |
2234 |
if ($::form->{converted_from_reclamation_id}) { |
|
2235 |
my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id}; |
|
2236 |
set_record_links_conversions( |
|
2237 |
$self->order, |
|
2238 |
'SL::DB::Reclamation' => \@converted_from_reclamation_ids, |
|
2239 |
'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids}, |
|
2240 |
); |
|
2241 |
} |
|
2242 | 2245 |
|
2243 | 2246 |
$self->set_project_in_linked_requirement_specs if $self->order->globalproject_id; |
2244 | 2247 |
|
Auch abrufbar als: Unified diff
RecordLink: in controller vor dem Speichern und ausserhalb der TX behandeln