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

SF.net SVN: ledger-smb:[4351] trunk



Revision: 4351
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4351&view=rev
Author:   einhverfr
Date:     2012-02-23 10:53:30 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
Adding Sales Tax ID (reseller cert number/VAT ID) and business license number to company tracking

Modified Paths:
--------------
    trunk/Changelog
    trunk/UI/Contact/contact.css
    trunk/UI/Contact/contact.html
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Company.sql

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-02-23 09:29:16 UTC (rev 4350)
+++ trunk/Changelog	2012-02-23 10:53:30 UTC (rev 4351)
@@ -10,6 +10,9 @@
 * Removed the Config::Std dependency and moved to Config::General (Chris T)
 * Improved error handling using Try::Tiny and die (Chris T)
 
+Customer/Vendor Handling 
+* Added sales tax id and license number fields for companies (Chris T)
+
 New CSV Import Module (Chris T)
 * Imports GL transactions
 * Imports AP batches

Modified: trunk/UI/Contact/contact.css
===================================================================
--- trunk/UI/Contact/contact.css	2012-02-23 09:29:16 UTC (rev 4350)
+++ trunk/UI/Contact/contact.css	2012-02-23 10:53:30 UTC (rev 4351)
@@ -79,7 +79,7 @@
 }
 
 #company_div div.input_group2 label {
-	width: 6em;
+	width: 8em;
 }
 
 #credit_div label {

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2012-02-23 09:29:16 UTC (rev 4350)
+++ trunk/UI/Contact/contact.html	2012-02-23 10:53:30 UTC (rev 4351)
@@ -351,6 +351,28 @@
 		} ?>
 </div>
 </div>
+<div class="input_line" id="sales-tax-info">
+<div class="input_group1">
+     <?lsmb INCLUDE input element_data = {
+         label = text('Sales Tax ID') #'
+          name = 'sales_tax_id'
+          type = 'text'
+         class = 'taxnumber'
+          size = '19'
+         value = sales_tax_id
+     } ?>
+</div>
+<div class="input_group2">
+     <?lsmb INCLUDE input element_data = {
+         label = text('License Number') #'
+          name = 'license_number'
+          type = 'text'
+         class = 'taxnumber'
+          size = '19'
+         value = license_number
+     } ?>
+</div>
+</div>
 <div class="input_line">
             <hr/>
 <div class="input_group1">

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2012-02-23 09:29:16 UTC (rev 4350)
+++ trunk/sql/Pg-database.sql	2012-02-23 10:53:30 UTC (rev 4351)
@@ -650,6 +650,8 @@
   entity_id integer not null references entity(id),
   legal_name text check (legal_name ~ '[[:alnum:]_]'),
   tax_id text,
+  sales_tax_id text,
+  license_number text,
   sic_code varchar,
   created date default current_date not null,
   PRIMARY KEY (entity_id,legal_name));

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2012-02-23 09:29:16 UTC (rev 4350)
+++ trunk/sql/modules/Company.sql	2012-02-23 10:53:30 UTC (rev 4351)
@@ -61,7 +61,7 @@
    project_id int,
    projectnumber text,
    serialnumber text,
-   exchngerate numeric,
+   exchangerate numeric,
    salesperson_id int,
    salesperson_name text
 );
@@ -171,7 +171,7 @@
  ORDER BY eca.meta_number;
 $$ LANGUAGE SQL;
 
-COMMENT ON FUNCTION eca_history
+COMMENT ON FUNCTION eca_history 
 (in_name text, in_meta_number text, in_contact_info text, in_address_line text,
  in_city text, in_state text, in_zip text, in_salesperson text, in_notes text,
  in_country_id int, in_from_date date, in_to_date date, in_type char(1),
@@ -640,10 +640,18 @@
 
 
 DROP FUNCTION IF EXISTS company_save(int, text, int, text, text, int, text, int);
+
+DROP FUNCTION IF EXISTS 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 int
+);
+
 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 int
+    in_entity_id int, in_sic_code text,in_country_id int,
+    in_sales_tax_id text, in_license_number text
 ) RETURNS INT AS $$
 DECLARE t_entity_id INT;
 	t_company_id INT;
@@ -674,13 +682,17 @@
 	UPDATE company
 	SET legal_name = in_name,
 		tax_id = in_tax_id,
-		sic_code = in_sic_code
+		sic_code = in_sic_code,
+                sales_tax_id = in_sales_tax_id,
+                license_number = in_license_number
 	WHERE id = t_company_id;
 
 
 	IF NOT FOUND THEN
-		INSERT INTO company(entity_id, legal_name, tax_id, sic_code)
-		VALUES (t_entity_id, in_name, in_tax_id, in_sic_code);
+		INSERT INTO company(entity_id, legal_name, tax_id, sic_code,
+                                    sales_tax_id, license_number)
+		VALUES (t_entity_id, in_name, in_tax_id, in_sic_code, 
+                        in_sales_tax_id, in_license_number);
 
 	END IF;
 	RETURN t_entity_id;
@@ -690,7 +702,8 @@
 COMMENT ON  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 int
+    in_entity_id int, in_sic_code text,in_country_id int,
+    in_sales_tax_id text, in_license_number text
  ) is
 $$ Saves a company.  Returns the id number of the record stored.$$;
 

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