From b3987122cbbc46c5c59d3173f37fca3170b6dc5a Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期五, 17 一月 2025 08:17:32 +0800
Subject: [PATCH] 机加管线报表测试环境报错

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

diff --git a/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl b/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
index 353f594..aacfb9e 100644
--- a/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
+++ b/_Main/BL/Type_MachiningPipelineReport/Method_Generate.qbl
@@ -36,8 +36,14 @@
         }else{
           beforecolumn      := column.PreviousColumn();
           beforeinventory   := selectobject( showrow, Cell, c, c.Column() = beforecolumn );
-          ccinventoryqty    := beforeinventory.CCInventoryQty() + maxinventory.CCProductionQty() - maxinventory.CCToDLDepartureQty() + maxinventory.DLToCCArrivalQty() - maxinventory.CCAssemblyPlanQty();
-          dlinventoryqty    := beforeinventory.DLInventoryQty() + maxinventory.DLProductionQty() - maxinventory.DLToCCDepartureQty() + maxinventory.DLToCCDepartureQty() - maxinventory.DLAssemblyPlanQty();
+          beCCinventoryqty  := 0.0;
+          beDLinventoryqty  := 0.0;
+          if( not isnull( beforeinventory ) ){
+            beCCinventoryqty := beforeinventory.CCInventoryQty();
+            beDLinventoryqty := beforeinventory.DLInventoryQty();
+          }
+          ccinventoryqty    := beCCinventoryqty + maxinventory.CCProductionQty() - maxinventory.CCToDLDepartureQty() + maxinventory.DLToCCArrivalQty() - maxinventory.CCAssemblyPlanQty();
+          dlinventoryqty    := beDLinventoryqty + maxinventory.DLProductionQty() - maxinventory.DLToCCDepartureQty() + maxinventory.DLToCCDepartureQty() - maxinventory.DLAssemblyPlanQty();
         }
         sumcell  := selectobject( column, Cell, c, c.Row() = sumrow );
         if( isnull( sumcell ) ){

--
Gitblit v1.9.3