summaryrefslogtreecommitdiff
path: root/bin/gl.pl
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 15:46:25 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-11 15:46:25 +0000
commit9dca25618c909737218f038abedcec5e123b2784 (patch)
treeb27d4983bf0621ca39d378cdb35e71f1bf3335a1 /bin/gl.pl
parenta902742de42f64f5bce3f9449247fc75414e8f84 (diff)
Fixing "options" display
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1565 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin/gl.pl')
-rw-r--r--bin/gl.pl54
1 files changed, 20 insertions, 34 deletions
diff --git a/bin/gl.pl b/bin/gl.pl
index 11476444..d75bac43 100644
--- a/bin/gl.pl
+++ b/bin/gl.pl
@@ -452,6 +452,7 @@ sub generate_report {
'I' => $locale->text('Income'),
'E' => $locale->text('Expense'),
);
+ my @options;
$form->{title} = $locale->text('General Ledger');
@@ -464,98 +465,83 @@ sub generate_report {
if ( $form->{accno} ) {
$href .= "&accno=" . $form->escape( $form->{accno} );
$callback .= "&accno=" . $form->escape( $form->{accno}, 1 );
- $option =
- $locale->text('Account')
+ push @options, $locale->text('Account')
. " : $form->{accno} $form->{account_description}";
}
if ( $form->{gifi_accno} ) {
$href .= "&gifi_accno=" . $form->escape( $form->{gifi_accno} );
$callback .= "&gifi_accno=" . $form->escape( $form->{gifi_accno}, 1 );
- $option .= "\n<br>" if $option;
- $option .=
- $locale->text('GIFI')
+ push @options, $locale->text('GIFI')
. " : $form->{gifi_accno} $form->{gifi_account_description}";
}
if ( $form->{source} ) {
$href .= "&source=" . $form->escape( $form->{source} );
$callback .= "&source=" . $form->escape( $form->{source}, 1 );
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Source') . " : $form->{source}";
+ push @options, $locale->text('Source') . " : $form->{source}";
}
if ( $form->{memo} ) {
$href .= "&memo=" . $form->escape( $form->{memo} );
$callback .= "&memo=" . $form->escape( $form->{memo}, 1 );
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Memo') . " : $form->{memo}";
+ push @options, $locale->text('Memo') . " : $form->{memo}";
}
if ( $form->{reference} ) {
$href .= "&reference=" . $form->escape( $form->{reference} );
$callback .= "&reference=" . $form->escape( $form->{reference}, 1 );
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Reference') . " : $form->{reference}";
+ push @options, $locale->text('Reference') . " : $form->{reference}";
}
if ( $form->{department} ) {
$href .= "&department=" . $form->escape( $form->{department} );
$callback .= "&department=" . $form->escape( $form->{department}, 1 );
($department) = split /--/, $form->{department};
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Department') . " : $department";
+ push @options, $locale->text('Department') . " : $department";
}
if ( $form->{description} ) {
$href .= "&description=" . $form->escape( $form->{description} );
$callback .= "&description=" . $form->escape( $form->{description}, 1 );
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Description') . " : $form->{description}";
+ push @options, $locale->text('Description') . " : $form->{description}";
}
if ( $form->{notes} ) {
$href .= "&notes=" . $form->escape( $form->{notes} );
$callback .= "&notes=" . $form->escape( $form->{notes}, 1 );
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Notes') . " : $form->{notes}";
+ push @options, $locale->text('Notes') . " : $form->{notes}";
}
if ( $form->{datefrom} ) {
$href .= "&datefrom=$form->{datefrom}";
$callback .= "&datefrom=$form->{datefrom}";
- $option .= "\n<br>" if $option;
- $option .=
- $locale->text('From') . " "
+ push @options, $locale->text('From') . " "
. $locale->date( \%myconfig, $form->{datefrom}, 1 );
}
if ( $form->{dateto} ) {
$href .= "&dateto=$form->{dateto}";
$callback .= "&dateto=$form->{dateto}";
+ my $option = $locale->text('To') . " "
+ . $locale->date( \%myconfig, $form->{dateto}, 1 );
if ( $form->{datefrom} ) {
- $option .= " ";
+ $options[$#options] .= " $option";
}
else {
- $option .= "\n<br>" if $option;
+ push @options, $option;
}
- $option .=
- $locale->text('To') . " "
- . $locale->date( \%myconfig, $form->{dateto}, 1 );
}
if ( $form->{amountfrom} ) {
$href .= "&amountfrom=$form->{amountfrom}";
$callback .= "&amountfrom=$form->{amountfrom}";
- $option .= "\n<br>" if $option;
- $option .=
- $locale->text('Amount') . " >= "
+ push @options, $locale->text('Amount') . " >= "
. $form->format_amount( \%myconfig, $form->{amountfrom}, 2 );
}
if ( $form->{amountto} ) {
$href .= "&amountto=$form->{amountto}";
$callback .= "&amountto=$form->{amountto}";
+ my $option .= $form->format_amount( \%myconfig, $form->{amountto}, 2 );
if ( $form->{amountfrom} ) {
- $option .= " <= ";
+ $options[$#options] .= " <= $option";
}
else {
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Amount') . " <= ";
+ push @options, $locale->text('Amount') . " <= $option";
}
- $option .= $form->format_amount( \%myconfig, $form->{amountto}, 2 );
}
@columns =
@@ -803,9 +789,9 @@ sub generate_report {
);
}
$template->render({
- form => $form,
+ form => \%$form,
buttons => \@buttons,
- options => $option,
+ options => \@options,
columns => \@column_index,
heading => \%column_header,
rows => \@rows,