src-db/database/model/views/M_INOUT_LINE_VT.xml
changeset 799 fef2c5e2feb7
parent 777 6e89ba1fd7d9
child 6544 2e60729b9c13
equal deleted inserted replaced
798:4994e5a604bb 799:fef2c5e2feb7
     2   <database name="VIEW M_INOUT_LINE_VT">
     2   <database name="VIEW M_INOUT_LINE_VT">
     3     <view name="M_INOUT_LINE_VT"><![CDATA[SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line, iol.movementqty, uom.uomsymbol, COALESCE(COALESCE(pt.name, p.name), iol.description) AS name, 
     3     <view name="M_INOUT_LINE_VT"><![CDATA[SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line, iol.movementqty, uom.uomsymbol, COALESCE(COALESCE(pt.name, p.name), iol.description) AS name, 
     4         CASE
     4         CASE
     5             WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN iol.description
     5             WHEN COALESCE(pt.name, p.name) IS NOT NULL THEN iol.description
     6             ELSE NULL
     6             ELSE NULL
     7         END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
     7         END AS description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id
     8    FROM m_inoutline iol
     8    FROM m_inoutline iol
     9    JOIN c_uom_trl uom ON iol.c_uom_id = uom.c_uom_id
     9    JOIN c_uom_trl uom ON iol.c_uom_id = uom.c_uom_id
    10    LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
    10    LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
    11    LEFT JOIN m_product_trl pt ON iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
    11    LEFT JOIN m_product_trl pt ON iol.m_product_id = pt.m_product_id AND uom.ad_language = pt.ad_language
    12 UNION 
    12 UNION 
    13  SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, uom.uomsymbol, COALESCE(pt.name, p.name) AS name, b.description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id, iol.lot, iol.serno
    13  SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, uom.ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line + b.line / 100 AS line, iol.movementqty * b.bomqty AS movementqty, uom.uomsymbol, COALESCE(pt.name, p.name) AS name, b.description, COALESCE(pt.documentnote, p.documentnote) AS documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id
    14    FROM m_product_bom b
    14    FROM m_product_bom b
    15    JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
    15    JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
    16    JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = 'Y'
    16    JOIN m_product bp ON bp.m_product_id = iol.m_product_id AND bp.isbom = 'Y' AND bp.isverified = 'Y' AND bp.ispicklistprintdetails = 'Y'
    17    JOIN m_product p ON b.m_productbom_id = p.m_product_id
    17    JOIN m_product p ON b.m_productbom_id = p.m_product_id
    18    JOIN c_uom_trl uom ON p.c_uom_id = uom.c_uom_id
    18    JOIN c_uom_trl uom ON p.c_uom_id = uom.c_uom_id