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

SF.net SVN: ledger-smb: [1485] branches/1.2



Revision: 1485
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1485&view=rev
Author:   einhverfr
Date:     2007-09-01 00:36:27 -0700 (Sat, 01 Sep 2007)

Log Message:
-----------
Preventing AR-Transaction screen from calculating sales tax since it doesn't have enough info to do so safely.

Modified Paths:
--------------
    branches/1.2/LedgerSMB/IR.pm
    branches/1.2/LedgerSMB/IS.pm
    branches/1.2/bin/aa.pl

Modified: branches/1.2/LedgerSMB/IR.pm
===================================================================
--- branches/1.2/LedgerSMB/IR.pm	2007-09-01 06:57:01 UTC (rev 1484)
+++ branches/1.2/LedgerSMB/IR.pm	2007-09-01 07:36:27 UTC (rev 1485)
@@ -123,9 +123,10 @@
             &reverse_invoice( $dbh, $form );
         }
         else {
-            $query = qq|INSERT INTO ap (id) VALUES (?)|;
+            $query = qq|INSERT INTO ap (id, vendor_id) VALUES (?, ?)|;
             $sth   = $dbh->prepare($query);
-            $sth->execute( $form->{id} ) || $form->dberror($query);
+            $sth->execute( $form->{id}, $form->{vendor_id} ) 
+		|| $form->dberror($query);
         }
     }
 
@@ -135,11 +136,12 @@
     if ( !$form->{id} ) {
 
         $query = qq|
-			INSERT INTO ap (invnumber, employee_id)
-			VALUES ('$uid', (SELECT id FROM employee
+			INSERT INTO ap (invnumber, vendor_id, employee_id)
+			VALUES ('$uid', ?, (SELECT id FROM employee
 			                  WHERE login = ?))|;
         $sth = $dbh->prepare($query);
-        $sth->execute( $form->{login} ) || $form->dberror($query);
+        $sth->execute( $form->{vendor_id}, $form->{login}) 
+		|| $form->dberror($query);
 
         $query = qq|SELECT id FROM ap WHERE invnumber = '$uid'|;
         $sth   = $dbh->prepare($query);

Modified: branches/1.2/LedgerSMB/IS.pm
===================================================================
--- branches/1.2/LedgerSMB/IS.pm	2007-09-01 06:57:01 UTC (rev 1484)
+++ branches/1.2/LedgerSMB/IS.pm	2007-09-01 07:36:27 UTC (rev 1485)
@@ -854,9 +854,10 @@
             &reverse_invoice( $dbh, $form );
         }
         else {
-            $query = qq|INSERT INTO ar (id) VALUES (?)|;
+            $query = qq|INSERT INTO ar (id, customer_id) VALUES (?, ?)|;
             $sth   = $dbh->prepare($query);
-            $sth->execute( $form->{id} ) || $form->dberror($query);
+            $sth->execute( $form->{id}, $form->{customer_id} ) 
+		|| $form->dberror($query);
         }
 
     }
@@ -867,10 +868,11 @@
     if ( !$form->{id} ) {
 
         $query = qq|
-			INSERT INTO ar (invnumber, employee_id) 
-			     VALUES ('$uid', ?)|;
+			INSERT INTO ar (invnumber, customer_id, employee_id) 
+			     VALUES ('$uid', ?, ?)|;
         $sth = $dbh->prepare($query);
-        $sth->execute( $form->{employee_id} ) || $form->dberror($query);
+        $sth->execute( $form->{customer_id}, $form->{employee_id} ) 
+		|| $form->dberror($query);
 
         $query = qq|SELECT id FROM ar WHERE invnumber = '$uid'|;
         $sth   = $dbh->prepare($query);

Modified: branches/1.2/bin/aa.pl
===================================================================
--- branches/1.2/bin/aa.pl	2007-09-01 06:57:01 UTC (rev 1484)
+++ branches/1.2/bin/aa.pl	2007-09-01 07:36:27 UTC (rev 1485)
@@ -966,29 +966,7 @@
     }
 
     @taxaccounts = Tax::init_taxes( $form, $form->{taxaccounts} );
-    if ( $form->{taxincluded} ) {
-        $totaltax =
-          Tax::calculate_taxes( ..hidden.., $form, $form->{invtotal}, 1 );
-    }
-    else {
-        $totaltax =
-          Tax::calculate_taxes( ..hidden.., $form, $form->{invtotal}, 0 );
-    }
-    foreach $item (@taxaccounts) {
-        $taccno = $item->account;
-        if ( $form->{calctax} ) {
-            $form->{"calctax_$taccno"} = 1;
-            $form->{"tax_$taccno"} = $form->round_amount( $item->value, 2 );
-        }
-        $form->{"select$form->{ARAP}_tax_$taccno"} =
-          qq|<option>$taccno--$form->{"${taccno}_description"}|;
-    }
 
-    $form->{invtotal} =
-      ( $form->{taxincluded} )
-      ? $form->{invtotal}
-      : $form->{invtotal} + $totaltax;
-
     $j = 1;
     for $i ( 1 .. $form->{paidaccounts} ) {
         if ( $form->{"paid_$i"} ) {


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