src-db/database/model/functions/M_INOUT_POST.xml
changeset 30292 676e26599466
parent 30291 61036197bbae
child 30781 7232cc0b37a9
child 30807 ecf75ad34ce3
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Thu Sep 15 14:04:47 2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Thu Sep 15 12:14:10 2016 -0400
@@ -1180,10 +1180,13 @@
               JOIN M_INOUTLINE iol
               ON ol.c_orderline_id = iol.c_orderline_id
               AND ol.m_product_id = iol.m_product_id
+              JOIN C_ORDER o
+              ON ol.c_order_id = o.c_order_id
               WHERE iol.m_inout_id = Cur_InOut.m_inout_id
               AND r.res_status <> 'DR'
               AND iol.movementqty > 0
               AND iol.canceled_inoutline_id IS NULL
+              AND o.docstatus <> 'CL'
               AND r.created = (
                 SELECT max(created)
                 FROM M_RESERVATION