summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-17 22:17:15 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-17 22:17:15 +0000
commit433010c7c3ae8f28639c12b9ffc95c204e45e7bb (patch)
treea42eecfdf5ccb7b4b00027c9408c54556477f196 /bin
parent591b94f778a19ce4e559e806b9af34fd488f2703 (diff)
Fixing sales tax display issue
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1081 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ir.pl9
-rwxr-xr-xbin/is.pl6
-rwxr-xr-xbin/oe.pl6
3 files changed, 11 insertions, 10 deletions
diff --git a/bin/ir.pl b/bin/ir.pl
index b88d7337..50c7c51f 100755
--- a/bin/ir.pl
+++ b/bin/ir.pl
@@ -484,12 +484,13 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta
if ( !$form->{taxincluded} ) {
my @taxset = Tax::init_taxes( $form, $form->{taxaccounts} );
- $form->{invtotal} +=
- $form->round_amount(
- Tax::calculate_taxes( \@taxset, $form, $form->{invsubtotal}, 0 ),
- 2 );
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,
diff --git a/bin/is.pl b/bin/is.pl
index 7bc792b6..ac2235d6 100755
--- a/bin/is.pl
+++ b/bin/is.pl
@@ -540,10 +540,10 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta
if ( !$form->{taxincluded} ) {
my @taxes = Tax::init_taxes( $form, $form->{taxaccounts} );
- $form->{invtotal} +=
- Tax::calculate_taxes( \@taxes, $form, $form->{invsubtotal}, 0 );
foreach $item (@taxes) {
my $taccno = $item->account;
+ $form->{invtotal} += $form->round_amount(
+ $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2);
$form->{"${taccno}_total"} =
$form->format_amount( \%myconfig,
$form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2 );
@@ -552,7 +552,7 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta
<th align=right>$form->{"${taccno}_description"}</th>
<td align=right>$form->{"${taccno}_total"}</td>
</tr>
- | if $item->value;
+ | if $form->{"${taccno}_base"};
}
$form->{invsubtotal} =
diff --git a/bin/oe.pl b/bin/oe.pl
index f8080bff..402563be 100755
--- a/bin/oe.pl
+++ b/bin/oe.pl
@@ -682,10 +682,10 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta
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->{invtotal} += $form->round_amount(
+ $form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2);
$form->{"${taccno}_total"} =
$form->format_amount( \%myconfig,
$form->{"${taccno}_rate"} * $form->{"${taccno}_base"}, 2 );
@@ -695,7 +695,7 @@ qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</texta
<th align=right>$form->{"${taccno}_description"}</th>
<td align=right>$form->{"${taccno}_total"}</td>
</tr>
- | if $item->value;
+ | if $form->{"${taccno}_base"};
}
$form->{invsubtotal} =