diff --git a/db/ddlutils/oracle/views/RV_PP_ORDER_TRANSACTIONS.sql b/db/ddlutils/oracle/views/RV_PP_ORDER_TRANSACTIONS.sql index 521ff52fcd..1ea167cd73 100644 --- a/db/ddlutils/oracle/views/RV_PP_ORDER_TRANSACTIONS.sql +++ b/db/ddlutils/oracle/views/RV_PP_ORDER_TRANSACTIONS.sql @@ -1,6 +1,4 @@ --- DROP VIEW rv_pp_order_transactions; - -DROP VIEW rv_pp_order_transactions; +--DROP VIEW rv_pp_order_transactions; CREATE OR REPLACE VIEW rv_pp_order_transactions AS SELECT DISTINCT o.ad_client_id, diff --git a/db/ddlutils/postgresql/views/RV_PP_ORDER_TRANSACTIONS.sql b/db/ddlutils/postgresql/views/RV_PP_ORDER_TRANSACTIONS.sql index 521ff52fcd..1ea167cd73 100644 --- a/db/ddlutils/postgresql/views/RV_PP_ORDER_TRANSACTIONS.sql +++ b/db/ddlutils/postgresql/views/RV_PP_ORDER_TRANSACTIONS.sql @@ -1,6 +1,4 @@ --- DROP VIEW rv_pp_order_transactions; - -DROP VIEW rv_pp_order_transactions; +--DROP VIEW rv_pp_order_transactions; CREATE OR REPLACE VIEW rv_pp_order_transactions AS SELECT DISTINCT o.ad_client_id, diff --git a/migration/353a-trunk/oracle/392_FR_ShowCostCollectior.sql b/migration/353a-trunk/oracle/392_FR_ShowCostCollectior.sql index 5186e5063c..7a99020d5e 100644 --- a/migration/353a-trunk/oracle/392_FR_ShowCostCollectior.sql +++ b/migration/353a-trunk/oracle/392_FR_ShowCostCollectior.sql @@ -1,42 +1,4 @@ -DROP VIEW rv_pp_order_transactions; -CREATE OR REPLACE VIEW rv_pp_order_transactions AS -SELECT DISTINCT -o.ad_client_id, -o.ad_org_id, -o.isactive, -o.created, -o.createdby, -o.updatedby, -o.updated, -o.documentno, -ol.m_product_id, -mt.m_locator_id, -mt.movementdate, -o.pp_order_id, -o.qtydelivered, -o.qtyscrap, -ol.qtydelivered AS qtydeliveredline, -o.qtydelivered * ol.qtybatch / 100 AS qtyissueshouldbe, -ol.qtyscrap AS qtyscrapline, -o.qtyscrap * ol.qtybatch / 100 AS qtyissuescrapshouldbe, -mt.createdby AS createdbyissue, -mt.updatedby AS updatedbyissue, -( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id) AS qtytodeliver, -(o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)) AS differenceqty, -o.issotrx, -o.dateordered -FROM pp_order o -JOIN pp_order_bomline ol ON ol.pp_order_id = o.pp_order_id -JOIN pp_cost_collector cc ON cc.pp_order_bomline_id = ol.pp_order_bomline_id -LEFT JOIN m_transaction mt ON mt.pp_cost_collector_id = cc.pp_cost_collector_id -ORDER BY -o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updatedby, o.updated, o.documentno, ol.m_product_id, mt.m_locator_id, mt.movementdate, o.pp_order_id, o.qtydelivered, o.qtyscrap, ol.qtydelivered, o.qtydelivered * ol.qtybatch / 100, ol.qtyscrap, o.qtyscrap * ol.qtybatch / 100, mt.createdby, mt.updatedby, -(SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id), (o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)), -o.issotrx, -o.dateordered -ALTER TABLE m_transaction DROP COLUMN pp_order_id; -ALTER TABLE m_transaction DROP COLUMN pp_order_bomline_id; -- Jan 9, 2009 8:30:36 PM ECT -- Manufacturing Cost Management @@ -100,3 +62,42 @@ INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID, INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56606 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; +DROP VIEW rv_pp_order_transactions; +CREATE OR REPLACE VIEW rv_pp_order_transactions AS +SELECT DISTINCT +o.ad_client_id, +o.ad_org_id, +o.isactive, +o.created, +o.createdby, +o.updatedby, +o.updated, +o.documentno, +ol.m_product_id, +mt.m_locator_id, +mt.movementdate, +o.pp_order_id, +o.qtydelivered, +o.qtyscrap, +ol.qtydelivered AS qtydeliveredline, +o.qtydelivered * ol.qtybatch / 100 AS qtyissueshouldbe, +ol.qtyscrap AS qtyscrapline, +o.qtyscrap * ol.qtybatch / 100 AS qtyissuescrapshouldbe, +mt.createdby AS createdbyissue, +mt.updatedby AS updatedbyissue, +( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id) AS qtytodeliver, +(o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)) AS differenceqty, +o.issotrx, +o.dateordered +FROM pp_order o +JOIN pp_order_bomline ol ON ol.pp_order_id = o.pp_order_id +JOIN pp_cost_collector cc ON cc.pp_order_bomline_id = ol.pp_order_bomline_id +LEFT JOIN m_transaction mt ON mt.pp_cost_collector_id = cc.pp_cost_collector_id +ORDER BY +o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updatedby, o.updated, o.documentno, ol.m_product_id, mt.m_locator_id, mt.movementdate, o.pp_order_id, o.qtydelivered, o.qtyscrap, ol.qtydelivered, o.qtydelivered * ol.qtybatch / 100, ol.qtyscrap, o.qtyscrap * ol.qtybatch / 100, mt.createdby, mt.updatedby, +(SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id), (o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)), +o.issotrx, +o.dateordered; + +ALTER TABLE m_transaction DROP COLUMN pp_order_id; +ALTER TABLE m_transaction DROP COLUMN pp_order_bomline_id; \ No newline at end of file diff --git a/migration/353a-trunk/postgresql/392_FR_ShowCostCollectior.sql b/migration/353a-trunk/postgresql/392_FR_ShowCostCollectior.sql index c3c65b7b1b..52c06a7ca2 100644 --- a/migration/353a-trunk/postgresql/392_FR_ShowCostCollectior.sql +++ b/migration/353a-trunk/postgresql/392_FR_ShowCostCollectior.sql @@ -1,42 +1,4 @@ -DROP VIEW rv_pp_order_transactions; -CREATE OR REPLACE VIEW rv_pp_order_transactions AS -SELECT DISTINCT -o.ad_client_id, -o.ad_org_id, -o.isactive, -o.created, -o.createdby, -o.updatedby, -o.updated, -o.documentno, -ol.m_product_id, -mt.m_locator_id, -mt.movementdate, -o.pp_order_id, -o.qtydelivered, -o.qtyscrap, -ol.qtydelivered AS qtydeliveredline, -o.qtydelivered * ol.qtybatch / 100 AS qtyissueshouldbe, -ol.qtyscrap AS qtyscrapline, -o.qtyscrap * ol.qtybatch / 100 AS qtyissuescrapshouldbe, -mt.createdby AS createdbyissue, -mt.updatedby AS updatedbyissue, -( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id) AS qtytodeliver, -(o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)) AS differenceqty, -o.issotrx, -o.dateordered -FROM pp_order o -JOIN pp_order_bomline ol ON ol.pp_order_id = o.pp_order_id -JOIN pp_cost_collector cc ON cc.pp_order_bomline_id = ol.pp_order_bomline_id -LEFT JOIN m_transaction mt ON mt.pp_cost_collector_id = cc.pp_cost_collector_id -ORDER BY -o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updatedby, o.updated, o.documentno, ol.m_product_id, mt.m_locator_id, mt.movementdate, o.pp_order_id, o.qtydelivered, o.qtyscrap, ol.qtydelivered, o.qtydelivered * ol.qtybatch / 100, ol.qtyscrap, o.qtyscrap * ol.qtybatch / 100, mt.createdby, mt.updatedby, -(SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id), (o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)), -o.issotrx, -o.dateordered -ALTER TABLE m_transaction DROP COLUMN pp_order_id; -ALTER TABLE m_transaction DROP COLUMN pp_order_bomline_id; -- Jan 9, 2009 8:30:36 PM ECT -- Manufacturing Cost Management @@ -103,3 +65,42 @@ INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID, INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56606 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; +DROP VIEW rv_pp_order_transactions; +CREATE OR REPLACE VIEW rv_pp_order_transactions AS +SELECT DISTINCT +o.ad_client_id, +o.ad_org_id, +o.isactive, +o.created, +o.createdby, +o.updatedby, +o.updated, +o.documentno, +ol.m_product_id, +mt.m_locator_id, +mt.movementdate, +o.pp_order_id, +o.qtydelivered, +o.qtyscrap, +ol.qtydelivered AS qtydeliveredline, +o.qtydelivered * ol.qtybatch / 100 AS qtyissueshouldbe, +ol.qtyscrap AS qtyscrapline, +o.qtyscrap * ol.qtybatch / 100 AS qtyissuescrapshouldbe, +mt.createdby AS createdbyissue, +mt.updatedby AS updatedbyissue, +( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id) AS qtytodeliver, +(o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)) AS differenceqty, +o.issotrx, +o.dateordered +FROM pp_order o +JOIN pp_order_bomline ol ON ol.pp_order_id = o.pp_order_id +JOIN pp_cost_collector cc ON cc.pp_order_bomline_id = ol.pp_order_bomline_id +LEFT JOIN m_transaction mt ON mt.pp_cost_collector_id = cc.pp_cost_collector_id +ORDER BY +o.ad_client_id, o.ad_org_id, o.isactive, o.created, o.createdby, o.updatedby, o.updated, o.documentno, ol.m_product_id, mt.m_locator_id, mt.movementdate, o.pp_order_id, o.qtydelivered, o.qtyscrap, ol.qtydelivered, o.qtydelivered * ol.qtybatch / 100, ol.qtyscrap, o.qtyscrap * ol.qtybatch / 100, mt.createdby, mt.updatedby, +(SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id), (o.qtydelivered + o.qtyscrap) * ol.qtybatch / 100 + (( SELECT sum(t.movementqty) AS sum FROM m_transaction t WHERE t.pp_cost_collector_id = cc.pp_cost_collector_id)), +o.issotrx, +o.dateordered; + +ALTER TABLE m_transaction DROP COLUMN pp_order_id; +ALTER TABLE m_transaction DROP COLUMN pp_order_bomline_id; \ No newline at end of file