From 6e8c0011e9724aa7e06cd04e62fb95dcc97cdf10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 7 Oct 2020 15:36:56 +0200 Subject: [PATCH] Auftrags-Controller: Wiedervorlage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hier werden die vorhandenen Funktionenn und das Template verwendet, wobei die Eingabemaske in einem eigenen Browser-Fenster gerendert wird. Todo: Umstellung auf Dialog für alle Masken (evtl. ein eigener FollowUp-Controller und Methoden dafür in SL::DB::FollowUp) Refs #375 (redmine) --- SL/Controller/Order.pm | 14 +++++++++++++- js/kivi.Order.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index bef36317e..b5e5db195 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -1815,7 +1815,7 @@ sub pre_render { $self->get_item_cvpartnumber($_) for @{$self->order->items_sorted}; $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery - edit_periodic_invoices_config calculate_qty kivi.Validator); + edit_periodic_invoices_config calculate_qty kivi.Validator follow_up); $self->setup_edit_action_bar; } @@ -1907,6 +1907,18 @@ sub setup_edit_action_bar { disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef, only_if => $deletion_allowed, ], + + combobox => [ + action => [ + t8('more') + ], + action => [ + t8('Follow-Up'), + call => [ 'kivi.Order.follow_up_window' ], + disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef, + only_if => $::auth->assert('productivity'), + ], + ], # end of combobox "more" ); } } diff --git a/js/kivi.Order.js b/js/kivi.Order.js index 288af2d42..e52440691 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -906,6 +906,36 @@ namespace('kivi.Order', function(ns) { width: 500 }}); }; + ns.follow_up_window = function() { + var id = $('#id').val(); + var type = $('#type').val(); + + var number_info = ''; + if ($('#type').val() == 'sales_order' || $('#type').val() == 'purchase_order') { + number_info = $('#order_ordnumber').val(); + } else if ($('#type').val() == 'sales_quotation' || $('#type').val() == 'request_quotation') { + number_info = $('#order_quonumber').val(); + } + + var name_info = ''; + if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation') { + name_info = $('#order_customer_id_name').val(); + } else if ($('#type').val() == 'purchase_order' || $('#type').val() == 'request_quotation') { + name_info = $('#order_vendor_id_name').val(); + } + + var info = ''; + if (number_info !== '') { info += ' (' + number_info + ')' } + if (name_info !== '') { info += ' (' + name_info + ')' } + + $('').appendTo('#order_form').val(1); + $('').appendTo('#order_form').val(id); + $('').appendTo('#order_form').val(type); + $('').appendTo('#order_form').val(info); + + follow_up_window(); + }; + }); $(function() { -- 2.20.1