104 |
104 |
map { $_ => "SL::DB::Manager::$class" } @{ $RECORD_TYPES_INFO{$_}->{types} }
|
105 |
105 |
} keys %RECORD_TYPES_INFO;
|
106 |
106 |
my @ALL_RECORD_TYPES = map { @{ $RECORD_TYPES_INFO{$_}->{types} } } keys %RECORD_TYPES_INFO;
|
|
107 |
my %RECORD_TYPE_TO_NR_KEY =
|
|
108 |
map {
|
|
109 |
my $model = $RECORD_TYPE_TO_MODEL{$_};
|
|
110 |
if (any {$model eq $_} qw(SL::DB::Invoice SL::DB::PurchaseInvoice)) {
|
|
111 |
$_ => 'invnumber';
|
|
112 |
} else {
|
|
113 |
my $type_data = SL::DB::Helper::TypeDataProxy->new($model, $_);
|
|
114 |
$_ => $type_data->properties('nr_key');
|
|
115 |
}
|
|
116 |
} @ALL_RECORD_TYPES;
|
107 |
117 |
|
108 |
118 |
# has do be done at runtime for translation to work
|
109 |
119 |
sub get_record_types_with_info {
|
... | ... | |
186 |
196 |
$record_types,
|
187 |
197 |
customer_vendor_type => $cv_type,
|
188 |
198 |
customer_vendor_id => $customer_vendor && $customer_vendor->id,
|
189 |
|
with_closed => 0,
|
|
199 |
record_number => '',
|
|
200 |
with_closed => 0,
|
190 |
201 |
);
|
191 |
202 |
|
192 |
203 |
$self->setup_show_action_bar;
|
... | ... | |
205 |
216 |
my ($self, $record_types, %params) = @_;
|
206 |
217 |
$record_types = [ $record_types ] unless ref $record_types eq 'ARRAY';
|
207 |
218 |
|
208 |
|
my $cv_type = $params{customer_vendor_type};
|
209 |
|
my $cv_id = $params{customer_vendor_id};
|
210 |
|
my $with_closed = $params{with_closed};
|
|
219 |
my $cv_type = $params{customer_vendor_type};
|
|
220 |
my $cv_id = $params{customer_vendor_id};
|
|
221 |
my $record_number = $params{record_number};
|
|
222 |
my $with_closed = $params{with_closed};
|
211 |
223 |
|
212 |
224 |
my @records = ();
|
213 |
225 |
foreach my $record_type (@$record_types) {
|
... | ... | |
217 |
229 |
if ($cv_type && $cv_id) {
|
218 |
230 |
$additional_where{"${cv_type}_id"} = $cv_id;
|
219 |
231 |
}
|
|
232 |
if ($record_number) {
|
|
233 |
my $nr_key = $RECORD_TYPE_TO_NR_KEY{$record_type};
|
|
234 |
$additional_where{$nr_key} = { ilike => "%$record_number%" };
|
|
235 |
}
|
220 |
236 |
unless ($with_closed) {
|
221 |
237 |
if (any {$_ eq 'closed' } $model->meta->columns) {
|
222 |
238 |
$additional_where{closed} = 0;
|
... | ... | |
373 |
389 |
my ($self) = @_;
|
374 |
390 |
$::auth->assert('email_journal');
|
375 |
391 |
my $customer_vendor_type = $::form->{customer_vendor_selection};
|
376 |
|
my $customer_vendor_id = $::form->{"${customer_vendor_type}_id"};
|
377 |
|
my $record_type = $::form->{"${customer_vendor_type}_record_type_selection"};
|
378 |
|
my $with_closed = $::form->{with_closed};
|
|
392 |
my $customer_vendor_id = $::form->{"${customer_vendor_type}_id"};
|
|
393 |
my $record_type = $::form->{"${customer_vendor_type}_record_type_selection"};
|
|
394 |
my $record_number = $::form->{record_number};
|
|
395 |
my $with_closed = $::form->{with_closed};
|
379 |
396 |
|
380 |
397 |
$record_type ||= $self->record_types_for_customer_vendor_type($customer_vendor_type);
|
381 |
398 |
|
... | ... | |
383 |
400 |
$record_type,
|
384 |
401 |
customer_vendor_type => $customer_vendor_type,
|
385 |
402 |
customer_vendor_id => $customer_vendor_id,
|
|
403 |
record_number => $record_number,
|
386 |
404 |
with_closed => $with_closed,
|
387 |
405 |
);
|
388 |
406 |
|
EmailJournal: Workflow: Filter Belege nach Belegnummer