[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5460] branches/1.3



Revision: 5460
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5460&view=rev
Author:   einhverfr
Date:     2013-01-02 04:03:19 +0000 (Wed, 02 Jan 2013)
Log Message:
-----------
Fixing is_zero errors for ar/ap transactions where tax is included

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/aa.pl

Property Changed:
----------------
    branches/1.3/


Property changes on: branches/1.3
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3711-3712,5424,5446-5448,5457
   + /trunk:3711-3712,5424,5446-5448,5451,5457,5459

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2013-01-02 03:59:12 UTC (rev 5459)
+++ branches/1.3/Changelog	2013-01-02 04:03:19 UTC (rev 5460)
@@ -6,6 +6,7 @@
 * Added db list to setup.pl when no db is entered and credentials allow login
   to "postgres" db. (Chris T)
 * Added copy db utility to setup.pl for testing dbs (Chris T)
+* Fixing is_zero errors on ar/ap transaction screens w/tax incldued (Chris T)
 
 Changelog for 1.3.27
 * Detect whether ledgersmb.conf exists during Makefile.PL run and create if

Modified: branches/1.3/bin/aa.pl
===================================================================
--- branches/1.3/bin/aa.pl	2013-01-02 03:59:12 UTC (rev 5459)
+++ branches/1.3/bin/aa.pl	2013-01-02 04:03:19 UTC (rev 5460)
@@ -364,50 +364,14 @@
 
     $form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
 
-    if ( $form->{taxincluded} ) {
-        $diff = 0;
 
-        # add tax to individual amounts
-        # XXX needs alteration for conditional taxes
-        for $i ( 1 .. $form->{rowcount} ) {
-            if ($netamount) {
-                $amount = $form->{"amount_$i"} * ( 1 + $tax / $netamount );
-                $form->{"amount_$i"} = $form->round_amount( $amount, 2 );
-            }
-        }
-    }
-
-    $form->{invtotal} = $netamount + $tax;
-
     # check if calculated is equal to stored
     # taxincluded is terrible to calculate
     # this works only if all taxes are checked
 
     @taxaccounts = Tax::init_taxes( $form, $form->{taxaccounts} );
 
-    if ( $form->{id} ) {
-        if ( $form->{taxincluded} ) {
-
-            $amount =
-              Tax::calculate_taxes( ..hidden.., $form, $form->{invtotal},
-                1 );
-            $tax = $form->round_amount( $amount, 2 );
-
-        }
-        else {
-            $tax =
-              $form->round_amount(
-                Tax::calculate_taxes( ..hidden.., $form, $netamount, 0 ) );
-        }
-        foreach $item (@taxaccounts) {
-            $tax{ $item->account } = $form->round_amount( $item->value, 2 );
-            $form->{ "calctax_" . $item->account } = 1
-              if $item->value
-              and
-              ( $tax{ $item->account } == $form->{ "tax_" . $item->account } );
-        }
-    }
-    else {
+    if ( !$form->{id} ) {
         for (@taxaccounts) { $form->{ "calctax_" . $_->account } = 1 }
     }
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.