[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1343] trunk/bin/pos.pl
- Subject: SF.net SVN: ledger-smb: [1343] trunk/bin/pos.pl
- From: ..hidden..
- Date: Wed, 27 Jun 2007 20:09:35 -0700
Revision: 1343
http://svn.sourceforge.net/ledger-smb/?rev=1343&view=rev
Author: einhverfr
Date: 2007-06-27 20:09:35 -0700 (Wed, 27 Jun 2007)
Log Message:
-----------
Fixing incorrect tax account selection issues in POS screen
Modified Paths:
--------------
trunk/bin/pos.pl
Modified: trunk/bin/pos.pl
===================================================================
--- trunk/bin/pos.pl 2007-06-28 00:24:35 UTC (rev 1342)
+++ trunk/bin/pos.pl 2007-06-28 03:09:35 UTC (rev 1343)
@@ -419,22 +419,25 @@
if ( !$form->{taxincluded} ) {
- my @taxes = Tax::init_taxes( $form, $form->{taxaccounts} );
- $form->{invtotal} +=
- Tax::calculate_taxes( ..hidden.., $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} =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.