From a35a334af2f2c626538e0f6245a36f1ce5a5536f Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期一, 25 十一月 2024 17:46:05 +0800
Subject: [PATCH] 上线/下线/库存存档bug

---
 _Main/BL/Type_AssemblyOnlinePlanVersion/StaticMethod_RefreshData.qbl |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/_Main/BL/Type_AssemblyOnlinePlanVersion/StaticMethod_RefreshData.qbl b/_Main/BL/Type_AssemblyOnlinePlanVersion/StaticMethod_RefreshData.qbl
index edb6767..fcc429a 100644
--- a/_Main/BL/Type_AssemblyOnlinePlanVersion/StaticMethod_RefreshData.qbl
+++ b/_Main/BL/Type_AssemblyOnlinePlanVersion/StaticMethod_RefreshData.qbl
@@ -8,7 +8,7 @@
   TextBody:
   [*
     //鏍规嵁褰撳墠鐗堟湰鐨勮閰嶄笂绾胯鍒�
-    interface.AssemblyOnlinePlanVersion( relflush );
+    //interface.AssemblyOnlinePlanVersion( relflush );
     allunit                := AssemblyOnlinePlanVersion::GetDefaultAllUnit();
     name                   := AssemblyOnlinePlanVersion::GetDefaultName();//search                 :=
     interface.AssemblyOnlinePlanVersionSearch( relnew, Product := allunit, ProductionLine := allunit, Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );//, TimeUnit := Translations::MP_GlobalParameters_Day()
@@ -26,11 +26,15 @@
     }
     traverse( macroPlan, NewAssemblyOnlinePlanRow, aoprow, aoprow.Type() = '1' ){
       row                  := table.GetRow( aoprow );
-      traverse( table, Column, column ){//, aopcolumns.Find( column.StartDate() ) > -1
+      traverse( table, Column, column, exists( aopcolumns, Elements, e, e = column.StartDate() ) ){//, aopcolumns.Find( column.StartDate() ) > -1
         qty                := sum( aoprow, NewAssemblyOnlinePlanCell, aopcell, column.StartDate() <= aopcell.NewAssemblyOnlinePlanColumn().StartDate()
                                          and column.EndDate() >= aopcell.NewAssemblyOnlinePlanColumn().StartDate(), aopcell.Quantity() );
         
         cell               := selectobject( row, Cell, cell, cell.Column() = column );
+        if( isnull( cell ) ){
+          cell             := column.Cell( relnew, InventoryWeight := 0, ProductionSerialNumber := 0, Quantity := 0, Shift := '', Value := '' );
+          row.Cell( relinsert, cell );
+        }
         cell.Quantity( qty );
       }
     }

--
Gitblit v1.9.3