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

SF.net SVN: ledger-smb:[5451] trunk/bin/aa.pl



Revision: 5451
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5451&view=rev
Author:   einhverfr
Date:     2013-01-01 06:52:10 +0000 (Tue, 01 Jan 2013)
Log Message:
-----------
Fix for is zero errors in aa.pl

Modified Paths:
--------------
    trunk/bin/aa.pl

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2013-01-01 06:48:27 UTC (rev 5450)
+++ trunk/bin/aa.pl	2013-01-01 06:52:10 UTC (rev 5451)
@@ -349,50 +349,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.