Revision f0ddfbfe
Von Moritz Bunkus vor etwa 3 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
23 | 23 |
use SL::DB::Printer; |
24 | 24 |
use SL::DB::Language; |
25 | 25 |
use SL::DB::RecordLink; |
26 |
use SL::DB::RequirementSpec; |
|
26 | 27 |
use SL::DB::Shipto; |
27 | 28 |
use SL::DB::Translation; |
28 | 29 |
|
... | ... | |
1678 | 1679 |
# link records |
1679 | 1680 |
if ($::form->{converted_from_oe_id}) { |
1680 | 1681 |
my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; |
1682 |
|
|
1681 | 1683 |
foreach my $converted_from_oe_id (@converted_from_oe_ids) { |
1682 | 1684 |
my $src = SL::DB::Order->new(id => $converted_from_oe_id)->load; |
1683 | 1685 |
$src->update_attributes(closed => 1) if $src->type =~ /_quotation$/; |
... | ... | |
1696 | 1698 |
$idx++; |
1697 | 1699 |
} |
1698 | 1700 |
} |
1701 |
|
|
1702 |
$self->link_requirement_specs_linking_to_created_from_objects(@converted_from_oe_ids); |
|
1699 | 1703 |
} |
1700 | 1704 |
|
1701 | 1705 |
$self->save_history('SAVED'); |
... | ... | |
2309 | 2313 |
return @errors; |
2310 | 2314 |
} |
2311 | 2315 |
|
2316 |
sub link_requirement_specs_linking_to_created_from_objects { |
|
2317 |
my ($self, @converted_from_oe_ids) = @_; |
|
2318 |
|
|
2319 |
return unless @converted_from_oe_ids; |
|
2320 |
|
|
2321 |
my $rs_orders = SL::DB::Manager::RequirementSpecOrder->get_all(where => [ order_id => \@converted_from_oe_ids ]); |
|
2322 |
foreach my $rs_order (@{ $rs_orders }) { |
|
2323 |
SL::DB::RequirementSpecOrder->new( |
|
2324 |
order_id => $self->order->id, |
|
2325 |
requirement_spec_id => $rs_order->requirement_spec_id, |
|
2326 |
version_id => $rs_order->version_id, |
|
2327 |
)->save; |
|
2328 |
} |
|
2329 |
} |
|
2330 |
|
|
2312 | 2331 |
1; |
2313 | 2332 |
|
2314 | 2333 |
__END__ |
Auch abrufbar als: Unified diff
Pflichtenhefte: bei Pflichtenheft → Angebot → Auftrag auch PH mit Auftrag verknüpfen