src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml
changeset 30926 a57c4aa5d672
parent 30867 edd3e38f88cb
parent 30781 7232cc0b37a9
child 32274 6a7d52c75508
--- a/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_RM_SHIPMENT_PICK_EDIT">
-    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT COALESCE(sd.m_storage_detail_id, '') || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END AS availableqty, (-1) * (ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0'))) AS pendingqty, iol.m_inout_id, CASE WHEN iol.m_inout_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id, p.isstocked, o.c_bpartner_id, ol.c_aum, (-1) * ol.aumqty AS aumqty, ol.c_uom_id AS returneduom, (-1) * m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0')), ol.c_aum) AS pendingaumqty, m_get_converted_aumqty(ol.m_product_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END, ol.c_aum) AS availableaumqty, m_get_converted_qty(ol.m_product_id, 1, ol.c_aum) AS rate FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N' LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0 LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN m_product p ON p.m_product_id = ol.m_product_id JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id FROM m_inoutline iol2 JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id WHERE o.docstatus = 'CO']]></view>
+    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT COALESCE(sd.m_storage_detail_id, '') || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END AS availableqty, (-1) * (ol.qtyordered - ol.qtydelivered) AS pendingqty, iol.m_inout_id, CASE WHEN iol.m_inout_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id, p.isstocked, o.c_bpartner_id, l.ad_org_id AS locatororg, ol.c_aum, (-1) * ol.aumqty AS aumqty, ol.c_uom_id AS returneduom, (-1) * m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0')), ol.c_aum) AS pendingaumqty, m_get_converted_aumqty(ol.m_product_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END, ol.c_aum) AS availableaumqty, m_get_converted_qty(ol.m_product_id, 1, ol.c_aum) AS rate FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N' AND o.isdelivered = 'N' JOIN m_product p ON p.m_product_id = ol.m_product_id LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0 JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id FROM m_inoutline iol2 JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id WHERE o.docstatus = 'CO' AND ol.qtyordered <> ol.qtydelivered]]></view>
   </database>