From 7bc44f0f59f35d7d3b555e98ff9bb61c8ffbea0b Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Wed, 21 Jan 2015 11:24:20 +0100 Subject: [PATCH] CustomerVendor Picker auf displayable_name umgestellt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sowohl im Autocomplete als auch beim ausgewählten Kunden/Lieferanten wird jetzt immer Kunden/Lieferantennummer und Name angezeigt. --- SL/Controller/CustomerVendor.pm | 10 +++++----- SL/Presenter/CustomerVendor.pm | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index f57c4b8bd..d9732cb97 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -611,7 +611,7 @@ sub action_ajaj_autocomplete { my @hashes = map { +{ - value => $_->name, + value => $_->displayable_name, label => $_->displayable_name, id => $_->id, $number => $_->$number, @@ -953,10 +953,10 @@ sub init_customer_models { model => 'Customer', sorted => { _default => { - by => 'name', + by => 'customernumber', dir => 1, }, - name => t8('Name'), + customernumber => t8('Customer Number'), }, ); } @@ -969,10 +969,10 @@ sub init_vendor_models { model => 'Vendor', sorted => { _default => { - by => 'name', + by => 'vendornumber', dir => 1, }, - name => t8('Name'), + vendornumber => t8('Vendor Number'), }, ); } diff --git a/SL/Presenter/CustomerVendor.pm b/SL/Presenter/CustomerVendor.pm index a1aeee119..5f41a2a50 100644 --- a/SL/Presenter/CustomerVendor.pm +++ b/SL/Presenter/CustomerVendor.pm @@ -57,7 +57,7 @@ sub customer_vendor_picker { my $ret = $self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id) . join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(type)) . - $self->input_tag("", (ref $value && $value->can('name')) ? $value->name : '', id => "${id}_name", %params); + $self->input_tag("", ref $value ? $value->displayable_name : '', id => "${id}_name", %params); $::request->layout->add_javascripts('autocomplete_customer.js'); $::request->presenter->need_reinit_widgets($id); -- 2.20.1