PartPicker kann auch nach EAN suchen
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 8 Nov 2017 15:00:40 +0000 (16:00 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 5 Jan 2018 12:00:53 +0000 (13:00 +0100)
SL/Controller/Part.pm
SL/DB/Manager/Part.pm
css/kivitendo/main.css
css/lx-office-erp/main.css
js/kivi.Part.js
templates/webpages/part/_part_picker_result.html

index 53d51ce..e4bb712 100644 (file)
@@ -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 } },
index 088d4c8..d24954b 100644 (file)
@@ -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) ]
   }
 );
 
index 6e8e035..94a1fa6 100644 (file)
@@ -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
 {
index 1bdc788..20760f1 100644 (file)
@@ -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
 {
index 9280fcf..dc05a9a 100644 (file)
@@ -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(),
index 677e772..ed8ad78 100644 (file)
   <input type='hidden' class='part_picker_id' value='[% part.id %]'>
   <input type='hidden' class='part_picker_partnumber' value='[% part.partnumber %]'>
   <input type='hidden' class='part_picker_description' value='[% part.displayable_name %]'>
+  <input type='hidden' class='part_picker_ean' value='[% part.ean %]'>
   <input type='hidden' class='part_picker_unit' value='[% part.unit %]'>
   <span class='ppp_block_number'>[% part.partnumber | html %]</span>
+  <span class='ppp_block_ean'>[% part.ean | html %]</span>
   <span class='ppp_block_description'>[% part.description | html %]</span>
   <div style='clear:both;'></div>
   <span class='ppp_block_sellprice'>[% 'Sellprice' | $T8 %]: [% part.sellprice_as_number | html %]</span>