summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-28 03:09:35 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-28 03:09:35 +0000
commit6948594e039c9c270bd2b71961b7818fa214eb2f (patch)
tree0c5627b92ae75dae9a6bdd63f2c499b162642655
parentcc3e76ec7c4747efe2817218c3bc11a745fa5b0a (diff)
Fixing incorrect tax account selection issues in POS screen
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1343 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--bin/pos.pl35
1 files changed, 19 insertions, 16 deletions
diff --git a/bin/pos.pl b/bin/pos.pl
index cb37f7d3..dd7fb46f 100644
--- a/bin/pos.pl
+++ b/bin/pos.pl
@@ -419,22 +419,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|
- <tr>
- <th align=right>$form->{"${taccno}_description"}</th>
- <td align=right>$form->{"${taccno}_total"}</td>
- </tr>
- | 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|
+ <tr>
+ <th align=right>$form->{"${item}_description"}</th>
+ <td align=right>$form->{"${item}_total"}</td>
+ </tr>
+|;
+ }
}
$form->{invsubtotal} =