summaryrefslogtreecommitdiff
path: root/bin/am.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/am.pl')
-rw-r--r--bin/am.pl21
1 files changed, 13 insertions, 8 deletions
diff --git a/bin/am.pl b/bin/am.pl
index 120207a0..02070cf6 100644
--- a/bin/am.pl
+++ b/bin/am.pl
@@ -436,20 +436,23 @@ sub list_account {
}
my @buttons;
- push @buttons, {
- name => 'action',
- value => 'csv_list_account',
- text => $locale->text('CSV Report'),
- type => 'submit',
- class => 'submit',
- };
+ for my $type (qw(CSV XLS ODS)) {
+ push @buttons, {
+ name => 'action',
+ value => lc "${type}_list_account",
+ text => $locale->text("$type Report"),
+ type => 'submit',
+ class => 'submit',
+ };
+ }
+ my $format = uc substr($form->{action}, 0, 3);
my $template = LedgerSMB::Template->new(
user => \%myconfig,
locale => $locale,
path => 'UI',
template => 'am-list-accounts',
- format => ($form->{action} =~ /^csv/)? 'CSV': 'HTML');
+ format => ($format ne 'LIS')? $format: 'HTML');
$template->render({
form => \%$form,
buttons => \@buttons,
@@ -460,6 +463,8 @@ sub list_account {
}
sub csv_list_account { &list_account }
+sub xls_list_account { &list_account }
+sub ods_list_account { &list_account }
sub delete_account {