From 89c96171bb971dcaed7cf289b58ef44ca689523c Mon Sep 17 00:00:00 2001
From: limj <limj@taizhitech.com>
Date: 星期四, 21 九月 2023 09:11:20 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj

---
 _Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
index 6a24698..7ea305b 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
@@ -8,25 +8,26 @@
 {
   TextBody:
   [*
-    routingId := "PR_"+orgCode + "_" + productId;
-    unitId := "渚涘簲鍟�";
-    routingStepName := "Purchase";
-    operationId := orgCode + "_PR_" + productId;
-    routing := Routing::CreateOrUpdate( this, routingId );
-    toDeleteSteps := selectset( routing, RoutingStep, routingStep, true );
-    RoutingStep::Delete( toDeleteSteps );
-    routingStep := RoutingStep::Create( routing, routingStepName, "", true );
+    
     product := Product_MP::FindById( this, productId );
     if( isnull( product ) ) {
         info(  "product : " + productId + " not found" );
     }
-    stockingPointId := orgCode + "_" + productType + "_Stock";
+    stockingPointId := orgCode + "_Stock";
     stockingPoint := StockingPoint_MP::FindById( this, stockingPointId );
     if( isnull( stockingPoint ) ) {
         info( "stockingPoint : " + stockingPointId + " not found" );
     }
     
     if( not isnull( product) and not isnull( stockingPoint)){
+      routingId := "PR_"+orgCode + "_" + productId;
+      unitId := "渚涘簲鍟�";
+      routingStepName := "Purchase";
+      operationId := orgCode + "_PR_" + productId;
+      routing := Routing::CreateOrUpdate( this, routingId );
+      toDeleteSteps := selectset( routing, RoutingStep, routingStep, true );
+      RoutingStep::Delete( toDeleteSteps );
+      routingStep := RoutingStep::Create( routing, routingStepName, "", true );
       unit := Unit::FindById( this, unitId );
       if( isnull( unit ) ) {
         unit := this.Unit( relnew, 

--
Gitblit v1.9.3