use SL::Locale::String qw(t8);
my @types = qw(
- part customer vendor business partsgroup qty reqdate pricegroup
+ part customer vendor business partsgroup qty reqdate transdate pricegroup
);
my %ops = (
'vendor' => { description => t8('Vendor'), customer => 0, vendor => 1, data_type => 'int', data => sub { $_[0]->vendor->id }, },
'business' => { description => t8('Type of Business'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[0]->customervendor->business_id }, exclude_nulls => 1 },
'reqdate' => { description => t8('Reqdate'), customer => 1, vendor => 1, data_type => 'date', data => sub { $_[0]->reqdate }, ops => 'date' },
+ 'transdate' => { description => t8('Transdate'), customer => 1, vendor => 1, data_type => 'date', data => sub { $_[0]->transdate }, ops => 'date' },
'part' => { description => t8('Part'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->part->id }, },
'pricegroup' => { description => t8('Pricegroup'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->pricegroup_id }, exclude_nulls => 1 },
'partsgroup' => { description => t8('Group'), customer => 1, vendor => 1, data_type => 'int', data => sub { $_[1]->part->partsgroup_id }, exclude_nulls => 1 },
return $_[0]->value_date > $_[1]{record}->reqdate;
}
}
+sub match_transdate {
+ if ($_[0]->op eq 'eq') {
+ return $_[0]->value_date == $_[1]{record}->transdate;
+ } elsif ($_[0]->op eq 'lt') {
+ return $_[0]->value_date < $_[1]{record}->transdate;
+ } elsif ($_[0]->op eq 'gt') {
+ return $_[0]->value_date > $_[1]{record}->transdate;
+ }
+}
sub match_pricegroup {
$_[0]->value_int == $_[1]{record_item}->customervendor->pricegroup_id;
}
: $op eq 'lt' ? t8('Reqdate is before #1', $self->value_date_as_date)
: $op eq 'gt' ? t8('Reqdate is after #1', $self->value_date_as_date)
: do { die "unknown op $op for type $type" } )
+ : $type eq 'transdate' ? (
+ $op eq 'eq' ? t8('Transdate is #1', $self->value_date_as_date)
+ : $op eq 'lt' ? t8('Transdate is before #1', $self->value_date_as_date)
+ : $op eq 'gt' ? t8('Transdate is after #1', $self->value_date_as_date)
+ : do { die "unknown op $op for type $type" } )
: do { die "unknown type $type" }
}
'Transactions without reference:' => 'Buchungen ohne Referenz:',
'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen',
'Transdate' => 'Belegdatum',
+ 'Transdate is #1' => 'Belegdatum ist #1',
+ 'Transdate is after #1' => 'Belegdatum ist nach #1',
+ 'Transdate is before #1' => 'Belegdatum ist vor #1',
'Transfer' => 'Umlagern',
'Transfer Quantity' => 'Umlagermenge',
'Transfer To Stock' => 'Lagereingang',
[% '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) %]
[% CASE 'reqdate' %]
[% '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) %]
+ [% CASE 'transdate' %]
+ [% '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) %]
[% CASE 'pricegroup' %]
[% 'Pricegroup' | $T8 %] [% 'is' | $T8 %] [% L.select_tag('price_rule.items[].value_int', SELF.pricegroups, title_key='pricegroup', default=item.value_int) %]
[% CASE %]