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

SF.net SVN: ledger-smb: [1488] trunk/LedgerSMB/CT.pm



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

Log Message:
-----------
Creating customers now works.

Modified Paths:
--------------
    trunk/LedgerSMB/CT.pm

Modified: trunk/LedgerSMB/CT.pm
===================================================================
--- trunk/LedgerSMB/CT.pm	2007-09-01 16:01:34 UTC (rev 1487)
+++ trunk/LedgerSMB/CT.pm	2007-09-01 16:57:07 UTC (rev 1488)
@@ -212,55 +212,10 @@
     
     # this should really all be replaced by an upsert.
     if ( $form->{id} ) {
-        $query = qq|
-		DELETE FROM $form->{vc}tax
-		 WHERE entity_id = 
-		        (select entity_id from $form->{vc} 
-		         WHERE id = ?)|;
+        # This module is depricated, so we are just going to throw an error here
+        $form->error("Updating $form->{vc} not supported.  ".
+		"Please wait for us to move to the new codebase.");
 
-        $sth = $dbh->prepare($query);
-        $sth->execute( $form->{id} ) || $form->dberror($query);
-
-        $query = qq|
-			SELECT id 
-			  FROM $form->{vc}
-			 WHERE id = ?|;
-
-        $sth = $dbh->prepare($query);
-        $sth->execute( $form->{id} ) || $form->dberror($query);
-
-        if ( $sth->fetchrow_array ) {
-            $sth->finish;
-            $query = qq|
-		UPDATE enti
-		SET discount = ?
-			taxincluded = ?
-			creditlimit = ?
-			terms = ?
-			$form->{vc}number = ?
-			cc = ?
-			bcc = ?
-			business_id = ?
-			sic_code = ?
-			language_code = ?
-			pricegroup_id = ?
-			curr = ?
-			startdate = ?
-			enddate = ?
-			bic = ?
-			iban = ?
-		WHERE id = ?|;
-            $sth = $dbh->prepare($query);
-            $sth->execute(
-                $form->{discount}, $form->{taxincluded}, $form->{creditlimit},
-                $form->{terms}, $form->{"$form->{vc}number"}, $form->{cc},
-                $form->{bcc}, $form->{business_id}, $form->{sic_code}, 
-                $form->{language_code}, $form->{pricegroup_id},
-                $form->{curr}, $form->{startdate}, $form->{enddate},
-                $form->{bic}, $form->{iban}, $form->{id}
-            ) || $form->dberror(__FILE__.":".__LINE__.":$query");
-            $updated = 1;
-        }
     }
     if (!$updated){
             # Creating Entity
@@ -307,7 +262,6 @@
                   $form->{taxnumber},
                   $form->{sic_code});
             # Creating entity_metadata record, replacing customer and vendor.
-            
             $query = qq|
     		INSERT INTO entity_credit_account
     			(entity_id, entity_class, discount, taxincluded, creditlimit, 
@@ -350,7 +304,7 @@
     my $query;
     my $sth;
     my $null;
-
+    $form->{vc} = 'customer';
     # remove double spaces
     $form->{name} =~ s/  / /g;
 


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