my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig);
my $arap = $params{vc} eq 'customer' ? 'ar' : 'ap';
my $vc = $params{vc} eq 'customer' ? 'customer' : 'vendor';
+ my $extra_columns = $arap eq 'ar' ? 'ar.direct_debit, ' : '';
my $query =
qq|
SELECT ${arap}.id, ${arap}.invnumber, ${arap}.${vc}_id as vc_id, ${arap}.amount AS invoice_amount, ${arap}.invoice,
- vc.name AS vcname, vc.language_id, ${arap}.duedate as duedate,
+ vc.name AS vcname, vc.language_id, ${arap}.duedate as duedate, ${extra_columns}
COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' AS vc_bank_info_ok,
return;
}
+ $_->{checked} = $_->{direct_debit} for @{ $invoices };
+
my $bank_account_label_sub = sub { $locale->text('Account number #1, bank code #2, #3', $_[0]->{account_number}, $_[0]->{bank_code}, $_[0]->{bank}) };
my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx');
<tr class="listrow[% loop.count % 2 %]">
<td align="center">
[%- IF invoice.vc_bank_info_ok %]
- <input type="checkbox" name="bank_transfers[].selected" value="1">
+ <input type="checkbox" name="bank_transfers[].selected" value="1"[% IF invoice.checked %] checked[% END %]>
[%- END %]
</td>
<td>