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

SF.net SVN: ledger-smb:[6547] trunk/sql/upgrade/sl2.8-1.4.sql



Revision: 6547
          http://sourceforge.net/p/ledger-smb/code/6547
Author:   ehuelsmann
Date:     2014-01-19 11:44:48 +0000 (Sun, 19 Jan 2014)
Log Message:
-----------
Incorporate changes due to review with 1.3 branch.

Modified Paths:
--------------
    trunk/sql/upgrade/sl2.8-1.4.sql

Modified: trunk/sql/upgrade/sl2.8-1.4.sql
===================================================================
--- trunk/sql/upgrade/sl2.8-1.4.sql	2014-01-19 11:04:56 UTC (rev 6546)
+++ trunk/sql/upgrade/sl2.8-1.4.sql	2014-01-19 11:44:48 UTC (rev 6547)
@@ -5,11 +5,6 @@
 \set ar '''<?lsmb default_ar ?>'''
 \set ap '''<?lsmb default_ap ?>'''
 
-\set default_country '''AF'''
-\set ar '''1310'''
-\set ap '''2210'''
-
-
 BEGIN;
 
 -- adding mapping info for import.
@@ -509,29 +504,29 @@
        JOIN sl28.chart ON chart.id = pt.chart_id
        JOIN account a ON chart.accno = a.accno;
 
-INSERT INTO tax(chart_id, rate, taxnumber, validto)
+INSERT INTO tax(chart_id, rate, taxnumber, validto, pass, taxmodule_id)
      SELECT a.id, t.rate, t.taxnumber, 
-            coalesce(t.validto::timestamp, 'infinity')
+            coalesce(t.validto::timestamp, 'infinity'), 1, 1
        FROM sl28.tax t
        JOIN sl28.chart c ON (t.chart_id = c.id)
        JOIN account a ON (a.accno = c.accno);
 
+INSERT INTO eca_tax (eca_id, chart_id)
+  SELECT c.credit_id, (select id from account
+                      where accno = (select accno from sl28.chart sc
+                                      where sc.id = ct.chart_id))
+   FROM sl28.customertax ct
+   JOIN sl28.customer c
+     ON ct.customer_id = c.id
+  UNION
+  SELECT v.credit_id, (select id from account
+                      where accno = (select accno from sl28.chart sc
+                                      where sc.id = vt.chart_id))
+   FROM sl28.vendortax vt
+   JOIN sl28.vendor v
+     ON vt.vendor_id = v.id;
 
--- ### TODO: Customer tax does not exist in LSMB. What is its function in SL??
--- ###  LSMB moved these tables jointly to eca_tax
--- INSERT INTO customertax (customer_id, chart_id)
---      SELECT c.credit_id,  a.id
---        FROM sl28.customertax pt
---        JOIN sl28.customer c ON (pt.customer_id = c.id)
---        JOIN sl28.chart ON chart.id = pt.chart_id
---        JOIN account a ON chart.accno = a.accno; 
 
--- INSERT INTO vendortax (vendor_id, chart_id)
---      SELECT c.credit_id,  a.id
---        FROM sl28.vendortax pt       
---        JOIN sl28.vendor c ON (pt.vendor_id = c.id)
---        JOIN sl28.chart ON chart.id = pt.chart_id
---        JOIN account a ON chart.accno = a.accno;
 
 INSERT 
   INTO oe(id, ordnumber, transdate, amount, netamount, reqdate, taxincluded,
@@ -572,20 +567,9 @@
 
 INSERT INTO exchangerate select * from sl28.exchangerate;
 
--- ### TODO: Move to business units!
--- INSERT INTO project (id, projectnumber, description, startdate, enddate,
---             parts_id, production, completed, credit_id)
---      SELECT p.id, projectnumber, description, p.startdate, p.enddate,
---             parts_id, production, completed, c.credit_id
---        FROM sl28.project p
---        JOIN sl28.customer c ON p.customer_id = c.id;
 
-
 INSERT INTO status SELECT * FROM sl28.status; -- may need to comment this one out sometimes
 
--- ### TODO: Move to business units!
--- INSERT INTO department SELECT * FROM sl28.department;
-
 INSERT INTO business SELECT * FROM sl28.business;
 
 INSERT INTO sic SELECT * FROM sl28.sic;

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits