From 20470cd32eaebc49c5b8eea0e1908743846ade67 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期四, 05 九月 2024 17:26:55 +0800
Subject: [PATCH] 修复一些bug

---
 _Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl b/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
index a363c8e..822c41f 100644
--- a/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
+++ b/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
@@ -12,7 +12,11 @@
     }
     
     traverse ( archiveExecutionStatus, TemporaryDemandData, tdd ,tdd.Origin() = "" or tdd.StartDate() >= macroPlan.StartOfPlanning().Date()) {
-      targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = tdd.ProductID() );
+      targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.Notes() = tdd.ProductID() );
+      if( isnull( targetProduct_MP )){
+        targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = tdd.ProductID() );
+      }
+      // targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.Notes() = tdd.ProductID() );
       targetStockingPoint_MP := select( macroPlan, StockingPoint_MP, tempSPMP, tempSPMP.ID() = tdd.StockingPointID() );
       // info( tdd.SalesSegmentName() );
       if ( not isnull( targetProduct_MP ) and not isnull( targetStockingPoint_MP ) ) {
@@ -32,6 +36,9 @@
                           false );
         forcest.Origin( tdd.Origin() );
       }
+      if( isnull( targetProduct_MP )){
+        info( tdd.ProductID() + " -> 鏈壘鍒�" ); 
+      }
     }
   *]
 }

--
Gitblit v1.9.3