From bb1e72d3069c173327e6cf1b175bdba446fa84d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 10 Aug 2021 10:32:58 +0200 Subject: [PATCH] Bugfix: ShippedQty kann nicht ohne $::form aufgerufen werden MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Falls die Zeiterfassung per BackgroundJob Lieferscheine aus Aufträgen erzeugt wird jetzt kein Fehler mehr geworfen, dass der Typ (sales || purchase) nicht definiert ist. --- SL/Helper/ShippedQty.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/Helper/ShippedQty.pm b/SL/Helper/ShippedQty.pm index 452080399..383a3a3fc 100644 --- a/SL/Helper/ShippedQty.pm +++ b/SL/Helper/ShippedQty.pm @@ -162,9 +162,9 @@ sub init_require_stock_out { $::instance_conf->get_shipped_qty_require_stock_ sub init_services_deliverable { my ($self) = @_; - if ($::form->{type} =~ m/^sales_/) { + if ($::form->{type} =~ m/^sales_/ || $self->{objects}->[0]->{customer_id}) { $::instance_conf->get_sales_delivery_order_check_service; - } elsif ($::form->{type} =~ m/^purchase_/) { + } elsif ($::form->{type} =~ m/^purchase_/ || $self->{objects}->[0]->{vendor_id}) { $::instance_conf->get_purchase_delivery_order_check_service; } else { croak "wrong call, no customer or vendor object referenced"; -- 2.20.1