src-db/database/model/views/M_RM_RECEIPT_PICK_EDIT.xml
author RM packaging bot <staff.rm@openbravo.com>
Tue, 20 Feb 2018 05:47:07 +0000
changeset 33488 688fcca7af57
parent 33471 018323fa0ae3
child 33489 f1d8751dcbf9
permissions -rw-r--r--
Merge temporary head for 3.0PR17Q4.1
gorkaion@14489
     1
<?xml version="1.0"?>
gorkaion@14489
     2
  <database name="VIEW M_RM_RECEIPT_PICK_EDIT">
staff@33488
     3
    <view name="M_RM_RECEIPT_PICK_EDIT"><![CDATA[SELECT ol.c_orderline_id AS m_rm_receipt_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.created, ol.createdby, COALESCE(iol.updated, ol.updated) AS updated, ol.updatedby, iol.m_inout_id, CASE WHEN iol.m_inoutline_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.m_product_id, ol.c_uom_id, ol.m_attributesetinstance_id, (-1) * ol.qtyordered AS returned, (-1) * CASE WHEN uom_pref.property IS NOT NULL AND ol.c_uom_id IS NOT NULL THEN m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - ol.qtydelivered, ol.c_aum) ELSE ol.qtyordered - ol.qtydelivered END AS pendingqty, (-1) * COALESCE(iol.aumqty, iol.movementqty) AS receivingqty, iol.m_condition_goods_id, iol.m_locator_id, o.documentno AS returnorderno, o.issotrx, ol.line, iol.m_inoutline_id, ol.c_aum, (-1) * ol.aumqty AS aumqty, (-1) * CASE WHEN uom_pref.property IS NOT NULL AND ol.c_uom_id IS NOT NULL THEN ol.qtyordered - ol.qtydelivered ELSE m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - ol.qtydelivered, ol.c_aum) END AS pendingaumqty, CASE WHEN iol.m_inoutline_id IS NULL THEN COALESCE(ol.c_aum, ol.c_uom_id) ELSE COALESCE(iol.c_aum, iol.c_uom_id) END AS returneduom FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id JOIN m_product p ON ol.m_product_id = p.m_product_id JOIN c_doctype dt ON dt.c_doctype_id = o.c_doctypetarget_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT il2.m_inoutline_id, il2.ad_client_id, il2.ad_org_id, il2.isactive, il2.created, il2.createdby, il2.updated, il2.updatedby, il2.line, il2.description, il2.m_inout_id, il2.c_orderline_id, il2.m_locator_id, il2.m_product_id, il2.c_uom_id, il2.movementqty, il2.isinvoiced, il2.m_attributesetinstance_id, il2.isdescription, il2.quantityorder, il2.m_product_uom_id, il2.m_condition_goods_id, il2.c_aum, il2.aumqty FROM m_inoutline il2 JOIN m_inout i2 ON il2.m_inout_id = i2.m_inout_id AND i2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id LEFT JOIN (SELECT pref.property FROM ad_preference pref WHERE pref.property = 'UomManagement' AND to_char(pref.value) = 'Y' AND pref.ad_client_id = '0' AND pref.ad_org_id = '0' AND pref.visibleat_client_id IS NULL AND pref.visibleat_org_id IS NULL AND pref.visibleat_role_id IS NULL AND pref.ad_user_id IS NULL) uom_pref ON 1 = 1 WHERE (ol.qtyordered - ol.qtydelivered) <> 0 AND o.docstatus = 'CO']]></view>
gorkaion@14489
     4
  </database>