133 |
133 |
: $op eq 'lt' ? t8('Transdate is before #1', $self->value_date_as_date)
|
134 |
134 |
: $op eq 'gt' ? t8('Transdate is after #1', $self->value_date_as_date)
|
135 |
135 |
: do { die "unknown op $op for type $type" } )
|
136 |
|
: $type eq 'cvar' ? t8('Custom Variables') . ' ' . $self->custom_variable_configs->description . ' ' . $self->value_text
|
137 |
|
# $self->custom_variable_configs->value_col eq 'text_value' ? $self->value_text : 'lu'
|
|
136 |
: $type eq 'cvar' ? $self->cvar_rule_description($type, $op)
|
138 |
137 |
: do { die "unknown type $type" }
|
139 |
138 |
}
|
140 |
139 |
|
|
140 |
sub cvar_rule_description {
|
|
141 |
my ($self, $type, $op) = @_;
|
|
142 |
my $config = $self->cvar_config;
|
|
143 |
my $description = $config->description;
|
|
144 |
|
|
145 |
t8('Custom Variables (Abbreviation)') . ' ' . (
|
|
146 |
$config->type eq 'select' ? t8("#1 is #2", $description, $self->value_text)
|
|
147 |
: $config->type eq 'customer' ? t8("#1 is #2", $description, $self->customer->displayable_name)
|
|
148 |
: $config->type eq 'vendor' ? t8("#1 is #2", $description, $self->vendor->displayable_name)
|
|
149 |
: $config->type eq 'part' ? t8("#1 is #2", $description, $self->part->displayable_name)
|
|
150 |
: $config->type eq 'number' ? (
|
|
151 |
$op eq 'eq' ? t8('#1 equals #2', $description, $self->value_num_as_number)
|
|
152 |
: $op eq 'lt' ? t8('#1 less than #2', $description, $self->value_num_as_number)
|
|
153 |
: $op eq 'gt' ? t8('#1 more than #2', $description, $self->value_num_as_number)
|
|
154 |
: $op eq 'le' ? t8('#1 equal or less than #2', $description, $self->value_num_as_number)
|
|
155 |
: $op eq 'ge' ? t8('#1 equal or more than #2', $description, $self->value_num_as_number)
|
|
156 |
: do { die "unknown op $op for type ", $config->type }
|
|
157 |
)
|
|
158 |
: $config->type eq 'date' ? (
|
|
159 |
$op eq 'eq' ? t8('#1 is #2', $description, $self->value_date_as_date)
|
|
160 |
: $op eq 'lt' ? t8('#1 is before #2', $description, $self->value_date_as_date)
|
|
161 |
: $op eq 'gt' ? t8('#1 is after #2', $description, $self->value_date_as_date)
|
|
162 |
: do { die "unknown op $op for type ", $config->type }
|
|
163 |
)
|
|
164 |
: do { die "unknown type " . $config->type }
|
|
165 |
);
|
|
166 |
}
|
|
167 |
|
141 |
168 |
sub validate {
|
142 |
169 |
my ($self) = @_;
|
143 |
170 |
|
PriceRule: Beschreibungen von CVar Regeln