From 15bca552940ac3967dd7efd4fe28b14c4a8689db Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期六, 07 十月 2023 16:48:17 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj

---
 _Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
index c6a2bcf..39675d3 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
@@ -11,7 +11,13 @@
     // renhao Aug-14-2023 (created)
     queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
     queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
-    listtodeal := selectset( globalOTDTable,Global_MappingInventorySupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate /*and externalSupply.Date() <= queryEndDate*/);
+    organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businessTypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() );
+    listtodeal := selectset( globalOTDTable,
+                             Global_MappingInventorySupply,
+                             externalSupply, 
+                             ( externalSupply.UserQuantity()>0 ) and 
+                             ( externalSupply.Date() >= queryStartDate ) and 
+                             ( organcodelist.Find( externalSupply.StockingPointID().SubString( 0, 3 ) ) >= 0 )/*and externalSupply.Date() <= queryEndDate*/);
     totalcount := listtodeal.Size();
     description := "鍦ㄩ�斿湪鍒�";
     info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" );
@@ -32,7 +38,7 @@
         if( not isnull(businessTypes)){
         
           for( i :=0 ;i < businessTypes.Size();i++ ){
-            businessType := businessTypes.Element( i);
+            businessType := businessTypes.Element( i );
             if( product.BusinessType() = businessType and not product.IsCommon()){
               InventorySupply::CreateOrUpdate( externalSupply.ID(),
                                                productMP,

--
Gitblit v1.9.3