From b060528d36179b9c4db39d61b4c66c2431bd8e9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 20 Nov 2020 16:34:16 +0100 Subject: [PATCH] =?utf8?q?Massenerstellen=20von=20Rechnungen=20aus=20LS:?= =?utf8?q?=20Aktion=20nur=20einmal=20ausf=C3=BChren?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Dafür den Action-Parameter only_once verwenden. Damit das aber klappt, muss die Prüfung, ob etwas angehakt ist, auch als check an die Action gehängt werden. Denn sonst wird der Knopf abgeschaltet, auch wenn nur die Prüfung fehlschlägt, weil man nix angehakt hat. --- SL/Controller/MassInvoiceCreatePrint.pm | 8 +++++--- js/kivi.MassInvoiceCreatePrint.js | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/SL/Controller/MassInvoiceCreatePrint.pm b/SL/Controller/MassInvoiceCreatePrint.pm index aab63731a..b0c2e5c98 100644 --- a/SL/Controller/MassInvoiceCreatePrint.pm +++ b/SL/Controller/MassInvoiceCreatePrint.pm @@ -377,9 +377,11 @@ sub setup_list_sales_delivery_orders_action_bar { ], action => [ t8("Create and print invoices for all selected delivery orders"), - call => [ 'kivi.MassInvoiceCreatePrint.submitMassCreationForm' ], - disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef, - only_if => $params{show_creation_buttons}, + call => [ 'kivi.MassInvoiceCreatePrint.submitMassCreationForm' ], + disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef, + only_if => $params{show_creation_buttons}, + checks => [ 'kivi.MassInvoiceCreatePrint.checkDeliveryOrderSelection' ], + only_once => 1, ], action => [ diff --git a/js/kivi.MassInvoiceCreatePrint.js b/js/kivi.MassInvoiceCreatePrint.js index 20ecde075..9fb1e3a3c 100644 --- a/js/kivi.MassInvoiceCreatePrint.js +++ b/js/kivi.MassInvoiceCreatePrint.js @@ -21,9 +21,6 @@ namespace('kivi.MassInvoiceCreatePrint', function(ns) { }; this.submitMassCreationForm = function() { - if (!kivi.MassInvoiceCreatePrint.checkDeliveryOrderSelection()) - return false; - $('body').addClass('loading'); kivi.submit_form_with_action('form', 'MassInvoiceCreatePrint/create_invoices'); return false; -- 2.20.1