From 65e1d575e4fec9395074525e8f1cff8ee1899d13 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 21 Jul 2007 17:14:15 +0000 Subject: Correcting cumulative tax display issues, bug 1745757 git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1433 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/pos.pl | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'bin/pos.pl') diff --git a/bin/pos.pl b/bin/pos.pl index cba70d04..caad92a3 100755 --- a/bin/pos.pl +++ b/bin/pos.pl @@ -396,7 +396,7 @@ sub form_header { } sub form_footer { - + _calc_taxes(); $form->{invtotal} = $form->{invsubtotal}; $form->{taxincluded} = ( $form->{taxincluded} ) ? "checked" : ""; @@ -415,25 +415,17 @@ sub form_footer { if ( !$form->{taxincluded} ) { - my @taxset = Tax::init_taxes( $form, $form->{taxaccounts} ); - foreach $taxobj (@taxset) { - $item = $taxobj->account; - $form->{invtotal} += $form->round_amount( - $form->{"${item}_rate"} * $form->{"${item}_base"}, 2); - $form->{"${item}_total"} = - $form->format_amount( \%myconfig, - $form->{"${item}_rate"} * $form->{"${item}_base"}, 2 ); - if ( $form->{"${item}_base"} ) { - $form->{"${item}_total"} = + foreach $item (keys %{$form->{taxes}}) { + my $taccno = $item; + $form->{invtotal} += $form->round_amount($form->{taxes}{$item}, 2); + $form->{"${taccno}_total"} = $form->format_amount( \%myconfig, - $form->round_amount( $taxobj->value, 2 ), 2 ); + $form->round_amount( $form->{taxes}{$item}, 2 ), 2 ); $tax .= qq| $form->{"${item}_description"} $form->{"${item}_total"} - -|; - } + |; } $form->{invsubtotal} = -- cgit v1.2.3