From 3a9793f84b2e560f4ba9bbe9d35434a59f0e415a Mon Sep 17 00:00:00 2001 From: Greg Pazo Date: Fri, 11 Apr 2014 15:11:13 -0400 Subject: [PATCH] Issue #23157:do not create supply order if stocked --- .../api/functions/insertsalesline.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/foundation-database/api/functions/insertsalesline.sql b/foundation-database/api/functions/insertsalesline.sql index 5ac4fa702..ea31d1c93 100644 --- a/foundation-database/api/functions/insertsalesline.sql +++ b/foundation-database/api/functions/insertsalesline.sql @@ -1,5 +1,5 @@ CREATE OR REPLACE FUNCTION api.insertSalesLine(api.salesline) RETURNS boolean AS $$ --- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple. +-- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple. -- See www.xtuple.com/CPAL for the full text of the software license. DECLARE pNEW ALIAS FOR $1; @@ -86,14 +86,14 @@ BEGIN 0, pNEW.customer_pn, CASE - WHEN ((pNEW.create_order AND (_r.item_type = 'M')) OR - ((pNEW.create_order IS NULL) AND _r.itemsite_createwo)) THEN + WHEN ((pNEW.create_order AND (_r.item_type = 'M')) OR + ((pNEW.create_order IS NULL) AND _r.itemsite_createwo) AND (NOT _r.itemsite_stocked)) THEN 'W' - WHEN ((pNEW.create_order AND (_r.item_type = 'P')) OR - ((pNEW.create_order IS NULL) AND _r.itemsite_createsopr)) THEN + WHEN ((pNEW.create_order AND (_r.item_type = 'P')) OR + ((pNEW.create_order IS NULL) AND _r.itemsite_createsopr) AND (NOT _r.itemsite_stocked)) THEN 'R' - WHEN ((pNEW.create_order AND (_r.item_type = 'P') AND (_r.itemsite_createsopo)) OR - ((pNEW.create_order IS NULL) AND _r.itemsite_createsopo)) THEN + WHEN ((pNEW.create_order AND (_r.item_type = 'P') AND (_r.itemsite_createsopo)) OR + ((pNEW.create_order IS NULL) AND _r.itemsite_createsopo) AND (NOT _r.itemsite_stocked)) THEN 'P' END, getitemid(pNEW.substitute_for), @@ -106,4 +106,4 @@ BEGIN RETURN TRUE; END; -$$ LANGUAGE 'plpgsql'; +$$ LANGUAGE 'plpgsql'; \ No newline at end of file -- 2.39.2