Revision 3b18f3f0
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
178 | 178 |
$self->{transaction} = SL::DB::Manager::BankTransaction->find_by(id => $::form->{bt_id}); |
179 | 179 |
my $vendor_of_transaction = SL::DB::Manager::Vendor->find_by(account_number => $self->{transaction}->{remote_account_number}); |
180 | 180 |
|
181 |
my $use_vendor_filter = $self->{transaction}->{remote_account_number} && $vendor_of_transaction; |
|
182 |
|
|
181 | 183 |
my $drafts = SL::DB::Manager::Draft->get_all(where => [ module => 'ap'] , with_objects => 'employee'); |
182 | 184 |
|
183 | 185 |
my @filtered_drafts; |
... | ... | |
191 | 193 |
} |
192 | 194 |
|
193 | 195 |
#Filter drafts |
194 |
@filtered_drafts = grep { $_->{vendor_id} == $vendor_of_transaction->id } @filtered_drafts if $vendor_of_transaction && $self->{transaction}->{remote_account_number};
|
|
196 |
@filtered_drafts = grep { $_->{vendor_id} == $vendor_of_transaction->id } @filtered_drafts if $use_vendor_filter;
|
|
195 | 197 |
|
196 | 198 |
my $all_vendors = SL::DB::Manager::Vendor->get_all(); |
197 | 199 |
|
198 | 200 |
$self->render('bank_transactions/create_invoice', { layout => 0 }, |
199 | 201 |
title => t8('Create invoice'), |
200 | 202 |
DRAFTS => \@filtered_drafts, |
201 |
vendor_id => $vendor_of_transaction ? $vendor_of_transaction->id : undef,
|
|
202 |
vendor_name => $vendor_of_transaction ? $vendor_of_transaction->name : undef,
|
|
203 |
vendor_id => $use_vendor_filter ? $vendor_of_transaction->id : undef,
|
|
204 |
vendor_name => $use_vendor_filter ? $vendor_of_transaction->name : undef,
|
|
203 | 205 |
ALL_VENDORS => $all_vendors, |
204 | 206 |
limit => $myconfig{vclimit}, |
205 | 207 |
callback => $self->url_for(action => 'list', |
Auch abrufbar als: Unified diff
BankTransaction: Filter aus letztem Commit auch nicht vorbelegen