From 87b5c8e4245710eec1c6257ab4e291080bc900bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 8 Nov 2017 16:00:40 +0100 Subject: [PATCH] PartPicker kann auch nach EAN suchen --- SL/Controller/Part.pm | 1 + SL/DB/Manager/Part.pm | 2 +- css/kivitendo/main.css | 9 +++++++++ css/lx-office-erp/main.css | 9 +++++++++ js/kivi.Part.js | 1 + templates/webpages/part/_part_picker_result.html | 2 ++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 53d51ced5..e4bb71226 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -549,6 +549,7 @@ sub action_ajax_autocomplete { id => $_->id, partnumber => $_->partnumber, description => $_->description, + ean => $_->ean, part_type => $_->part_type, unit => $_->unit, cvars => { map { ($_->config->name => { value => $_->value_as_text, is_valid => $_->is_valid }) } @{ $_->cvars_by_config } }, diff --git a/SL/DB/Manager/Part.pm b/SL/DB/Manager/Part.pm index 088d4c838..d24954bdb 100644 --- a/SL/DB/Manager/Part.pm +++ b/SL/DB/Manager/Part.pm @@ -22,7 +22,7 @@ __PACKAGE__->add_filter_specs( }, all => sub { my ($key, $value, $prefix) = @_; - return or => [ map { $prefix . $_ => $value } qw(partnumber description) ] + return or => [ map { $prefix . $_ => $value } qw(partnumber description ean) ] } ); diff --git a/css/kivitendo/main.css b/css/kivitendo/main.css index 6e8e035e9..94a1fa6f0 100644 --- a/css/kivitendo/main.css +++ b/css/kivitendo/main.css @@ -480,6 +480,10 @@ div.cpc_block span.cpc_block_number { float:left; } +div.ppp_block span.ppp_block_ean { + float:left; + margin-left:1em; +} div.ppp_block span.ppp_block_description { float:right; margin-left:1em; @@ -490,6 +494,11 @@ div.cpc_block span.cpc_block_description { margin-left:1em; font-weight:bold; } +div.ppp_line span.ppp_block_number, +div.ppp_line span.ppp_block_ean { + float:left; + margin-left:1em; +} div.ppp_line span.ppp_block_description, div.cpc_line span.cpc_block_description { diff --git a/css/lx-office-erp/main.css b/css/lx-office-erp/main.css index 1bdc78825..20760f116 100644 --- a/css/lx-office-erp/main.css +++ b/css/lx-office-erp/main.css @@ -468,11 +468,20 @@ div.ppp_block span.ppp_block_description { float:right; font-weight:bold; } +div.ppp_block span.ppp_block_ean { + float:left; + margin-left:1em; +} div.cpc_block span.cpc_block_description { float:left; margin-left:1em; font-weight:bold; } +div.ppp_line span.ppp_block_number, +div.ppp_line span.ppp_block_ean { + float:left; + margin-left:1em; +} div.ppp_line span.ppp_block_description, div.cpc_line span.cpc_block_description { diff --git a/js/kivi.Part.js b/js/kivi.Part.js index 9280fcf9c..dc05a9add 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -560,6 +560,7 @@ namespace('kivi.Part', function(ns) { id: $(this).children('input.part_picker_id').val(), name: $(this).children('input.part_picker_description').val(), classification_id: $(this).children('input.part_picker_classification_id').val(), + ean: $(this).children('input.part_picker_ean').val(), unit: $(this).children('input.part_picker_unit').val(), partnumber: $(this).children('input.part_picker_partnumber').val(), description: $(this).children('input.part_picker_description').val(), diff --git a/templates/webpages/part/_part_picker_result.html b/templates/webpages/part/_part_picker_result.html index 677e772db..ed8ad788e 100644 --- a/templates/webpages/part/_part_picker_result.html +++ b/templates/webpages/part/_part_picker_result.html @@ -11,8 +11,10 @@ + [% part.partnumber | html %] + [% part.ean | html %] [% part.description | html %]
[% 'Sellprice' | $T8 %]: [% part.sellprice_as_number | html %] -- 2.20.1