From 712d2f68e0d1e9e111aa5d870283f4edf2da3739 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 22 十月 2024 14:10:28 +0800
Subject: [PATCH] 财务产量/销量报表刷新导出报错

---
 _Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl        |   21 +++++++++++++++------
 _Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl |    2 +-
 _Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl   |   21 +++++++++++++++------
 _Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl   |    2 +-
 4 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl b/_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl
index 3d8a7dc..2188d1d 100644
--- a/_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl
+++ b/_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl
@@ -38,12 +38,21 @@
           row                     := c.FinancialProductionRow();
           //Factory
           InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
-          //Generation
-          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
-          //Power
-          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
-          //MLBMQBS
-          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
+          if( not isnull( row.Product_MP() ) ){
+            //Generation
+            InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
+            //Power
+            InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
+            //MLBMQBS
+            InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
+          }else{
+            //Generation
+            InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, '' );
+            //Power
+            InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, '' );
+            //MLBMQBS
+            InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, '' );
+          }
           //Product
           InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
           //Unit
diff --git a/_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl b/_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
index 133fb6d..8e87020 100644
--- a/_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
@@ -38,7 +38,7 @@
           productids.Add( pisp.ProductID() );
           //褰損roduct planning鐨勬棩鏈熷尯闂村湪闇�瑕佺殑鏃ユ湡鍖洪棿鍐� 
           traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear and pispip.NewSupplyQuantity() <> 0 ){
-            dayperiodtime     := ( pispip.Start() + Duration::Days( 1 ) ).Date();
+            dayperiodtime     := pispip.Start().Date();
             dayperiodname     := dayperiodtime.Format( "M2/D2/Y" );
             periodtime        := dayperiodtime.StartOfMonth();
             periodname        := periodtime.Format( "M2/D2/Y" );
diff --git a/_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl b/_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl
index 73339a8..a0bf9ca 100644
--- a/_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl
@@ -38,12 +38,21 @@
           row                     := c.FinancialSalesRow();
           //Factory
           InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
-          //Generation
-          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
-          //Power
-          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
-          //MLBMQBS
-          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
+          if( not isnull( row.Product_MP() ) ){
+            //Generation
+            InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
+            //Power
+            InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
+            //MLBMQBS
+            InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
+          }else{
+            //Generation
+            InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, '' );
+            //Power
+            InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, '' );
+            //MLBMQBS
+            InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, '' );
+          }
           //Product
           InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
           //Unit
diff --git a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
index 18b51ad..208fe2e 100644
--- a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
@@ -81,7 +81,7 @@
           traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical()
                     and pispip.Period_MP().StartDate() < startofnextyear 
                     and ( pispip.DependentDemandAndSalesDemandQuantity() <> 0 or pispip.NewSupplyQuantity() <> 0 ) ){
-            dayperiodtime   := ( pispip.Start() + Duration::Days( 1 ) ).Date();
+            dayperiodtime   := pispip.Start().Date();
             dayperiodname   := dayperiodtime.Format( "M2/D2/Y" );
             periodtime      := dayperiodtime.StartOfMonth();
             periodname      := periodtime.Format( "M2/D2/Y" );

--
Gitblit v1.9.3