Revision 034ba526
Von Jan Büren vor etwa 7 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
291 | 291 |
'bank_transactions/create_invoice', |
292 | 292 |
{ layout => 0 }, |
293 | 293 |
title => t8('Create invoice'), |
294 |
TEMPLATES_GL => $use_vendor_filter ? undef : $templates_gl, |
|
294 |
TEMPLATES_GL => $use_vendor_filter && @{ $templates_ap } ? undef : $templates_gl,
|
|
295 | 295 |
TEMPLATES_AP => $templates_ap, |
296 |
vendor_name => $use_vendor_filter ? $vendor_of_transaction->name : undef, |
|
296 |
vendor_name => $use_vendor_filter && @{ $templates_ap } ? $vendor_of_transaction->name : undef,
|
|
297 | 297 |
); |
298 | 298 |
} |
299 | 299 |
|
... | ... | |
328 | 328 |
|
329 | 329 |
$self->{transaction} = SL::DB::Manager::BankTransaction->find_by(id => $::form->{bt_id}); |
330 | 330 |
|
331 |
my @filter; |
|
332 |
push @filter, ('vendor.name' => { ilike => '%' . $::form->{vendor} . '%' }) if $::form->{vendor}; |
|
333 |
push @filter, ('template_name' => { ilike => '%' . $::form->{template} . '%' }) if $::form->{template}; |
|
334 |
push @filter, ('reference' => { ilike => '%' . $::form->{reference} . '%' }) if $::form->{reference}; |
|
331 |
my (@filter, @filter_ap); |
|
335 | 332 |
|
336 |
my $templates_ap = SL::DB::Manager::RecordTemplate->get_all( |
|
337 |
where => [ template_type => 'ap_transaction', (and => \@filter) x !!@filter ], |
|
338 |
with_objects => [ qw(employee vendor) ], |
|
339 |
); |
|
333 |
# filter => gl and ap | filter_ap = ap (i.e. vendorname) |
|
334 |
push @filter, ('template_name' => { ilike => '%' . $::form->{template} . '%' }) if $::form->{template}; |
|
335 |
push @filter, ('reference' => { ilike => '%' . $::form->{reference} . '%' }) if $::form->{reference}; |
|
336 |
push @filter_ap, ('vendor.name' => { ilike => '%' . $::form->{vendor} . '%' }) if $::form->{vendor}; |
|
337 |
push @filter_ap, @filter; |
|
340 | 338 |
my $templates_gl = SL::DB::Manager::RecordTemplate->get_all( |
341 | 339 |
query => [ template_type => 'gl_transaction', |
342 | 340 |
chart_id => SL::DB::Manager::BankAccount->find_by(id => $self->transaction->local_bank_account_id)->chart_id, |
... | ... | |
345 | 343 |
with_objects => [ qw(employee record_template_items) ], |
346 | 344 |
); |
347 | 345 |
|
346 |
my $templates_ap = SL::DB::Manager::RecordTemplate->get_all( |
|
347 |
where => [ template_type => 'ap_transaction', (and => \@filter_ap) x !!@filter_ap ], |
|
348 |
with_objects => [ qw(employee vendor) ], |
|
349 |
); |
|
348 | 350 |
$::form->{filter} //= {}; |
349 | 351 |
|
350 | 352 |
$self->callback($self->url_for( |
Auch abrufbar als: Unified diff
Kontauszug verbuchen -> Buchung erstellen: Filter-Option verbessert
Eine Filter-Option schließt sich für ar/gl aus und die
Annahme, dass es auch Vorlagen zum Kreditor gibt, wenn wir eine
IBAN-Übereinstimmung haben ist auch zu kurz gegriffen,
geprüft wird jetzt IBAN + Vorlage