From 03d66bba7bc816a9cc1e0dbbb09fa36f039e77d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 13 Aug 2018 16:59:10 +0200 Subject: [PATCH] Auftrags-Controller: gelieferte Menge in Auftragsposition anzeigen. --- SL/Controller/Order.pm | 6 ++++++ templates/webpages/order/tabs/_row.html | 5 +++++ templates/webpages/order/tabs/basic_data.html | 3 +++ 3 files changed, 14 insertions(+) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 901cc0e97..ff0ec7f51 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -22,6 +22,7 @@ use SL::DB::RecordLink; use SL::Helper::CreatePDF qw(:all); use SL::Helper::PrintOptions; +use SL::Helper::ShippedQty; use SL::Controller::Helper::GetModels; @@ -1466,6 +1467,11 @@ sub pre_render { $item->active_discount_source($price_source->discount_from_source($item->active_discount_source)); } + if (any { $self->type eq $_ } (sales_order_type(), purchase_order_type())) { + # calculate shipped qtys here to prevent calling calculate for every item via the items method + SL::Helper::ShippedQty->new->calculate($self->order)->write_to_objects; + } + if ($self->order->number && $::instance_conf->get_webdav) { my $webdav = SL::Webdav->new( type => $self->type, diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 6528c6c74..967c94ba9 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -48,6 +48,11 @@ [%- END -%] [%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %] + [%- IF (TYPE == "sales_order" || TYPE == "purchase_order") -%] + + [%- L.div_tag(LxERP.format_amount(ITEM.shipped_qty, 2, 0) _ ' ' _ ITEM.unit, name="shipped_qty", class="numeric") %] + + [%- END -%] [%- L.input_tag("order.orderitems[].qty_as_number", ITEM.qty_as_number, diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 870e4aaa1..8e4776ca6 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -212,6 +212,9 @@ [%- 'Partnumber' | $T8 %] [%- 'Type' | $T8 %] [%- 'Description' | $T8 %] + [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%] + [%- 'Delivered' | $T8 %] + [%- END -%] [%- 'Qty' | $T8 %] [%- 'Price Factor' | $T8 %] [%- 'Unit' | $T8 %] -- 2.20.1