Revision c383fc0b
Von Sven Schöling vor mehr als 9 Jahren hinzugefügt
SL/Controller/PriceRule.pm | ||
---|---|---|
109 | 109 |
sub display_form { |
110 | 110 |
my ($self, %params) = @_; |
111 | 111 |
my $is_new = !$self->price_rule->id; |
112 |
my $title = $is_new ? |
|
113 |
($self->price_rule->is_sales ? t8('Create a new sales price rule') : t8('Create a new purchase price rule')) : |
|
114 |
($self->price_rule->is_sales ? t8('Edit sales price rule') : t8('Edit purchase price rule')); |
|
112 |
my $title = $self->form_title(($is_new ? 'create' : 'edit'), $self->price_rule->type); |
|
115 | 113 |
$self->render('price_rule/form', |
116 | 114 |
title => $title, |
117 | 115 |
%params |
118 | 116 |
); |
119 | 117 |
} |
120 | 118 |
|
119 |
sub form_title { |
|
120 |
my ($self, $action, $type) = @_; |
|
121 |
|
|
122 |
return { |
|
123 |
edit => { |
|
124 |
customer => t8('Edit sales price rule'), |
|
125 |
vendor => t8('Edit purchase price rule'), |
|
126 |
'' => t8('Edit price rule'), |
|
127 |
}, |
|
128 |
create => { |
|
129 |
customer => t8('Create a new sales price rule'), |
|
130 |
vendor => t8('Create a new purchase price rule'), |
|
131 |
'' => t8('Create a new price rule'), |
|
132 |
}, |
|
133 |
list => { |
|
134 |
customer => t8('Sales Price Rules'), |
|
135 |
vendor => t8('Purchase Price Rules'), |
|
136 |
'' => t8('Price Rules'), |
|
137 |
}, |
|
138 |
}->{$action}{$type}; |
|
139 |
} |
|
140 |
|
|
121 | 141 |
sub create_or_update { |
122 | 142 |
my $self = shift; |
123 | 143 |
my $is_new = !$self->price_rule->id; |
... | ... | |
171 | 191 |
std_column_visibility => 1, |
172 | 192 |
controller_class => 'PriceRule', |
173 | 193 |
output_format => 'HTML', |
174 |
title => ($self->vc eq 'customer' ? t8('Sales Price Rules') : t8('Purchase Price Rules')) ,
|
|
194 |
title => $self->form_title('list', $self->vc),
|
|
175 | 195 |
allow_pdf_export => !$::form->{inline}, |
176 | 196 |
allow_csv_export => !$::form->{inline}, |
177 | 197 |
); |
Auch abrufbar als: Unified diff
PriceRule: Ein menüeintrag und Typen frei filterbar