From 98449c3adea004b255fce349eb28fd440458c59d Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 28 Jun 2007 03:09:53 +0000 Subject: * Fixing incorrect tax account selection issues in POS screen git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1344 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/pos.pl | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/bin/pos.pl b/bin/pos.pl index 58d98ac1..cba70d04 100755 --- a/bin/pos.pl +++ b/bin/pos.pl @@ -415,22 +415,25 @@ sub form_footer { if ( !$form->{taxincluded} ) { - my @taxes = Tax::init_taxes( $form, $form->{taxaccounts} ); - $form->{invtotal} += - Tax::calculate_taxes( \@taxes, $form, $form->{invsubtotal}, 0 ); - - foreach my $item (@taxes) { - my $taccno = $item->account; - - $form->{"${taccno}_total"} = - $form->format_amount( \%myconfig, $item->value, 2, 0 ); - - $tax .= qq| - - $form->{"${taccno}_description"} - $form->{"${taccno}_total"} - - | if $item->value; + 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"} = + $form->format_amount( \%myconfig, + $form->round_amount( $taxobj->value, 2 ), 2 ); + $tax .= qq| + + $form->{"${item}_description"} + $form->{"${item}_total"} + +|; + } } $form->{invsubtotal} = -- cgit v1.2.3