From: G. Richardson Date: Wed, 21 Jan 2015 10:24:20 +0000 (+0100) Subject: CustomerVendor Picker auf displayable_name umgestellt X-Git-Tag: release-3.2.0beta~59 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7bc44f0f59f35d7d3b555e98ff9bb61c8ffbea0b;p=kivitendo-erp.git CustomerVendor Picker auf displayable_name umgestellt Sowohl im Autocomplete als auch beim ausgewählten Kunden/Lieferanten wird jetzt immer Kunden/Lieferantennummer und Name angezeigt. --- 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);