IDEMPIERE-215 Costing: Drop M_Product_Costing.

This commit is contained in:
Heng Sin Low 2012-04-04 18:33:37 +08:00
parent 894ebe49ee
commit 491a3517f8
3 changed files with 0 additions and 96 deletions

View File

@ -1,38 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database">
<database name="default" defaultIdMethod="none">
<table name="M_PRODUCT_COSTING">
<column name="M_PRODUCT_ID" primaryKey="true" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="C_ACCTSCHEMA_ID" primaryKey="true" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="AD_CLIENT_ID" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="AD_ORG_ID" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" default="Y" autoIncrement="false"/>
<column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="CURRENT_TIMESTAMP" autoIncrement="false"/>
<column name="CREATEDBY" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="CURRENT_TIMESTAMP" autoIncrement="false"/>
<column name="UPDATEDBY" primaryKey="false" required="true" type="ID" size="10" autoIncrement="false"/>
<column name="CURRENTCOSTPRICE" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="FUTURECOSTPRICE" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTSTANDARD" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTSTANDARDPOQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTSTANDARDPOAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTSTANDARDCUMQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTSTANDARDCUMAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTAVERAGE" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTAVERAGECUMQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="COSTAVERAGECUMAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="PRICELASTPO" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="PRICELASTINV" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="TOTALINVQTY" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<column name="TOTALINVAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
<foreign-key foreignTable="C_ACCTSCHEMA" name="CACCTSCHEMA_MPRODUCTCOSTING" onDelete="cascade">
<reference local="C_ACCTSCHEMA_ID" foreign="C_ACCTSCHEMA_ID"/>
</foreign-key>
<foreign-key foreignTable="M_PRODUCT" name="MPRODUCT_MPRODUCTCOSTING" onDelete="cascade">
<reference local="M_PRODUCT_ID" foreign="M_PRODUCT_ID"/>
</foreign-key>
<check>
<rule><![CDATA[IsActive in ('Y','N')]]></rule>
</check>
</table>
</database>

View File

@ -1,29 +0,0 @@
CREATE OR REPLACE VIEW RV_PRODUCT_COSTING
(M_PRODUCT_ID, C_ACCTSCHEMA_ID, VALUE, NAME, M_PRODUCT_CATEGORY_ID,
AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY,
UPDATED, UPDATEDBY, CURRENTCOSTPRICE, FUTURECOSTPRICE, COSTSTANDARD,
COSTSTANDARDPOQTY, COSTSTANDARDPOAMT, COSTSTANDARDPODIFF, COSTSTANDARDCUMQTY, COSTSTANDARDCUMAMT,
COSTSTANDARDINVDIFF, COSTAVERAGE, COSTAVERAGECUMQTY, COSTAVERAGECUMAMT, TOTALINVQTY,
TOTALINVAMT, TOTALINVCOST, PRICELASTPO, PRICELASTINV)
AS
SELECT pc.M_Product_ID, pc.C_AcctSchema_ID, p.Value, p.Name, p.M_Product_Category_ID,
pc.AD_Client_ID, pc.AD_Org_ID, pc.IsActive, pc.Created,pc.CreatedBy,pc.Updated,pc.UpdatedBy,
pc.CurrentCostPrice,
-- Standard Costing
pc.FutureCostPrice, pc.CostStandard,
pc.CostStandardPOQty, pc.CostStandardPOAmt,
CASE WHEN pc.CostStandardPOQty=0 THEN 0 ELSE pc.CostStandardPOAmt/pc.CostStandardPOQty END AS CostStandardPODiff,
pc.CostStandardCumQty, pc.CostStandardCumAmt,
CASE WHEN pc.CostStandardCumQty=0 THEN 0 ELSE pc.CostStandardCumAmt/pc.CostStandardCumQty END AS CostStandardInvDiff,
-- Average Costing
pc.CostAverage,
pc.CostAverageCumQty, pc.CostAverageCumAmt,
pc.TotalInvQty, pc.TotalInvAmt,
CASE WHEN pc.TotalInvQty=0 THEN 0 ELSE pc.TotalInvAmt/pc.TotalInvQty END AS TotalInvCost,
-- LastPrice
pc.PriceLastPO, pc.PriceLastInv
FROM M_Product_Costing pc
INNER JOIN M_Product p ON (pc.M_Product_ID=p.M_Product_ID);

View File

@ -1,29 +0,0 @@
CREATE OR REPLACE VIEW RV_PRODUCT_COSTING
(M_PRODUCT_ID, C_ACCTSCHEMA_ID, VALUE, NAME, M_PRODUCT_CATEGORY_ID,
AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY,
UPDATED, UPDATEDBY, CURRENTCOSTPRICE, FUTURECOSTPRICE, COSTSTANDARD,
COSTSTANDARDPOQTY, COSTSTANDARDPOAMT, COSTSTANDARDPODIFF, COSTSTANDARDCUMQTY, COSTSTANDARDCUMAMT,
COSTSTANDARDINVDIFF, COSTAVERAGE, COSTAVERAGECUMQTY, COSTAVERAGECUMAMT, TOTALINVQTY,
TOTALINVAMT, TOTALINVCOST, PRICELASTPO, PRICELASTINV)
AS
SELECT pc.M_Product_ID, pc.C_AcctSchema_ID, p.Value, p.Name, p.M_Product_Category_ID,
pc.AD_Client_ID, pc.AD_Org_ID, pc.IsActive, pc.Created,pc.CreatedBy,pc.Updated,pc.UpdatedBy,
pc.CurrentCostPrice,
-- Standard Costing
pc.FutureCostPrice, pc.CostStandard,
pc.CostStandardPOQty, pc.CostStandardPOAmt,
CASE WHEN pc.CostStandardPOQty=0 THEN 0 ELSE pc.CostStandardPOAmt/pc.CostStandardPOQty END AS CostStandardPODiff,
pc.CostStandardCumQty, pc.CostStandardCumAmt,
CASE WHEN pc.CostStandardCumQty=0 THEN 0 ELSE pc.CostStandardCumAmt/pc.CostStandardCumQty END AS CostStandardInvDiff,
-- Average Costing
pc.CostAverage,
pc.CostAverageCumQty, pc.CostAverageCumAmt,
pc.TotalInvQty, pc.TotalInvAmt,
CASE WHEN pc.TotalInvQty=0 THEN 0 ELSE pc.TotalInvAmt/pc.TotalInvQty END AS TotalInvCost,
-- LastPrice
pc.PriceLastPO, pc.PriceLastInv
FROM M_Product_Costing pc
INNER JOIN M_Product p ON (pc.M_Product_ID=p.M_Product_ID);