CREATE OR REPLACE VIEW M_MOVEMENTLINEMA_VT
AS 
SELECT m.AD_Client_ID AS AD_Client_ID, m.AD_Org_ID AS AD_Org_ID, m.IsActive AS IsActive,
    m.Created AS Created, m.CreatedBy AS CreatedBy, m.Updated AS Updated, m.UpdatedBy AS UpdatedBy,
    p.AD_Language AS AD_Language,
    l.M_Movement_ID AS M_Movement_ID, m.M_MovementLine_ID AS M_MovementLine_ID, l.Line AS Line,
    l.M_Product_ID AS M_Product_ID,
    m.M_AttributeSetInstance_ID AS M_AttributeSetInstance_ID, m.MovementQty AS MovementQty,
    l.M_Locator_ID AS M_Locator_ID, l.M_LocatorTo_ID AS M_LocatorTo_ID 
FROM  M_MovementLineMA m 
    INNER JOIN M_MovementLine l ON (m.M_MovementLine_ID=l.M_MovementLine_ID)
    INNER JOIN M_Product_Trl p ON (l.M_PRODUCT_ID=p.M_PRODUCT_ID)
UNION 
SELECT l.AD_Client_ID AS AD_Client_ID, l.AD_Org_ID AS AD_Org_ID, l.IsActive AS IsActive,
    l.Created AS Created, l.CreatedBy AS CreatedBy, l.Updated AS Updated, l.UpdatedBy AS UpdatedBy,
    p.AD_Language AS AD_Language,
    l.M_Movement_ID AS M_Movement_ID, l.M_MovementLine_ID AS M_MovementLine_ID, l.Line AS Line, 
    l.M_Product_ID AS M_Product_ID,
    l.M_AttributeSetInstance_ID AS M_AttributeSetInstance_ID, l.MovementQty AS MovementQty,
    l.M_Locator_ID AS M_Locator_ID, l.M_LocatorTo_ID AS M_LocatorTo_ID 
FROM  M_MovementLine l
    INNER JOIN M_Product_Trl p ON (l.M_PRODUCT_ID=p.M_PRODUCT_ID)
/
