src-db/database/model/views/M_INOUT_LINE_V.xml
author Eduardo Argal Guibert <eduardo.argal@openbravo.com>
Sat, 03 Apr 2010 15:59:56 +0200
changeset 6917 20af736f8ca9
parent 6912 38c773f35773
child 7022 825f121b6164
permissions -rw-r--r--
wrong views posstgre 8.4
adrian@94
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="VIEW M_INOUT_LINE_V">
antonio@776
     3
    <view name="M_INOUT_LINE_V"><![CDATA[SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, 'en_US' AS ad_language, iol.m_inout_id, iol.m_inoutline_id, iol.line, iol.movementqty, uom.uomsymbol, COALESCE(p.name, iol.description) AS name, 
eduardo@6917
     4
        CASE
eduardo@6917
     5
            WHEN p.name IS NOT NULL THEN iol.description
eduardo@6917
     6
            ELSE NULL
eduardo@6917
     7
        END AS description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id
eduardo@6917
     8
   FROM m_inoutline iol
eduardo@6917
     9
   JOIN c_uom uom ON iol.c_uom_id = uom.c_uom_id
antonio@777
    10
   LEFT JOIN m_product p ON iol.m_product_id = p.m_product_id
antonio@776
    11
UNION 
eduardo@6917
    12
 SELECT iol.ad_client_id, iol.ad_org_id, iol.isactive, iol.created, iol.createdby, iol.updated, iol.updatedby, 'en_US' AS 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, p.name, b.description, p.documentnote, p.upc, p.sku, p.value AS productvalue, iol.m_locator_id
eduardo@6917
    13
   FROM m_product_bom b
eduardo@6917
    14
   JOIN m_inoutline iol ON b.m_product_id = iol.m_product_id
antonio@777
    15
   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'
antonio@777
    16
   JOIN m_product p ON b.m_productbom_id = p.m_product_id
antonio@777
    17
   JOIN c_uom uom ON p.c_uom_id = uom.c_uom_id]]></view>
adrian@94
    18
  </database>