From 1a5a8be205641f5f79dd809f6c7e59fc84d76243 Mon Sep 17 00:00:00 2001
From: yunchai <yunying.chai@capgemini.com>
Date: 星期日, 08 十月 2023 09:11:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'refs/remotes/origin/dev'

---
 _Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
index f9cd042..a6f9a24 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
@@ -2,21 +2,26 @@
 #parent: #root
 Method MappingActualPISPIPData (
   Strings businessTypes,
+  GlobalOTDTable globalOTDTable,
   Boolean nuclear
 )
 {
   TextBody:
   [*
     // renhao Aug-14-2023 (created)
-    date := Date :: Today();
-    listtodeal := selectset( this,MappingActualPISPIP,actual,true );
+    organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businessTypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() );
+    listtodeal := selectset( globalOTDTable,
+                             Global_MappingActualProductInStockingPointInPeriod,
+                             actual,
+                             ( actual.ActualInventoryLevelEnd() > 0 ) and 
+                             ( organcodelist.Find( actual.StockingPointID().SubString( 0, 3 ) ) >= 0 ) );
     totalcount := listtodeal.Size();
     info( "ActualPISPIP has " + totalcount.AsQUILL() + " rows in total" );
     
     count := 0;
     traverse( listtodeal,Elements,actual){
       count := count + 1;
-      if( count - [Number](count/100) * 100 = 0 or count = totalcount ){
+      if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
         info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
         }
       product := select( this,MappingProduct,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true);
@@ -24,7 +29,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()){
             ActualProductInStockingPointInPeriod::CreateOrUpdate( this,
                                                                   actual.ProductID(),

--
Gitblit v1.9.3