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

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



Revision: 6004
          http://sourceforge.net/p/ledger-smb/code/6004
Author:   einhverfr
Date:     2013-09-12 14:17:13 +0000 (Thu, 12 Sep 2013)
Log Message:
-----------
Correcting business unit trigger for customer/vendor dimensions

Modified Paths:
--------------
    trunk/sql/modules/Business_Unit.sql

Modified: trunk/sql/modules/Business_Unit.sql
===================================================================
--- trunk/sql/modules/Business_Unit.sql	2013-09-12 14:16:00 UTC (rev 6003)
+++ trunk/sql/modules/Business_Unit.sql	2013-09-12 14:17:13 UTC (rev 6004)
@@ -186,11 +186,12 @@
 $$
 BEGIN
   IF TG_OP = 'INSERT' THEN
-      INSERT INTO business_unit(class_id, description, credit_id)
-      VALUES (7 - NEW.entity_class, NEW.meta_number, NEW.id);
+      INSERT INTO business_unit(class_id, control_code, description, credit_id)
+      SELECT 7 - NEW.entity_class, NEW.meta_number,  e.name, NEW.id
+             FROM entity e WHERE e.id = NEW.entity_id;
   ELSIF TG_OP = 'UPDATE' THEN
       IF new.meta_number <> old.meta_number THEN
-         UPDATE business_unit SET description = new.meta_number
+         UPDATE business_unit SET control_code = new.meta_number
           WHERE class_id = 7 - NEW.entity_class
                 AND credit_id = new.id;
       END IF;

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


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits