From: Jan Büren Date: Wed, 18 Jul 2018 12:43:33 +0000 (+0200) Subject: Liefertermin Erinnerung für Auftrags-Controller X-Git-Tag: release-3.5.4~350 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1d1f31407ee1a66af5a0db0d10350bc29a371653;p=kivitendo-erp.git Liefertermin Erinnerung für Auftrags-Controller Falls in Mandanten-Konfig aktiviert, wird ein leerer Eintrag in Liefertermin in Aufträgen beim Speichern oder beim Workflow 'Speichern und Lieferschein' angemahnt. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index ace7accba..d4395b5f9 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -1472,7 +1472,9 @@ sub _setup_edit_action_bar { combobox => [ action => [ t8('Save'), - call => [ 'kivi.Order.save', 'save', $::instance_conf->get_order_warn_duplicate_parts ], + call => [ 'kivi.Order.save', 'save', $::instance_conf->get_order_warn_duplicate_parts, + $::instance_conf->get_order_warn_no_deliverydate, + ], checks => [ 'kivi.Order.check_save_active_periodic_invoices' ], ], action => [ @@ -1483,7 +1485,9 @@ sub _setup_edit_action_bar { ], action => [ t8('Save and Delivery Order'), - call => [ 'kivi.Order.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts ], + call => [ 'kivi.Order.save', 'save_and_delivery_order', $::instance_conf->get_order_warn_duplicate_parts, + $::instance_conf->get_order_warn_no_deliverydate, + ], checks => [ 'kivi.Order.check_save_active_periodic_invoices' ], only_if => (any { $self->type eq $_ } (_sales_order_type(), _purchase_order_type())) ], diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index b6a3af539..87d676b4f 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -99,6 +99,7 @@ __PACKAGE__->meta->columns( normalize_vc_names => { type => 'boolean', default => 'true' }, order_always_project => { type => 'boolean', default => 'false' }, order_warn_duplicate_parts => { type => 'boolean', default => 'true' }, + order_warn_no_deliverydate => { type => 'boolean', default => 'true' }, parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' }, parts_listing_image => { type => 'boolean', default => 'true' }, parts_show_image => { type => 'boolean', default => 'true' }, diff --git a/js/kivi.Order.js b/js/kivi.Order.js index 21d29ca12..298a8b51b 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -35,9 +35,19 @@ namespace('kivi.Order', function(ns) { return true; }; - ns.save = function(action, warn_on_duplicates) { + ns.check_valid_reqdate = function() { + if ($('#order_reqdate').val() === '') { + alert(kivi.t8('Please select a delivery date.')); + return false; + } else { + return true; + } + }; + + ns.save = function(action, warn_on_duplicates, warn_on_reqdate) { if (!ns.check_cv()) return; if (warn_on_duplicates && !ns.check_save_duplicate_parts()) return; + if (warn_on_reqdate && !ns.check_valid_reqdate()) return; var data = $('#order_form').serializeArray(); data.push({ name: 'action', value: 'Order/' + action }); diff --git a/sql/Pg-upgrade2/defaults_order_warn_no_deliverydate.sql b/sql/Pg-upgrade2/defaults_order_warn_no_deliverydate.sql new file mode 100644 index 000000000..6ec78a33c --- /dev/null +++ b/sql/Pg-upgrade2/defaults_order_warn_no_deliverydate.sql @@ -0,0 +1,5 @@ +-- @tag: defaults_order_warn_no_deliverydate +-- @description: Mandantenkonfiguration: Warnung falls kein Liefertermin eingetragen wurden +-- @depends: release_3_5_2 + +ALTER TABLE defaults ADD COLUMN order_warn_no_deliverydate BOOLEAN DEFAULT TRUE; diff --git a/templates/webpages/client_config/_features.html b/templates/webpages/client_config/_features.html index 7a952a817..cf72e8025 100644 --- a/templates/webpages/client_config/_features.html +++ b/templates/webpages/client_config/_features.html @@ -208,6 +208,11 @@ [% L.yes_no_tag("defaults.order_warn_duplicate_parts", SELF.defaults.order_warn_duplicate_parts) %] [% LxERP.t8("If enabled a warning will be shown in sales and purchase orders if there are two or more positions of the same part (new controller only).") %] + + [% LxERP.t8("Warn before saving orders without a delivery date") %] + [% L.yes_no_tag("defaults.order_warn_no_deliverydate", SELF.defaults.order_warn_no_deliverydate) %] + [% LxERP.t8("If enabled a warning will be shown in sales and purchase orders if there the delivery date is empty.") %] + [% LxERP.t8("E-mail") %]