Revision 7749e0e6
Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
252 | 252 |
return $self->js->render(); |
253 | 253 |
} |
254 | 254 |
|
255 |
$self->js->val('#id', $self->order->id) |
|
256 |
->val('#order_' . $self->nr_key(), $self->order->number); |
|
255 |
$self->js_reset_order_and_item_ids_after_save; |
|
257 | 256 |
|
258 | 257 |
my $format = $::form->{print_options}->{format}; |
259 | 258 |
my $media = $::form->{print_options}->{media}; |
... | ... | |
423 | 422 |
return $self->js->render(); |
424 | 423 |
} |
425 | 424 |
|
426 |
$self->js->val('#id', $self->order->id) |
|
427 |
->val('#order_' . $self->nr_key(), $self->order->number); |
|
425 |
$self->js_reset_order_and_item_ids_after_save; |
|
428 | 426 |
|
429 | 427 |
my $email_form = delete $::form->{email_form}; |
430 | 428 |
my %field_names = (to => 'email'); |
... | ... | |
1055 | 1053 |
->insertBefore($self->build_tax_rows, '#amount_row_id'); |
1056 | 1054 |
} |
1057 | 1055 |
|
1056 |
sub js_reset_order_and_item_ids_after_save { |
|
1057 |
my ($self) = @_; |
|
1058 |
|
|
1059 |
$self->js |
|
1060 |
->val('#id', $self->order->id) |
|
1061 |
->val('#converted_from_oe_id', '') |
|
1062 |
->val('#order_' . $self->nr_key(), $self->order->number); |
|
1063 |
|
|
1064 |
my $idx = 0; |
|
1065 |
foreach my $form_item_id (@{ $::form->{orderitem_ids} }) { |
|
1066 |
next if !$self->order->items_sorted->[$idx]->id; |
|
1067 |
next if $form_item_id !~ m{^new}; |
|
1068 |
$self->js |
|
1069 |
->val ('[name="orderitem_ids[+]"][value="' . $form_item_id . '"]', $self->order->items_sorted->[$idx]->id) |
|
1070 |
->val ('#item_' . $form_item_id, $self->order->items_sorted->[$idx]->id) |
|
1071 |
->attr('#item_' . $form_item_id, "id", 'item_' . $self->order->items_sorted->[$idx]->id); |
|
1072 |
$idx++; |
|
1073 |
} |
|
1074 |
$self->js->val('[name="converted_from_orderitems_ids[+]"]', ''); |
|
1075 |
} |
|
1076 |
|
|
1058 | 1077 |
# |
1059 | 1078 |
# helpers |
1060 | 1079 |
# |
Auch abrufbar als: Unified diff
OrderController: nach Speichern hiddens der ids wieder setzen, …
… falls die Makse nicht neu geladen wird.