Revision 3f5c7866
Von Sven Schöling vor etwa 10 Jahren hinzugefügt
SL/DB/Manager/PriceRuleItem.pm | ||
---|---|---|
15 | 15 |
use SL::Locale::String qw(t8); |
16 | 16 |
|
17 | 17 |
my @types = qw( |
18 |
part customer vendor business partsgroup qty reqdate pricegroup |
|
18 |
part customer vendor business partsgroup qty reqdate transdate pricegroup
|
|
19 | 19 |
); |
20 | 20 |
|
21 | 21 |
my %ops = ( |
... | ... | |
28 | 28 |
'vendor' => { description => t8('Vendor'), customer => 0, vendor => 1, data_type => 'int', data => sub { $_[0]->vendor->id }, }, |
29 | 29 |
'business' => { description => t8('Type of Business'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[0]->customervendor->business_id }, exclude_nulls => 1 }, |
30 | 30 |
'reqdate' => { description => t8('Reqdate'), customer => 1, vendor => 1, data_type => 'date', data => sub { $_[0]->reqdate }, ops => 'date' }, |
31 |
'transdate' => { description => t8('Transdate'), customer => 1, vendor => 1, data_type => 'date', data => sub { $_[0]->transdate }, ops => 'date' }, |
|
31 | 32 |
'part' => { description => t8('Part'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->part->id }, }, |
32 | 33 |
'pricegroup' => { description => t8('Pricegroup'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->pricegroup_id }, exclude_nulls => 1 }, |
33 | 34 |
'partsgroup' => { description => t8('Group'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->part->partsgroup_id }, exclude_nulls => 1 }, |
SL/DB/PriceRuleItem.pm | ||
---|---|---|
58 | 58 |
return $_[0]->value_date > $_[1]{record}->reqdate; |
59 | 59 |
} |
60 | 60 |
} |
61 |
sub match_transdate { |
|
62 |
if ($_[0]->op eq 'eq') { |
|
63 |
return $_[0]->value_date == $_[1]{record}->transdate; |
|
64 |
} elsif ($_[0]->op eq 'lt') { |
|
65 |
return $_[0]->value_date < $_[1]{record}->transdate; |
|
66 |
} elsif ($_[0]->op eq 'gt') { |
|
67 |
return $_[0]->value_date > $_[1]{record}->transdate; |
|
68 |
} |
|
69 |
} |
|
61 | 70 |
sub match_pricegroup { |
62 | 71 |
$_[0]->value_int == $_[1]{record_item}->customervendor->pricegroup_id; |
63 | 72 |
} |
... | ... | |
113 | 122 |
: $op eq 'lt' ? t8('Reqdate is before #1', $self->value_date_as_date) |
114 | 123 |
: $op eq 'gt' ? t8('Reqdate is after #1', $self->value_date_as_date) |
115 | 124 |
: do { die "unknown op $op for type $type" } ) |
125 |
: $type eq 'transdate' ? ( |
|
126 |
$op eq 'eq' ? t8('Transdate is #1', $self->value_date_as_date) |
|
127 |
: $op eq 'lt' ? t8('Transdate is before #1', $self->value_date_as_date) |
|
128 |
: $op eq 'gt' ? t8('Transdate is after #1', $self->value_date_as_date) |
|
129 |
: do { die "unknown op $op for type $type" } ) |
|
116 | 130 |
: do { die "unknown type $type" } |
117 | 131 |
} |
118 | 132 |
|
locale/de/all | ||
---|---|---|
2779 | 2779 |
'Transactions without reference:' => 'Buchungen ohne Referenz:', |
2780 | 2780 |
'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen', |
2781 | 2781 |
'Transdate' => 'Belegdatum', |
2782 |
'Transdate is #1' => 'Belegdatum ist #1', |
|
2783 |
'Transdate is after #1' => 'Belegdatum ist nach #1', |
|
2784 |
'Transdate is before #1' => 'Belegdatum ist vor #1', |
|
2782 | 2785 |
'Transfer' => 'Umlagern', |
2783 | 2786 |
'Transfer Quantity' => 'Umlagermenge', |
2784 | 2787 |
'Transfer To Stock' => 'Lagereingang', |
templates/webpages/price_rule/item.html | ||
---|---|---|
31 | 31 |
[% 'Quantity' | $T8 %] [% L.select_tag('price_rule.items[].op', num_compare_ops, default=item.op) %] [% L.input_tag('price_rule.items[].value_num_as_number', item.value_num_as_number) %] |
32 | 32 |
[% CASE 'reqdate' %] |
33 | 33 |
[% 'Reqdate' | $T8 %] [% L.select_tag('price_rule.items[].op', date_compare_ops, default=item.op) %] [% L.date_tag('price_rule.items[].value_date', item.value_date) %] |
34 |
[% CASE 'transdate' %] |
|
35 |
[% 'Transdate' | $T8 %] [% L.select_tag('price_rule.items[].op', date_compare_ops, default=item.op) %] [% L.date_tag('price_rule.items[].value_date', item.value_date) %] |
|
34 | 36 |
[% CASE 'pricegroup' %] |
35 | 37 |
[% 'Pricegroup' | $T8 %] [% 'is' | $T8 %] [% L.select_tag('price_rule.items[].value_int', SELF.pricegroups, title_key='pricegroup', default=item.value_int) %] |
36 | 38 |
[% CASE %] |
Auch abrufbar als: Unified diff
PriceRule: Belegdatum als Kriterium hinzugefügt