From 72180323f463c9814fbcf21c3376201e6829b21b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 25 Sep 2014 18:30:05 +0200 Subject: [PATCH] =?utf8?q?PriceRule:=20Priorit=C3=A4t=20auf=202=20Werte=20?= =?utf8?q?einschr=C3=A4nken?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/PriceRule.pm | 2 +- SL/DB/PriceRule.pm | 7 +++++++ locale/de/all | 2 ++ templates/webpages/price_rule/_filter.html | 10 +++++++--- templates/webpages/price_rule/form.html | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/SL/Controller/PriceRule.pm b/SL/Controller/PriceRule.pm index a90f68e22..013445570 100644 --- a/SL/Controller/PriceRule.pm +++ b/SL/Controller/PriceRule.pm @@ -148,7 +148,7 @@ sub prepare_report { my %column_defs = ( name => { obj_link => sub { $self->url_for(action => 'edit', 'price_rule.id' => $_[0]->id, callback => $callback) } }, - priority => { sub => sub { $_[0]->priority } }, + priority => { sub => sub { $_[0]->priority_as_text } }, price => { sub => sub { $_[0]->price_as_number } }, discount => { sub => sub { $_[0]->discount_as_number } }, obsolete => { sub => sub { $_[0]->obsolete_as_bool_yn } }, diff --git a/SL/DB/PriceRule.pm b/SL/DB/PriceRule.pm index 7dfd19703..5c2552ddb 100644 --- a/SL/DB/PriceRule.pm +++ b/SL/DB/PriceRule.pm @@ -119,5 +119,12 @@ sub in_use { || SL::DB::Manager::InvoiceItem->get_all_count(query => [ active_price_source => $price_source_spec ]); } +sub priority_as_text { + my ($self) = @_; + + return t8('Override') if $self->priority == 4; + t8('Normal'); +} + 1; diff --git a/locale/de/all b/locale/de/all index c3a493bfb..7bd7c8592 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1618,6 +1618,7 @@ $self->{texts} = { 'None' => 'Kein', 'None (PriceSource Discount)' => 'Freier Rabatt', 'None (PriceSource)' => 'Freier Preis', + 'Normal' => 'Normal', 'Normal users cannot log in.' => 'Normale Benutzer können sich nicht anmelden.', 'Normalize Customer / Vendor names' => 'Normalisierung Kunden- / Lieferantennamen', 'Normalize part description and part notes' => 'Normalisierung Artikelbeschreibung und Artikellangtext (Bemerkung)', @@ -1710,6 +1711,7 @@ $self->{texts} = { 'Output Number Format' => 'Zahlenformat (Ausgabe)', 'Outputformat' => 'Ausgabeformat', 'Overdue sales quotations and requests for quotations' => 'Überfällige Angebote und Preisanfragen', + 'Override' => 'Override', 'Override invoice language' => 'Diese Sprache verwenden', 'Owner of account' => 'Kontoinhaber', 'PAYMENT POSTED' => 'Rechnung gebucht', diff --git a/templates/webpages/price_rule/_filter.html b/templates/webpages/price_rule/_filter.html index 6cc7cfbbb..ff0e2e536 100644 --- a/templates/webpages/price_rule/_filter.html +++ b/templates/webpages/price_rule/_filter.html @@ -24,8 +24,12 @@ [% L.input_tag('filter.discount:number', filter.discount_number, size=20) %] - [% 'Discount' | $T8 %] - [% L.select_tag('filter.obsolete', [ [ '', LxERP.t8('Both') ], [ 0, LxERP.t8('Valid') ], [ 1 , LxERP.t8('Obsolete')]], default=filter.obsolete, title_key='description', style='width: 300px') %] + [% 'Priority' | $T8 %] + [% L.select_tag('filter.priority', [ [ '', LxERP.t8('All') ], [ 3, LxERP.t8('Normal') ], [ 4 , LxERP.t8('Override')]], default=filter.priority, style='width: 300px') %] + + + [% 'Obsolete' | $T8 %] + [% L.select_tag('filter.obsolete', [ [ '', LxERP.t8('Both') ], [ 0, LxERP.t8('Valid') ], [ 1 , LxERP.t8('Obsolete')]], default=filter.obsolete, style='width: 300px') %] @@ -36,7 +40,7 @@ [% L.hidden_tag('page', FORM.page) %] [% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] -[% 'Reset' | $T8 %] +[% 'Reset' | $T8 %] diff --git a/templates/webpages/price_rule/form.html b/templates/webpages/price_rule/form.html index 8f55e79fd..30c0e6060 100644 --- a/templates/webpages/price_rule/form.html +++ b/templates/webpages/price_rule/form.html @@ -23,7 +23,7 @@ [%- END %] [% 'Priority' | $T8 %] - [% L.select_tag('price_rule.priority', [1,2,3,4,5], default=SELF.price_rule.priority, style='width: 300px') %] + [% L.select_tag('price_rule.priority', [ [3, LxERP.t8('Normal') ], [ 4, LxERP.t8('Override') ] ], default=SELF.price_rule.priority, style='width: 300px') %] -- 2.20.1