Revision ef351df3
Von Sven Schöling vor fast 3 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
406 | 406 |
$email_form->{subject} = $form->generate_email_subject(); |
407 | 407 |
$email_form->{attachment_filename} = $form->generate_attachment_filename(); |
408 | 408 |
$email_form->{message} = $form->generate_email_body(); |
409 |
$email_form->{js_send_function} = 'kivi.Order.send_email()'; |
|
409 |
$email_form->{js_send_function} = 'kivi.DeliveryOrder.send_email()';
|
|
410 | 410 |
|
411 | 411 |
my %files = $self->get_files_for_email_dialog(); |
412 | 412 |
$self->{all_employees} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); |
... | ... | |
419 | 419 |
); |
420 | 420 |
|
421 | 421 |
$self->js |
422 |
->run('kivi.Order.show_email_dialog', $dialog_html) |
|
422 |
->run('kivi.DeliveryOrder.show_email_dialog', $dialog_html)
|
|
423 | 423 |
->reinit_widgets |
424 | 424 |
->render($self); |
425 | 425 |
} |
... | ... | |
433 | 433 |
my $errors = $self->save(); |
434 | 434 |
|
435 | 435 |
if (scalar @{ $errors }) { |
436 |
$self->js->run('kivi.Order.close_email_dialog'); |
|
436 |
$self->js->run('kivi.DeliveryOrder.close_email_dialog');
|
|
437 | 437 |
$self->js->flash('error', $_) foreach @{ $errors }; |
438 | 438 |
return $self->js->render(); |
439 | 439 |
} |
... | ... | |
595 | 595 |
->val( '#order_intnotes', $self->order->intnotes) |
596 | 596 |
->val( '#order_language_id', $self->order->$cv_method->language_id) |
597 | 597 |
->focus( '#order_' . $self->cv . '_id') |
598 |
->run('kivi.Order.update_exchangerate'); |
|
598 |
->run('kivi.DeliveryOrder.update_exchangerate');
|
|
599 | 599 |
|
600 | 600 |
$self->js_redisplay_cvpartnumbers; |
601 | 601 |
$self->js->render(); |
... | ... | |
646 | 646 |
$item->sellprice($item->unit_obj->convert_to($item->sellprice, $old_unit_obj)); |
647 | 647 |
|
648 | 648 |
$self->js |
649 |
->run('kivi.Order.update_sellprice', $::form->{item_id}, $item->sellprice_as_number); |
|
649 |
->run('kivi.DeliveryOrder.update_sellprice', $::form->{item_id}, $item->sellprice_as_number);
|
|
650 | 650 |
$self->js_redisplay_line_values; |
651 | 651 |
$self->js->render(); |
652 | 652 |
} |
... | ... | |
716 | 716 |
|
717 | 717 |
$self->js |
718 | 718 |
->val('.add_item_input', '') |
719 |
->run('kivi.Order.init_row_handlers') |
|
720 |
->run('kivi.Order.renumber_positions') |
|
719 |
->run('kivi.DeliveryOrder.init_row_handlers')
|
|
720 |
->run('kivi.DeliveryOrder.renumber_positions')
|
|
721 | 721 |
->focus('#add_item_parts_id_name'); |
722 | 722 |
|
723 |
$self->js->run('kivi.Order.row_table_scroll_down') if !$::form->{insert_before_item_id}; |
|
723 |
$self->js->run('kivi.DeliveryOrder.row_table_scroll_down') if !$::form->{insert_before_item_id};
|
|
724 | 724 |
|
725 | 725 |
$self->js->render(); |
726 | 726 |
} |
... | ... | |
774 | 774 |
|
775 | 775 |
$self->js |
776 | 776 |
->run('kivi.Part.close_picker_dialogs') |
777 |
->run('kivi.Order.init_row_handlers') |
|
778 |
->run('kivi.Order.renumber_positions') |
|
777 |
->run('kivi.DeliveryOrder.init_row_handlers')
|
|
778 |
->run('kivi.DeliveryOrder.renumber_positions')
|
|
779 | 779 |
->focus('#add_item_parts_id_name'); |
780 | 780 |
|
781 |
$self->js->run('kivi.Order.row_table_scroll_down') if !$::form->{insert_before_item_id}; |
|
781 |
$self->js->run('kivi.DeliveryOrder.row_table_scroll_down') if !$::form->{insert_before_item_id};
|
|
782 | 782 |
|
783 | 783 |
$self->js->render(); |
784 | 784 |
} |
... | ... | |
825 | 825 |
} |
826 | 826 |
} |
827 | 827 |
$self->js |
828 |
->run('kivi.Order.redisplay_items', \@to_sort) |
|
828 |
->run('kivi.DeliveryOrder.redisplay_items', \@to_sort)
|
|
829 | 829 |
->render; |
830 | 830 |
} |
831 | 831 |
|
... | ... | |
980 | 980 |
$self->js_load_second_row($item, $item_id, 0); |
981 | 981 |
} |
982 | 982 |
|
983 |
$self->js->run('kivi.Order.init_row_handlers') if $self->order->is_sales; # for lastcosts change-callback |
|
983 |
$self->js->run('kivi.DeliveryOrder.init_row_handlers') if $self->order->is_sales; # for lastcosts change-callback
|
|
984 | 984 |
|
985 | 985 |
$self->js->render(); |
986 | 986 |
} |
... | ... | |
1017 | 1017 |
$item->active_price_source($price_src); |
1018 | 1018 |
|
1019 | 1019 |
$self->js |
1020 |
->run('kivi.Order.update_sellprice', $item_id, $item->sellprice_as_number) |
|
1020 |
->run('kivi.DeliveryOrder.update_sellprice', $item_id, $item->sellprice_as_number)
|
|
1021 | 1021 |
->html('.row_entry:has(#item_' . $item_id . ') [name = "partnumber"] a', $item->part->partnumber) |
1022 | 1022 |
->val ('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].description"]', $item->description) |
1023 | 1023 |
->val ('.row_entry:has(#item_' . $item_id . ') [name = "order.orderitems[].longdescription"]', $item->longdescription); |
... | ... | |
1129 | 1129 |
} |
1130 | 1130 |
|
1131 | 1131 |
$self->js |
1132 |
->run('kivi.Order.redisplay_line_values', $is_sales, \@data); |
|
1132 |
->run('kivi.DeliveryOrder.redisplay_line_values', $is_sales, \@data);
|
|
1133 | 1133 |
} |
1134 | 1134 |
|
1135 | 1135 |
sub js_redisplay_cvpartnumbers { |
... | ... | |
1140 | 1140 |
my @data = map {[$_->{cvpartnumber}]} @{ $self->order->items_sorted }; |
1141 | 1141 |
|
1142 | 1142 |
$self->js |
1143 |
->run('kivi.Order.redisplay_cvpartnumbers', \@data); |
|
1143 |
->run('kivi.DeliveryOrder.redisplay_cvpartnumbers', \@data);
|
|
1144 | 1144 |
} |
1145 | 1145 |
|
1146 | 1146 |
sub js_reset_order_and_item_ids_after_save { |
Auch abrufbar als: Unified diff
DeliveryOrder: kompletter Split der javascripte kivi.Order und kivi.DeliveryOrder
Bisher hatte der kivi.DeliveryOrder Controller einige der kivi.Order
Funktionen als fallback benutzt. Das führt aber dazu dass gleich
benannte change handler durcheinanderkommen. Ergo: nur noch
kivi.DeliveryOrder nutzen.