Revision 149efbb1
Von Bernd Bleßmann vor etwa 3 Jahren hinzugefügt
SL/Controller/RecordLinks.pm | ||
---|---|---|
132 | 132 |
my $project_id = "${project}_id"; |
133 | 133 |
my $description = $self->link_type_desc->{description}; |
134 | 134 |
my $filter = $self->link_type_desc->{filter}; |
135 |
my $number = $self->link_type_desc->{number}; |
|
135 | 136 |
|
136 | 137 |
my @where = $filter && $manager->can($filter) ? $manager->$filter($self->link_type) : (); |
137 | 138 |
push @where, ("${vc}.${vc}number" => { ilike => like($::form->{vc_number}) }) if $::form->{vc_number}; |
... | ... | |
139 | 140 |
push @where, ($description => { ilike => like($::form->{transaction_description}) }) if $::form->{transaction_description}; |
140 | 141 |
push @where, ($project_id => $::form->{globalproject_id}) if $::form->{globalproject_id} && $manager->can($project_id); |
141 | 142 |
|
143 |
if ($::form->{number}) { |
|
144 |
my $class = 'SL::DB::' . $self->link_type_desc->{model}; |
|
145 |
my $col_type = ref $class->meta->column($number); |
|
146 |
if ($col_type =~ /^Rose::DB::Object::Metadata::Column::(?:Integer|Serial)$/) { |
|
147 |
push @where, ($number => $::form->{number}); |
|
148 |
} elsif ($col_type =~ /^Rose::DB::Object::Metadata::Column::Text$/) { |
|
149 |
push @where, ($number => { ilike => like($::form->{number}) }); |
|
150 |
} |
|
151 |
} |
|
152 |
|
|
142 | 153 |
my @with_objects = ($vc); |
143 | 154 |
push @with_objects, $project if $manager->can($project_id); |
144 | 155 |
|
templates/webpages/record_links/add_filter.html | ||
---|---|---|
21 | 21 |
style=style) %]</td> |
22 | 22 |
</tr> |
23 | 23 |
|
24 |
<tr> |
|
25 |
<td>[%- LxERP.t8("Record number") %]:</td> |
|
26 |
<td>[% L.input_tag('number', '', style=style) %]</td> |
|
27 |
</tr> |
|
28 |
|
|
24 | 29 |
<tr> |
25 | 30 |
<td>[%- LxERP.t8("Customer/Vendor Number") %]:</td> |
26 | 31 |
<td>[% L.input_tag('vc_number', is_sales ? SELF.object.customer.customernumber : SELF.object.vendor.vendornumber, style=style) %]</td> |
Auch abrufbar als: Unified diff
Belege verknüpfen: auch nach Belegnummer filtern können