Revision ff3ae226
Von Sven Schöling vor etwa 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
1646 | 1646 |
return [t8('The action you\'ve chosen has not been executed because the document does not contain any item yet.')]; |
1647 | 1647 |
} |
1648 | 1648 |
|
1649 |
# link records |
|
1650 |
if ($::form->{converted_from_oe_id}) { |
|
1651 |
my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; |
|
1652 |
set_record_link_conversions( |
|
1653 |
$self->order, |
|
1654 |
'SL::DB::Order' => \@converted_from_oe_ids, |
|
1655 |
'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids}, |
|
1656 |
); |
|
1657 |
} |
|
1658 |
if ($::form->{converted_from_reclamation_id}) { |
|
1659 |
my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id}; |
|
1660 |
set_record_link_conversions( |
|
1661 |
$self->order, |
|
1662 |
'SL::DB::Reclamation' => \@converted_from_reclamation_ids, |
|
1663 |
'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids}, |
|
1664 |
); |
|
1665 |
} |
|
1666 |
|
|
1649 | 1667 |
$db->with_transaction(sub { |
1650 | 1668 |
my $validity_token; |
1651 | 1669 |
if (!$self->order->id) { |
... | ... | |
1666 | 1684 |
SL::DB::DeliveryOrderItem->new(id => $_)->delete for @{$self->item_ids_to_delete || []}; |
1667 | 1685 |
$self->order->save(cascade => 1); |
1668 | 1686 |
|
1669 |
# link records |
|
1670 |
if ($::form->{converted_from_oe_id}) { |
|
1671 |
my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; |
|
1672 |
set_record_link_conversions( |
|
1673 |
$self->order, |
|
1674 |
'SL::DB::Order' => \@converted_from_oe_ids, |
|
1675 |
'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids}, |
|
1676 |
); |
|
1677 |
} |
|
1678 |
if ($::form->{converted_from_reclamation_id}) { |
|
1679 |
my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id}; |
|
1680 |
set_record_link_conversions( |
|
1681 |
$self->order, |
|
1682 |
'SL::DB::Reclamation' => \@converted_from_reclamation_ids, |
|
1683 |
'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids}, |
|
1684 |
); |
|
1685 |
} |
|
1686 |
|
|
1687 | 1687 |
$self->save_history('SAVED'); |
1688 | 1688 |
|
1689 | 1689 |
$validity_token->delete if $validity_token; |
Auch abrufbar als: Unified diff
RecordLink: in controller vor dem Speichern und ausserhalb der TX behandeln