Revision 85ab58eb
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpecOrder.pm | ||
---|---|---|
63 | 63 |
|
64 | 64 |
# 2. Create actual quotation/order. |
65 | 65 |
my $order = $self->create_order(sections => $sections); |
66 |
$order->save; |
|
66 |
$order->db->with_transaction(sub { |
|
67 |
$order->save; |
|
68 |
|
|
69 |
$self->requirement_spec->orders( |
|
70 |
@{ $self->requirement_spec->orders }, |
|
71 |
SL::DB::RequirementSpecOrder->new(order => $order, version => $self->requirement_spec->version) |
|
72 |
); |
|
73 |
$self->requirement_spec->save; |
|
74 |
|
|
75 |
$self->requirement_spec->link_to_record($order); |
|
76 |
}) or do { |
|
77 |
$::lxdebug->message(LXDebug::WARN(), "Error creating the order object: $@"); |
|
78 |
}; |
|
67 | 79 |
|
68 |
$self->requirement_spec->orders( |
|
69 |
@{ $self->requirement_spec->orders }, |
|
70 |
SL::DB::RequirementSpecOrder->new(order => $order, version => $self->requirement_spec->version) |
|
71 |
); |
|
72 |
$self->requirement_spec->save; |
|
73 | 80 |
$self->init_requirement_spec; |
74 | 81 |
|
75 | 82 |
# 3. Notify the user and return to list. |
... | ... | |
135 | 142 |
$order->orderitems([ @{ $order->orderitems }, @new_orderitems ]) if @new_orderitems; |
136 | 143 |
|
137 | 144 |
$order->calculate_prices_and_taxes; |
138 |
$order->save; |
|
145 |
|
|
146 |
$order->db->with_transaction(sub { |
|
147 |
$order->save; |
|
148 |
$self->requirement_spec->link_to_record($order); |
|
149 |
}) or do { |
|
150 |
$::lxdebug->message(LXDebug::WARN(), "Error updating the order object: $@"); |
|
151 |
}; |
|
139 | 152 |
|
140 | 153 |
$self->init_requirement_spec; |
141 | 154 |
|
SL/DB/RequirementSpec.pm | ||
---|---|---|
8 | 8 |
|
9 | 9 |
use SL::DB::MetaSetup::RequirementSpec; |
10 | 10 |
use SL::DB::Manager::RequirementSpec; |
11 |
use SL::DB::Helper::LinkedRecords; |
|
11 | 12 |
use SL::Locale::String; |
12 | 13 |
use SL::Util qw(_hashify); |
13 | 14 |
|
Auch abrufbar als: Unified diff
Pflichtenhefte -> Angebote: Eintrag in record_links anlegen