From 99cac3bb9bc0baa321d7726d75854ab38bcddc05 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期四, 21 十一月 2024 14:11:15 +0800
Subject: [PATCH] 更新 StaticMethod_GenerateAnnualPlanReport.qbl

---
 _Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl b/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl
index 1ed5a93..16a39ea 100644
--- a/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl
+++ b/_Main/BL/Type_LocalCell_Default/StaticMethod_GenerateAnnualPlanReport.qbl
@@ -40,7 +40,7 @@
         localRowHandle := localRowIndexTree.GetHandle( row.ProductID() + row.ProductionLine() );
         localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
         if( isnull( localRowIndex )){
-          localRow := localTable.LocalRow( relnew,CustomName := row.Name(),ProductID := row.ProductID(),ProductionLine := row.ProductionLine(),Index := localTable.GetRowIndexCache() );
+          localRow := localTable.LocalRow( relnew,CustomName := row.ProductID() + " in " + row.ProductionLine(),ProductID := row.ProductID(),ProductionLine := row.ProductionLine(),Index := localTable.GetRowIndexCache() );
           localRows.Add( localRow );
           localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
         }else{
@@ -80,7 +80,7 @@
           localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + pisp_mp.StockingPoint_MP().Unit().Name() );
           localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue ));
           if( isnull( localRowIndex )){
-            localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.Name(),ProductID := pisp_mp.ProductID(),ProductionLine := pisp_mp.StockingPoint_MP().Unit().Name(),Index := localTable.GetRowIndexCache() );
+            localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + pisp_mp.StockingPoint_MP().Unit().Name(),ProductID := pisp_mp.ProductID(),ProductionLine := pisp_mp.StockingPoint_MP().Unit().Name(),Index := localTable.GetRowIndexCache() );
             localRows.Add( localRow );
             localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 );
           }else{
@@ -164,6 +164,26 @@
       row.Delete();
     }
     
+    traverse( localTable,LocalRow,row ){
+      cells := selectset( row,LocalCell,cell,true );
+      cellIndexTree := NamedValueTree::Create();
+      for( i := 0;i < cells.Size(); i++){
+        cell := cells.Element( i );
+        cellHandle := cellIndexTree.GetHandle( row.CustomName() + cell.LocalColumn().CustomDate().AsQUILL() + cell.LocalColumn().TimeUnit() );
+        cellIndexTree.Root().AddChild( cellHandle,i );
+      }
+      traverse( localTable,LocalColumn,column ){
+        cellHandle := cellIndexTree.GetHandle( row.CustomName() + column.CustomDate().AsQUILL() + column.TimeUnit() );
+        cellIndex := guard( cellIndexTree.Root().Child( cellHandle ),null( NamedValue ));
+        if( isnull( cellIndex )){
+          cell := row.LocalCell( relnew,LocalCell_Default,LocalColumn := column,RealValue := 0 );
+          cells.Add( cell );
+          cellIndexTree.Root().AddChild( cellHandle,cells.Size() - 1 );
+        }
+      } 
+    }
+    
+    
     return localTable;
   *]
 }

--
Gitblit v1.9.3