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

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



Revision: 1594
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1594&view=rev
Author:   einhverfr
Date:     2007-09-13 18:20:42 -0700 (Thu, 13 Sep 2007)

Log Message:
-----------
Adding discount_terms and threshold to entity_credit_account

Modified Paths:
--------------
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Customer.sql
    trunk/sql/modules/Vendor.sql

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2007-09-14 00:37:00 UTC (rev 1593)
+++ trunk/sql/Pg-database.sql	2007-09-14 01:20:42 UTC (rev 1594)
@@ -477,6 +477,7 @@
   entity_id int not null references entity(id) ON DELETE CASCADE,
   entity_class int not null references entity_class(id) check ( entity_class in (1,2) ),
   discount numeric, 
+  discount_terms int default 0,
   taxincluded bool default 'f',
   creditlimit NUMERIC default 0,
   terms int2 default 0,
@@ -489,6 +490,7 @@
   curr char(3),
   startdate date DEFAULT CURRENT_DATE,
   enddate date,
+  threshold numeric default 0,
   PRIMARY KEY(entity_id, meta_number)
 );
 

Modified: trunk/sql/modules/Customer.sql
===================================================================
--- trunk/sql/modules/Customer.sql	2007-09-14 00:37:00 UTC (rev 1593)
+++ trunk/sql/modules/Customer.sql	2007-09-14 01:20:42 UTC (rev 1594)
@@ -27,6 +27,7 @@
     in_id int,
     
     in_discount numeric, in_taxincluded bool, in_creditlimit numeric, 
+    in_discount_terms int,
     in_terms int, in_meta_number varchar(32), in_cc text, in_bcc text, 
     in_business_id int, in_language varchar(6), in_pricegroup_id int, 
     in_curr char, in_startdate date, in_enddate date, 
@@ -35,7 +36,8 @@
     
     in_notes text, 
     
-    in_name text, in_tax_id TEXT
+    in_name text, in_tax_id TEXT,
+    in_threshold
     
 ) returns INT as $$
     
@@ -78,7 +80,9 @@
                 pricegroup_id,
                 curr,
                 startdate,
-                enddate
+                enddate,
+                discountterms,
+                threshold
             )
             VALUES (
                 new_entity_id,
@@ -95,7 +99,9 @@
                 in_pricegroup_id,
                 in_curr,
                 in_startdate,
-                in_enddate
+                in_enddate,
+                in_discount_terms,
+                in_threashold
             );
             INSERT INTO entity_bank_account (
                 entity_id,
@@ -127,7 +133,9 @@
                 pricegroup_id = in_pricegroup_id,
                 curr = in_curr,
                 startdate = in_startdate,
-                enddate = in_enddate                
+                enddate = in_enddate,
+                threshold = in_threshold,
+                discount_terms = in_discount_terms
             where entity_id = v_row.entity_id;
             
             UPDATE entity_bank_account SET
@@ -209,4 +217,4 @@
     
     select nextval('company_id_seq');
     
-$$ language 'sql';Æ
\ No newline at end of file
+$$ language 'sql';Æ

Modified: trunk/sql/modules/Vendor.sql
===================================================================
--- trunk/sql/modules/Vendor.sql	2007-09-14 00:37:00 UTC (rev 1593)
+++ trunk/sql/modules/Vendor.sql	2007-09-14 01:20:42 UTC (rev 1594)
@@ -27,6 +27,7 @@
     in_id int,
     
     in_discount numeric, in_taxincluded bool, in_creditlimit numeric, 
+    in_discount_terms int, in_threshold numeric,
     in_terms int, in_vendornumber varchar(32), in_cc text, in_bcc text, 
     in_business_id int, in_language varchar(6), in_pricegroup_id int, 
     in_curr char, in_startdate date, in_enddate date, 
@@ -78,7 +79,9 @@
                 curr,
                 startdate,
                 enddate,
-                meta_number
+                meta_number,
+                discount_terms,
+                threshold
             )
             VALUES (
                 new_entity_id,
@@ -95,7 +98,9 @@
                 in_curr,
                 in_startdate,
                 in_enddate,
-                in_vendornumber
+                in_vendornumber,
+                in_discount_terms,
+                in_threshold
             );
             INSERT INTO entity_bank_account (
                 entity_id,
@@ -127,7 +132,9 @@
                 curr = in_curr,
                 startdate = in_startdate,
                 enddate = in_enddate,
-                meta_number = in_vendornumber
+                meta_number = in_vendornumber,
+                threshold = in_threshold,
+                discount_terms = in_discount_terms
             where entity_id = v_row.entity_id;
             
             UPDATE entity_bank_account SET
@@ -277,4 +284,4 @@
     
     select nextval('company_id_seq');
     
-$$ language 'sql';
\ No newline at end of file
+$$ language 'sql';


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