From 5aa485a7c9e050dd112b3c53070a806fe72d2a0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 7 Oct 2014 14:28:59 +0200 Subject: [PATCH] PriceRule: Regeldetails anzeigen --- SL/Controller/PriceRule.pm | 6 ++++-- SL/DB/PriceRule.pm | 6 +++++- locale/de/all | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/SL/Controller/PriceRule.pm b/SL/Controller/PriceRule.pm index 82d5d858f..3d7a75e27 100644 --- a/SL/Controller/PriceRule.pm +++ b/SL/Controller/PriceRule.pm @@ -145,8 +145,8 @@ sub prepare_report { my $report = SL::ReportGenerator->new(\%::myconfig, $::form); $self->{report} = $report; - my @columns = qw(name type priority price discount); - my @sortable = qw(name type priority price discount); + my @columns = qw(name type priority price discount items); + my @sortable = qw(name type priority price discount ); my %column_defs = ( name => { obj_link => sub { $self->url_for(action => 'edit', 'price_rule.id' => $_[0]->id, callback => $callback) } }, @@ -154,6 +154,7 @@ sub prepare_report { price => { sub => sub { $_[0]->price_as_number } }, discount => { sub => sub { $_[0]->discount_as_number } }, obsolete => { sub => sub { $_[0]->obsolete_as_bool_yn } }, + items => { sub => sub { $_[0]->item_summary } }, ); map { $column_defs{$_}->{text} ||= $::locale->text( $self->models->get_sort_spec->{$_}->{title} ) } keys %column_defs; @@ -262,6 +263,7 @@ sub init_models { price => t8('Price'), discount => t8('Discount'), obsolete => t8('Obsolete'), + items => t8('Rule Details'), }, ); } diff --git a/SL/DB/PriceRule.pm b/SL/DB/PriceRule.pm index 5c2552ddb..0a9f09d85 100644 --- a/SL/DB/PriceRule.pm +++ b/SL/DB/PriceRule.pm @@ -95,7 +95,7 @@ sub clone_and_reset_deep { sub full_description { my ($self) = @_; - my $items = join ', ', map { $_->full_description } $self->items; + my $items = $self->item_summary; my $price = $self->price_or_discount ? t8('Discount #1%', $self->discount_as_number) : t8('Price #1', $self->price_as_number); @@ -103,6 +103,10 @@ sub full_description { sprintf "%s: %s (%s)", $self->name, $price, $items; } +sub item_summary { + join ', ', map { $_->full_description } $_[0]->items; +} + sub in_use { my ($self) = @_; diff --git a/locale/de/all b/locale/de/all index dea431383..c000ae6db 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2072,6 +2072,7 @@ $self->{texts} = { 'Row was created from current record' => 'Zeile wurde aus aktuellem Beleg erstellt', 'Row was linked to another record' => 'Zeile wurde über einen anderen Beleg verlinkt', 'Row was source for current record' => 'Zeile war Quelle für aktuellen Beleg', + 'Rule Details' => 'Regel Details', 'Run at' => 'Ausgeführt um', 'SAVED' => 'Gespeichert', 'SAVED FOR DUNNING' => 'Gespeichert', -- 2.20.1