Revision 6e7e7ef1
Von Tamino Steinert vor etwa 1 Jahr 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 | ||
---|---|---|
278 | 278 |
my $saved_order = SL::DB::Order->new(id => $order->id)->load; |
279 | 279 |
|
280 | 280 |
# Create new record from current one |
281 |
my $updated_order = SL::Model::Record->update_for_save_as_new($saved_order, $order); |
|
282 |
|
|
283 |
$self->order($updated_order); |
|
281 |
my $new_order = SL::Model::Record->clone_for_save_as_new($saved_order, $order); |
|
282 |
$self->order($new_order); |
|
284 | 283 |
|
285 | 284 |
# Warn on obsolete items |
286 | 285 |
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