From ea1c5dfb6016096a29822cc66628837beaff0891 Mon Sep 17 00:00:00 2001 From: "Martin Helmling martin.helmling@octosoft.eu" Date: Wed, 28 Dec 2016 16:36:54 +0100 Subject: [PATCH] =?utf8?q?Vereinfachte=20Abk=C3=BCrzungsmethode=20"typecla?= =?utf8?q?ss=5Fabbreviation"=20im=20Part=20Presenter?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Presenter/Part.pm | 8 +++++++- templates/webpages/order/tabs/_row.html | 4 ++++ templates/webpages/order/tabs/basic_data.html | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index d8491ecb5..3de612376 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -7,7 +7,7 @@ use SL::DB::PartClassification; use SL::Locale::String qw(t8); use Exporter qw(import); -our @EXPORT = qw(part_picker part select_classification classification_abbreviation type_abbreviation separate_abbreviation); +our @EXPORT = qw(part_picker part select_classification classification_abbreviation type_abbreviation separate_abbreviation typeclass_abbreviation); use Carp; @@ -84,6 +84,12 @@ sub classification_abbreviation { $obj && $obj->abbreviation ? t8($obj->abbreviation) : ''; } +sub typeclass_abbreviation { + my ($self, $part) = @_; + return '' if !$part || !$part->isa('SL::DB::Part'); + return $self->type_abbreviation($part->part_type).$self->classification_abbreviation($part->classification_id); +} + # # shortcut for article type # diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 89889c69e..b59ffb45c 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -2,6 +2,7 @@ [%- USE HTML %] [%- USE LxERP %] [%- USE L %] +[%- USE P %] @@ -33,6 +34,9 @@
[% HTML.escape(ITEM.part.partnumber) %]
+ +
[% P.typeclass_abbreviation(ITEM.part) %]
+ [% L.input_tag("order.orderitems[].description", ITEM.description, diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 1a055379c..526e028bf 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -166,6 +166,7 @@ [%- LxERP.t8('reorder item') %] [%- LxERP.t8('delete item') %] [%- 'Partnumber' | $T8 %] + [%- 'Type' | $T8 %] [%- 'Description' | $T8 %] [%- 'Qty' | $T8 %] [%- 'Price Factor' | $T8 %] -- 2.20.1