Fix problems in migration scripts with comment on view

This commit is contained in:
Carlos Ruiz 2008-05-28 07:35:24 +00:00
parent 68ce79b109
commit b88b649f63
2 changed files with 634 additions and 636 deletions

View File

@ -10,7 +10,7 @@ CREATE OR REPLACE VIEW M_INOUT_LINE_V
C_PROJECTPHASE_ID, C_PROJECTTASK_ID)
AS
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
'en_US' AS AD_Language,
'en_US' AS AD_LANGUAGE,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line, p.M_Product_ID,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN iol.MovementQty END AS MovementQty,
@ -18,24 +18,24 @@ SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN uom.UOMSymbol END AS UOMSymbol,
ol.QtyOrdered, ol.QtyDelivered,
CASE WHEN iol.MovementQty<>0 OR iol.M_Product_ID IS NOT NULL THEN ol.QtyOrdered-ol.QtyDelivered END AS QtyBackOrdered,
COALESCE(p.Name||productAttribute(iol.M_AttributeSetInstance_ID), c.Name, iol.Description) AS Name, -- main line
CASE WHEN COALESCE(c.Name,p.Name) IS NOT NULL THEN iol.Description END AS Description, -- second line
COALESCE(p.NAME||Productattribute(iol.M_AttributeSetInstance_ID), c.NAME, iol.Description) AS NAME, -- main line
CASE WHEN COALESCE(c.NAME,p.NAME) IS NOT NULL THEN iol.Description END AS Description, -- second line
p.DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
p.UPC, p.SKU, p.VALUE AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
p.Description AS ProductDescription, p.ImageURL,
iol.C_Campaign_ID, iol.C_Project_ID, iol.C_Activity_ID, iol.C_ProjectPhase_ID, iol.C_ProjectTask_ID
FROM M_InOutLine iol
FROM M_INOUTLINE iol
INNER JOIN C_UOM uom ON (iol.C_UOM_ID=uom.C_UOM_ID)
LEFT OUTER JOIN M_Product p ON (iol.M_Product_ID=p.M_Product_ID)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_OrderLine ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_Charge c ON (iol.C_Charge_ID=c.C_Charge_ID)
LEFT OUTER JOIN M_PRODUCT p ON (iol.M_Product_ID=p.M_Product_ID)
LEFT OUTER JOIN M_ATTRIBUTESETINSTANCE asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_LOCATOR l ON (iol.M_Locator_ID=l.M_Locator_ID)
LEFT OUTER JOIN C_ORDERLINE ol ON (iol.C_OrderLine_ID=ol.C_OrderLine_ID)
LEFT OUTER JOIN C_CHARGE c ON (iol.C_Charge_ID=c.C_Charge_ID)
UNION -- BOM lines
SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy, iol.Updated, iol.UpdatedBy,
'en_US' AS AD_Language,
'en_US' AS AD_LANGUAGE,
iol.M_InOut_ID, iol.M_InOutLine_ID,
iol.Line+(bl.Line/100) AS Line, p.M_Product_ID,
--iol.MovementQty*b.BOMQty AS QtyInvoiced,
@ -43,11 +43,11 @@ SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy
--iol.QtyEntered*b.BOMQty AS QtyEntered,
CASE WHEN bl.IsQtyPercentage = 'N' THEN iol.QtyEntered*bl.QtyBOM ELSE iol.QtyEntered*(bl.QtyBatch / 100) END AS QtyEntered,
uom.UOMSymbol,
null, null, null,
p.Name, -- main line
NULL, NULL, NULL,
p.NAME, -- main line
b.Description, -- second line
p.DocumentNote, -- third line
p.UPC, p.SKU, p.Value AS ProductValue,
p.UPC, p.SKU, p.VALUE AS ProductValue,
iol.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z,
iol.M_AttributeSetInstance_ID, asi.M_AttributeSet_ID, asi.SerNo, asi.Lot, asi.M_Lot_ID,asi.GuaranteeDate,
p.Description AS ProductDescription, p.ImageURL,
@ -59,14 +59,13 @@ SELECT iol.AD_Client_ID, iol.AD_Org_ID, iol.IsActive, iol.Created, iol.CreatedBy
INNER JOIN M_Product p ON (b.M_ProductBOM_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM uom ON (p.C_UOM_ID=uom.C_UOM_ID)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);
*/
FROM PP_Product_BOM b -- BOM lines
INNER JOIN M_InOutLine iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_Product bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID)*/
FROM PP_PRODUCT_BOM b -- BOM lines
INNER JOIN M_INOUTLINE iol ON (b.M_Product_ID=iol.M_Product_ID)
INNER JOIN M_PRODUCT bp ON (bp.M_Product_ID=iol.M_Product_ID -- BOM Product
AND bp.IsBOM='Y' AND bp.IsVerified='Y' AND bp.IsPickListPrintDetails='Y')
INNER JOIN PP_Product_BOMLine bl ON (bl.PP_Product_BOM_ID=b.PP_Product_BOM_ID)
INNER JOIN M_Product p ON (bl.M_Product_ID=p.M_Product_ID) -- BOM line product
INNER JOIN PP_PRODUCT_BOMLINE bl ON (bl.PP_Product_BOM_ID=b.PP_Product_BOM_ID)
INNER JOIN M_PRODUCT p ON (bl.M_Product_ID=p.M_Product_ID) -- BOM line product
INNER JOIN C_UOM uom ON (p.C_UOM_ID=uom.C_UOM_ID)
LEFT OUTER JOIN M_AttributeSetInstance asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_Locator l ON (iol.M_Locator_ID=l.M_Locator_ID);
LEFT OUTER JOIN M_ATTRIBUTESETINSTANCE asi ON (iol.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID)
LEFT OUTER JOIN M_LOCATOR l ON (iol.M_Locator_ID=l.M_Locator_ID);

File diff suppressed because it is too large Load Diff