From e68f54390313e031b6d6ce1e6821c64a0f8b7d14 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 3 May 2013 13:00:12 -0500 Subject: [PATCH] IDEMPIERE-117 Add cost history table and cost movement view --- db/ddlutils/oracle/views/M_CostMovement_V.sql | 7 +++++++ db/ddlutils/postgresql/views/M_CostMovement_V.sql | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 db/ddlutils/oracle/views/M_CostMovement_V.sql create mode 100644 db/ddlutils/postgresql/views/M_CostMovement_V.sql diff --git a/db/ddlutils/oracle/views/M_CostMovement_V.sql b/db/ddlutils/oracle/views/M_CostMovement_V.sql new file mode 100644 index 0000000000..2adaf9fcab --- /dev/null +++ b/db/ddlutils/oracle/views/M_CostMovement_V.sql @@ -0,0 +1,7 @@ +CREATE OR REPLACE VIEW m_costmovement_v AS +SELECT a.ad_client_id, a.ad_org_id, b.c_acctschema_id, a.m_costhistory_id, a.m_costtype_id, a.m_costelement_id, a.m_attributesetinstance_id, b.m_product_id, a.oldqty, a.newqty, a.oldcostprice, a.newcostprice, a.oldcqty, a.newcqty, a.oldcamt, a.newcamt, b.qty, b.amt, b.deltaqty, b.deltaamt, b.c_orderline_id, b.m_inoutline_id, b.c_invoiceline_id, b.m_movementline_id, b.m_inventoryline_id, b.m_productionline_id, b.c_projectissue_id, a.m_costdetail_id, b.description, a.created, a.createdby, a.updated, a.updatedby, a.isactive + FROM m_costhistory a + JOIN m_costdetail b ON a.m_costdetail_id = b.m_costdetail_id + ORDER BY a.m_costhistory_id +; + diff --git a/db/ddlutils/postgresql/views/M_CostMovement_V.sql b/db/ddlutils/postgresql/views/M_CostMovement_V.sql new file mode 100644 index 0000000000..2adaf9fcab --- /dev/null +++ b/db/ddlutils/postgresql/views/M_CostMovement_V.sql @@ -0,0 +1,7 @@ +CREATE OR REPLACE VIEW m_costmovement_v AS +SELECT a.ad_client_id, a.ad_org_id, b.c_acctschema_id, a.m_costhistory_id, a.m_costtype_id, a.m_costelement_id, a.m_attributesetinstance_id, b.m_product_id, a.oldqty, a.newqty, a.oldcostprice, a.newcostprice, a.oldcqty, a.newcqty, a.oldcamt, a.newcamt, b.qty, b.amt, b.deltaqty, b.deltaamt, b.c_orderline_id, b.m_inoutline_id, b.c_invoiceline_id, b.m_movementline_id, b.m_inventoryline_id, b.m_productionline_id, b.c_projectissue_id, a.m_costdetail_id, b.description, a.created, a.createdby, a.updated, a.updatedby, a.isactive + FROM m_costhistory a + JOIN m_costdetail b ON a.m_costdetail_id = b.m_costdetail_id + ORDER BY a.m_costhistory_id +; +