From 171bd4e6f2e17ab078a53c70f7ab6fea3ed4b65d Mon Sep 17 00:00:00 2001 From: tetragon Date: Fri, 19 Oct 2007 23:28:25 +0000 Subject: Some fixes to the aging report templating git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1798 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/rp.pl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'bin/rp.pl') diff --git a/bin/rp.pl b/bin/rp.pl index 38da89eb..9bb230d9 100644 --- a/bin/rp.pl +++ b/bin/rp.pl @@ -1516,7 +1516,7 @@ sub aging { if ( @{ $form->{all_language} } && $form->{arap} eq 'ar' ) { push @column_index, "language"; - $form->{language_options} = []; + $form->{language_options} = [{text => ' ', value => ''}]; for ( @{ $form->{all_language} } ) { push @{$form->{language_options}}, @@ -1611,7 +1611,7 @@ sub aging { } - push @currencies, {}; + unshift @currencies, {}; $curr = $ref->{curr}; $currencies[0]{curr} = $curr; } @@ -1619,18 +1619,17 @@ sub aging { $k++; my %column_data; - if ( $ctid != $ref->{ctid} ) { - + if ( $ctid != $ref->{ctid} or $form->{summary}) { $i++; $column_data{ct} = $ref->{name}; - + $column_data{language} = { name => "language_code_$i", options => $form->{language_options}, default_value => $ref->{language_code}, } if $form->{language_options}; - + $column_data{statement} = { name => "statement_$i", type => 'checkbox', @@ -1639,9 +1638,9 @@ sub aging { $column_data{statement}{checked} = 'checked' if $ref->{checked}; $hiddens{"$form->{ct}_id_$i"} = $ref->{ctid}; $hiddens{"curr_$i"} = $ref->{curr}; - } + $ctid = $ref->{ctid}; for (qw(c0 c30 c60 c90)) { @@ -1689,13 +1688,16 @@ qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{ $j++; $j %= 2; $column_data{i} = $j; + my $rowref = {}; + $rowref->{$_} = $column_data{$_} for keys %column_data; - push @{$currencies[0]{rows}}, \%column_data; + push @{$currencies[0]{rows}}, $rowref; for (qw(ct statement language)) { $column_data{$_} = ' '; } } + $column_data{ct} = $ref->{name}; # prepare subtotal $nextid = ( $k <= $l ) ? $form->{AG}->[$k]->{ctid} : 0; @@ -1994,6 +1996,7 @@ sub print { } my @batch_data = (); + my $selected; for $i ( 1 .. $form->{rowcount} ) { -- cgit v1.2.3