diff --git a/migration/353a-trunk/oracle/386_FR2493138_AccountProductGarden.sql b/migration/353a-trunk/oracle/386_FR2493138_AccountProductGarden.sql new file mode 100644 index 0000000000..36012a5635 --- /dev/null +++ b/migration/353a-trunk/oracle/386_FR2493138_AccountProductGarden.sql @@ -0,0 +1,149 @@ +-- Jan 7, 2009 10:34:32 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Category_Acct SET P_Burden_Acct=50008, P_CostOfProduction_Acct=50009, P_FloorStock_Acct=50002, P_Labor_Acct=50007, P_MethodChangeVariance_Acct=50003, P_MixVariance_Acct=50006, P_OutsideProcessing_Acct=50010, P_Overhead_Acct=50011, P_RateVariance_Acct=50005, P_Scrap_Acct=50012, P_UsageVariance_Acct=50004, P_WIP_Acct=50001,Updated=TO_DATE('2009-01-07 10:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_AcctSchema_ID=101 AND M_Product_Category_ID=110 +; + +-- Jan 7, 2009 10:34:59 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=110 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=110) +; + +-- Jan 7, 2009 10:34:59 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=110 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:06 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50000 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=50000) +; + +-- Jan 7, 2009 10:35:07 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50000 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:14 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=107 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=107) +; + +-- Jan 7, 2009 10:35:14 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=107 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:21 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=109 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=109) +; + +-- Jan 7, 2009 10:35:21 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=109 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:28 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=111 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=111) +; + +-- Jan 7, 2009 10:35:28 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=111 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:38 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50002 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=50002) +; + +-- Jan 7, 2009 10:35:38 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50002 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:46 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=110 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=110) +; + +-- Jan 7, 2009 10:35:46 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=110 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:55 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50001 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=50001) +; + +-- Jan 7, 2009 10:35:55 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50001 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:01 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50003 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=50003) +; + +-- Jan 7, 2009 10:36:01 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50003 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:08 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=105 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=105) +; + +-- Jan 7, 2009 10:36:08 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=105 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:15 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=108 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=108) +; + +-- Jan 7, 2009 10:36:15 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=108 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:22 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=112 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=112) +; + +-- Jan 7, 2009 10:36:22 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=112 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:27 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct pa SET (P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct)= (SELECT P_Revenue_Acct,P_Expense_Acct,P_CostAdjustment_Acct,P_InventoryClearing_Acct,P_Asset_Acct,P_COGS_Acct, P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct,P_MethodChangeVariance_Acct,P_UsageVariance_Acct,P_RateVariance_Acct, P_MixVariance_Acct,P_Labor_Acct,P_Burden_Acct,P_CostOfProduction_Acct,P_OutsideProcessing_Acct,P_Overhead_Acct,P_Scrap_Acct FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=106 AND pca.C_AcctSchema_ID=101), Updated=SysDate, UpdatedBy=0 WHERE pa.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=pa.M_Product_ID AND p.M_Product_Category_ID=106) +; + +-- Jan 7, 2009 10:36:27 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', SysDate, 0, SysDate, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=106 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:37:29 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ElementValue SET Description='Outside Processing Account', Name='Outside Processing (Subcontract)',Updated=TO_DATE('2009-01-07 10:37:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_ElementValue_ID=50011 +; + +-- Jan 7, 2009 10:37:29 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ElementValue_Trl SET Description='Outside Processing Account',Name='Outside Processing (Subcontract)',IsTranslated='Y' WHERE C_ElementValue_ID=50011 +; + +-- Jan 7, 2009 10:37:30 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ValidCombination SET Combination='HQ-51130-_-_-_-_', Description='HQ-Outside Processing (Subcontract)-_-_-_-_',Updated=TO_DATE('2009-01-07 10:37:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_ValidCombination_ID=50010 +; \ No newline at end of file diff --git a/migration/353a-trunk/postgresql/386_FR2493138_AccountProductGarden.sql b/migration/353a-trunk/postgresql/386_FR2493138_AccountProductGarden.sql new file mode 100644 index 0000000000..27ba0b1493 --- /dev/null +++ b/migration/353a-trunk/postgresql/386_FR2493138_AccountProductGarden.sql @@ -0,0 +1,149 @@ +-- Jan 7, 2009 10:34:32 AM ECT +-- Period 2009 +UPDATE M_Product_Category_Acct SET P_Burden_Acct=50008, P_CostOfProduction_Acct=50009, P_FloorStock_Acct=50002, P_Labor_Acct=50007, P_MethodChangeVariance_Acct=50003, P_MixVariance_Acct=50006, P_OutsideProcessing_Acct=50010, P_Overhead_Acct=50011, P_RateVariance_Acct=50005, P_Scrap_Acct=50012, P_UsageVariance_Acct=50004, P_WIP_Acct=50001,Updated=TO_TIMESTAMP('2009-01-07 10:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_AcctSchema_ID=101 AND M_Product_Category_ID=110 +; + +-- Jan 7, 2009 10:34:59 AM ECT +-- Period 2009 +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=110 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=110) +; + +-- Jan 7, 2009 10:34:59 AM ECT +-- Period 2009 +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=110 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:06 AM ECT +-- Period 2009 +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50000 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=50000) +; + +-- Jan 7, 2009 10:35:07 AM ECT +-- Period 2009 +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50000 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:14 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=107 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=107) +; + +-- Jan 7, 2009 10:35:14 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=107 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:21 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=109 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=109) +; + +-- Jan 7, 2009 10:35:21 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=109 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:28 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=111 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=111) +; + +-- Jan 7, 2009 10:35:28 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=111 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:38 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50002 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=50002) +; + +-- Jan 7, 2009 10:35:38 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50002 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:46 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=110 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=110) +; + +-- Jan 7, 2009 10:35:46 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=110 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:35:55 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50001 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=50001) +; + +-- Jan 7, 2009 10:35:55 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50001 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:01 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=50003 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=50003) +; + +-- Jan 7, 2009 10:36:01 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=50003 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:08 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=105 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=105) +; + +-- Jan 7, 2009 10:36:08 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=105 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:15 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=108 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=108) +; + +-- Jan 7, 2009 10:36:15 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=108 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:22 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=112 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=112) +; + +-- Jan 7, 2009 10:36:22 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=112 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:36:27 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE M_Product_Acct SET P_Revenue_Acct=pca.P_Revenue_Acct,P_Expense_Acct=pca.P_Expense_Acct,P_CostAdjustment_Acct=pca.P_CostAdjustment_Acct,P_InventoryClearing_Acct=pca.P_InventoryClearing_Acct,P_Asset_Acct=pca.P_Asset_Acct,P_COGS_Acct=pca.P_COGS_Acct,P_PurchasePriceVariance_Acct=pca.P_PurchasePriceVariance_Acct,P_InvoicePriceVariance_Acct=pca.P_InvoicePriceVariance_Acct,P_TradeDiscountRec_Acct=pca.P_TradeDiscountRec_Acct,P_TradeDiscountGrant_Acct=pca.P_TradeDiscountGrant_Acct,P_WIP_Acct=pca.P_WIP_Acct,P_FloorStock_Acct=pca.P_FloorStock_Acct,P_MethodChangeVariance_Acct=pca.P_MethodChangeVariance_Acct,P_UsageVariance_Acct=pca.P_UsageVariance_Acct,P_RateVariance_Acct=pca.P_RateVariance_Acct,P_MixVariance_Acct=pca.P_MixVariance_Acct,P_Labor_Acct=pca.P_Labor_Acct,P_Burden_Acct=pca.P_Burden_Acct,P_CostOfProduction_Acct=pca.P_CostOfProduction_Acct,P_OutsideProcessing_Acct=pca.P_OutsideProcessing_Acct,P_Overhead_Acct=pca.P_Overhead_Acct,P_Scrap_Acct=pca.P_Scrap_Acct, Updated=CURRENT_TIMESTAMP, UpdatedBy=0 FROM M_Product_Category_Acct pca WHERE pca.M_Product_Category_ID=106 AND pca.C_AcctSchema_ID=101 AND M_Product_Acct.C_AcctSchema_ID=101 AND EXISTS (SELECT * FROM M_Product p WHERE p.M_Product_ID=M_Product_Acct.M_Product_ID AND p.M_Product_Category_ID=106) +; + +-- Jan 7, 2009 10:36:27 AM ECT +-- Define Default Account Manufacturing for Product Category +INSERT INTO M_Product_Acct (M_Product_ID, C_AcctSchema_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, P_Revenue_Acct, P_Expense_Acct, P_CostAdjustment_Acct, P_InventoryClearing_Acct, P_Asset_Acct, P_CoGs_Acct, P_PurchasePriceVariance_Acct, P_InvoicePriceVariance_Acct, P_TradeDiscountRec_Acct, P_TradeDiscountGrant_Acct, P_WIP_Acct,P_FloorStock_Acct, P_MethodChangeVariance_Acct, P_UsageVariance_Acct, P_RateVariance_Acct, P_MixVariance_Acct, P_Labor_Acct, P_Burden_Acct, P_CostOfProduction_Acct, P_OutsideProcessing_Acct, P_Overhead_Acct, P_Scrap_Acct) SELECT p.M_Product_ID, acct.C_AcctSchema_ID, p.AD_Client_ID, p.AD_Org_ID, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, acct.P_Revenue_Acct, acct.P_Expense_Acct, acct.P_CostAdjustment_Acct, acct.P_InventoryClearing_Acct, acct.P_Asset_Acct, acct.P_CoGs_Acct, acct.P_PurchasePriceVariance_Acct, acct.P_InvoicePriceVariance_Acct, acct.P_TradeDiscountRec_Acct, acct.P_TradeDiscountGrant_Acct, acct.P_WIP_Acct, acct.P_FloorStock_Acct, acct.P_MethodChangeVariance_Acct, acct.P_UsageVariance_Acct, acct.P_RateVariance_Acct, acct.P_MixVariance_Acct, acct.P_Labor_Acct, acct.P_Burden_Acct, acct.P_CostOfProduction_Acct, acct.P_OutsideProcessing_Acct, acct.P_Overhead_Acct, acct.P_Scrap_Acct FROM M_Product p INNER JOIN M_Product_Category_Acct acct ON (acct.M_Product_Category_ID=p.M_Product_Category_ID)WHERE acct.C_AcctSchema_ID=101 AND p.M_Product_Category_ID=106 AND NOT EXISTS (SELECT * FROM M_Product_Acct pa WHERE pa.M_Product_ID=p.M_Product_ID AND pa.C_AcctSchema_ID=acct.C_AcctSchema_ID) +; + +-- Jan 7, 2009 10:37:29 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ElementValue SET Description='Outside Processing Account', Name='Outside Processing (Subcontract)',Updated=TO_TIMESTAMP('2009-01-07 10:37:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_ElementValue_ID=50011 +; + +-- Jan 7, 2009 10:37:29 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ElementValue_Trl SET Description='Outside Processing Account',Name='Outside Processing (Subcontract)',IsTranslated='Y' WHERE C_ElementValue_ID=50011 +; + +-- Jan 7, 2009 10:37:30 AM ECT +-- Define Default Account Manufacturing for Product Category +UPDATE C_ValidCombination SET Combination='HQ-51130-_-_-_-_', Description='HQ-Outside Processing (Subcontract)-_-_-_-_',Updated=TO_TIMESTAMP('2009-01-07 10:37:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE C_ValidCombination_ID=50010 +; \ No newline at end of file