Revision 932278ff
Von Tamino Steinert vor fast 2 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
240 | 240 |
my $saved_order = SL::DB::DeliveryOrder->new(id => $order->id)->load; |
241 | 241 |
|
242 | 242 |
# Create new record from current one |
243 |
my $updated_order = SL::Model::Record->update_for_save_as_new($saved_order, $order); |
|
244 |
|
|
245 |
$self->order($updated_order); |
|
243 |
my $new_order = SL::Model::Record->clone_for_save_as_new($saved_order, $order); |
|
244 |
$self->order($new_order); |
|
246 | 245 |
|
247 | 246 |
# no linked records on save as new |
248 | 247 |
delete $::form->{$_} for qw(converted_from_oe_id converted_from_orderitems_ids); |
SL/Controller/Order.pm | ||
---|---|---|
266 | 266 |
my $saved_order = SL::DB::Order->new(id => $order->id)->load; |
267 | 267 |
|
268 | 268 |
# Create new record from current one |
269 |
my $updated_order = SL::Model::Record->update_for_save_as_new($saved_order, $order); |
|
270 |
|
|
271 |
$self->order($updated_order); |
|
269 |
my $new_order = SL::Model::Record->clone_for_save_as_new($saved_order, $order); |
|
270 |
$self->order($new_order); |
|
272 | 271 |
|
273 | 272 |
# Warn on obsolete items |
274 | 273 |
my @obsolete_positions = map { $_->position } grep { $_->part->obsolete } @{ $self->order->items_sorted }; |
SL/Controller/Reclamation.pm | ||
---|---|---|
313 | 313 |
my $saved_reclamation = SL::DB::Reclamation->new(id => $reclamation->id)->load; |
314 | 314 |
|
315 | 315 |
# Create new record from current one |
316 |
my $new_reclamation = SL::Model::Record->update_for_save_as_new($saved_reclamation, $reclamation);
|
|
316 |
my $new_reclamation = SL::Model::Record->clone_for_save_as_new($saved_reclamation, $reclamation);
|
|
317 | 317 |
$self->reclamation($new_reclamation); |
318 | 318 |
|
319 | 319 |
if (!$::form->{form_validity_token}) { |
SL/Model/Record.pm | ||
---|---|---|
332 | 332 |
} |
333 | 333 |
} |
334 | 334 |
|
335 |
sub update_for_save_as_new {
|
|
335 |
sub clone_for_save_as_new {
|
|
336 | 336 |
my ($class, $saved_record, $changed_record, %params) = @_; |
337 | 337 |
|
338 | 338 |
# der übergebene beleg wurde mit new_from erstellt und muss nachbearbeitet werden: |
Auch abrufbar als: Unified diff
Model::Record: umbenennen von update_... zu clone_for_save_as_new