Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5aa485a7

Von Sven Schöling vor etwa 10 Jahren hinzugefügt

  • ID 5aa485a7c9e050dd112b3c53070a806fe72d2a0b
  • Vorgänger defc4fe6
  • Nachfolger 986282c1

PriceRule: Regeldetails anzeigen

Unterschiede anzeigen:

SL/Controller/PriceRule.pm
145 145
  my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
146 146
  $self->{report} = $report;
147 147

  
148
  my @columns     = qw(name type priority price discount);
149
  my @sortable    = qw(name type priority price discount);
148
  my @columns     = qw(name type priority price discount items);
149
  my @sortable    = qw(name type priority price discount      );
150 150

  
151 151
  my %column_defs = (
152 152
    name          => { obj_link => sub { $self->url_for(action => 'edit', 'price_rule.id' => $_[0]->id, callback => $callback) } },
......
154 154
    price         => { sub  => sub { $_[0]->price_as_number } },
155 155
    discount      => { sub  => sub { $_[0]->discount_as_number } },
156 156
    obsolete      => { sub  => sub { $_[0]->obsolete_as_bool_yn } },
157
    items         => { sub  => sub { $_[0]->item_summary } },
157 158
  );
158 159

  
159 160
  map { $column_defs{$_}->{text} ||= $::locale->text( $self->models->get_sort_spec->{$_}->{title} ) } keys %column_defs;
......
262 263
      price    => t8('Price'),
263 264
      discount => t8('Discount'),
264 265
      obsolete => t8('Obsolete'),
266
      items    => t8('Rule Details'),
265 267
    },
266 268
  );
267 269
}
SL/DB/PriceRule.pm
95 95
sub full_description {
96 96
  my ($self) = @_;
97 97

  
98
  my $items = join ', ', map { $_->full_description } $self->items;
98
  my $items = $self->item_summary;
99 99
  my $price = $self->price_or_discount
100 100
            ? t8('Discount #1%', $self->discount_as_number)
101 101
            : t8('Price #1', $self->price_as_number);
......
103 103
  sprintf "%s: %s (%s)", $self->name, $price, $items;
104 104
}
105 105

  
106
sub item_summary {
107
  join ', ', map { $_->full_description } $_[0]->items;
108
}
109

  
106 110
sub in_use {
107 111
  my ($self) = @_;
108 112

  
locale/de/all
2072 2072
  'Row was created from current record' => 'Zeile wurde aus aktuellem Beleg erstellt',
2073 2073
  'Row was linked to another record' => 'Zeile wurde über einen anderen Beleg verlinkt',
2074 2074
  'Row was source for current record' => 'Zeile war Quelle für aktuellen Beleg',
2075
  'Rule Details'                => 'Regel Details',
2075 2076
  'Run at'                      => 'Ausgeführt um',
2076 2077
  'SAVED'                       => 'Gespeichert',
2077 2078
  'SAVED FOR DUNNING'           => 'Gespeichert',

Auch abrufbar als: Unified diff