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

SF.net SVN: ledger-smb:[2695] trunk/sql/modules



Revision: 2695
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2695&view=rev
Author:   jfkw
Date:     2009-06-17 17:51:04 +0000 (Wed, 17 Jun 2009)

Log Message:
-----------
Company.sql: Update company_save signature to entity schema.

Update sql/modules/Company.sql function company_save definition and
implementation for current entity schema. Column country_id was removed in a
previous revision.

Modified Paths:
--------------
    trunk/sql/modules/Company.sql
    trunk/sql/modules/test/Company.sql

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2009-06-17 16:52:43 UTC (rev 2694)
+++ trunk/sql/modules/Company.sql	2009-06-17 17:51:04 UTC (rev 2695)
@@ -327,7 +327,7 @@
 CREATE OR REPLACE FUNCTION company_save (
     in_id int, in_control_code text, in_entity_class int,
     in_name text, in_tax_id TEXT,
-    in_entity_id int, in_sic_code text,in_country_id_t int
+    in_entity_id int, in_sic_code text
 ) RETURNS INT AS $$
 DECLARE t_entity_id INT;
 	t_company_id INT;
@@ -355,8 +355,8 @@
 		t_entity_id := in_entity_id;
 	END IF;
 	IF t_entity_id IS NULL THEN
-		INSERT INTO entity (name, entity_class, control_code,country_id)
-		VALUES (in_name, in_entity_class, t_control_code,in_country_id_t);
+		INSERT INTO entity (name, entity_class, control_code)
+		VALUES (in_name, in_entity_class, t_control_code);
 		t_entity_id := currval('entity_id_seq');
 		END IF;
 	END IF;
@@ -364,8 +364,7 @@
 	UPDATE entity
 	SET name = in_name,
             entity_class = in_entity_class,
-	    control_code = t_control_code,
-	    country_id = in_country_id_t
+	    control_code = t_control_code
 	WHERE id = t_entity_id;
 
 

Modified: trunk/sql/modules/test/Company.sql
===================================================================
--- trunk/sql/modules/test/Company.sql	2009-06-17 16:52:43 UTC (rev 2694)
+++ trunk/sql/modules/test/Company.sql	2009-06-17 17:51:04 UTC (rev 2695)
@@ -3,7 +3,7 @@
 
 INSERT INTO test_result (test_name, success)
 SELECT 'Saving Company', 
-	company_save (NULL, 'TESTING...', 1,'TESTING', 'TESTING', NULL, '1234', 100) 
+	company_save (NULL, 'TESTING...', 1,'TESTING', 'TESTING', NULL, '1234') 
 		IS NOT NULL;
 
 


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