my $form = $main::form;
my $locale = $main::locale;
+ my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
my @export_ids = map { $_->{id} } grep { $_->{selected} } @{ $form->{exports} || [] };
my @open_export_ids = ();
foreach my $id (@export_ids) {
- my $export = SL::SEPA->retrieve_export('id' => $id);
+ my $export = SL::SEPA->retrieve_export('id' => $id, vc => $vc);
push @open_export_ids, $id if (!$export->{closed});
}
$form->{title} = $locale->text('Close SEPA exports');
$form->header();
- print $form->parse_html_template('sepa/bank_transfer_mark_as_closed_step1', { 'OPEN_EXPORT_IDS' => \@open_export_ids });
+ print $form->parse_html_template('sepa/bank_transfer_mark_as_closed_step1', { 'OPEN_EXPORT_IDS' => \@open_export_ids, vc => $vc });
$main::lxdebug->leave_sub();
}
+# TODO
sub bank_transfer_mark_as_closed_step2 {
$main::lxdebug->enter_sub();
'Display' => 'Anzeigen',
'Display file' => 'Datei anzeigen',
'Display options' => 'Anzeigeoptionen',
+ 'Do you really want to close the following SEPA exports? No payment will be recorded for bank collections that haven\'t been marked as executed yet.' => 'Wollen Sie wirklich die folgenden SEPA-Exporte abschließen? Für Überweisungen, die noch nicht gebucht wurden, werden dann keine Zahlungen verbucht.',
'Do you really want to close the following SEPA exports? No payment will be recorded for bank transfers that haven\'t been marked as executed yet.' => 'Wollen Sie wirklich die folgenden SEPA-Exporte abschließen? Für Überweisungen, die noch nicht gebucht wurden, werden dann keine Zahlungen verbucht.',
'Do you really want to delete AP transaction #1?' => 'Wollen Sie wirklich die Kreditorenbuchung #1 löschen?',
'Do you really want to delete AR transaction #1?' => 'Wollen Sie wirklich die Debitorenbuchung #1 löschen?',
<form action="sepa.pl" method="post">
<p>
- [%- 'Do you really want to close the following SEPA exports? No payment will be recorded for bank transfers that haven\'t been marked as executed yet.' | $T8 %]
+ [%- IF vc == 'vendor' %]
+ [%- 'Do you really want to close the following SEPA exports? No payment will be recorded for bank transfers that haven\'t been marked as executed yet.' | $T8 %]
+ [%- ELSE %]
+ [%- 'Do you really want to close the following SEPA exports? No payment will be recorded for bank collections that haven\'t been marked as executed yet.' | $T8 %]
+ [%- END %]
</p>
<p>
[%- FOREACH id = OPEN_EXPORT_IDS %]
[%- UNLESS loop.first %], [%- END %]
<input type="hidden" name="open_export_ids[]" value="[% HTML.escape(id) %]">
- <a href="sepa.pl?action=bank_transfer_edit&id=[% HTML.url(id) %]">[% HTML.escape(id) %]</a>
+ <a href="sepa.pl?action=bank_transfer_edit&id=[% HTML.url(id) %]&vc=[% HTML.url(vc) %]">[% HTML.escape(id) %]</a>
[%- END %]
</p>
</p>
<input type="hidden" name="action" value="dispatcher">
+ <input type="hidden" name="vc" value="[%- HTML.escape(vc) %]">
</form>
</body>