From 7b7c0b4eacb2959a1a4fbb22fba1c4445e221d38 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 22 十月 2024 18:10:50 +0800
Subject: [PATCH] 发动机物流报表总费用bug

---
 _Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl                                                         |    5 ++++-
 _Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl                                                           |    5 +++--
 _Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_MatrixEditorTable_358_OnUpdateValue.def |    2 ++
 _Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl                                                          |    4 ++++
 _Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl                                                         |    8 ++++----
 _Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl                                                        |    5 +++--
 _Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Response_MatrixEditorTable_OnUpdateValue.def     |    2 ++
 7 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
index d2e883a..62befe8 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport/Method_Generate.qbl
@@ -57,6 +57,10 @@
         yearcell.AllCost( yearcell.EstimateTotalCost() * [Real]yearcell.CoefficientValue() );
       }
     }
+    Transaction::Transaction().Propagate( attribute( CCEngineLogisticsCostCell, EstimateTotalCost ) );
+    traverse( yearcolumn, Cell, cell ){
+      cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
+    }
     traverse( sumrow, Cell, cell ){
       cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
       if( exists( cell.Column(), Cell, acell, acell.IsUpdate() ) ){
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
index c3051ae..108b822 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport0/Method_Generate.qbl
@@ -82,7 +82,10 @@
         yearcell.AllCost( yearcell.EstimateTotalCost() * [Real]yearcell.CoefficientValue() );
       }
     }
-    
+    Transaction::Transaction().Propagate( attribute( DLEngineLogisticsCostCell, EstimateTotalCost ) );
+    traverse( yearcolumn, Cell, cell ){
+      cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
+    }
     traverse( sumrow, Cell, cell ){
       cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() );
       if( exists( cell.Column(), Cell, acell, acell.IsUpdate() ) ){
diff --git a/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl b/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
index fa38c09..d816f95 100644
--- a/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
@@ -28,10 +28,11 @@
         }
       }
       if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
+        weekstartstr          := ' KW';
         for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
-          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
+          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();//Name := weekend.Format( "M2/D2/Y" )
           
-          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          this.Column( relnew, Name := weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
         }
       }
     }
diff --git a/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl b/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
index 64d6ac0..c81aa32 100644
--- a/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
@@ -30,15 +30,15 @@
       }else if( timeunit = Translations::MP_GlobalParameters_Week() ){
         weekstartstr          := ' KW';
         for( start := starttime; start <= endtime; start := start.StartOfNextWeek() ){
-          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
+          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();//weekend.Format( "M2/D2/Y" ).Concat( weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ) )
           
-          this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ).Concat( weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ) ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          this.InventorySummaryColumn( relnew, Name := weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
         }
       }else if( timeunit = Translations::MP_GlobalParameters_Month() ){
         for( start := starttime; start <= endtime; start := start.StartOfNextMonth() ){
-          monthend            := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
+          monthend            := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date();//monthend.Format( "M2/D2/Y" ).Concat( ' ' ).Concat( monthend.Format( "MM", us_locale ).Concat( '/').Concat( [String]monthend.Month() ).Concat( '鏈�' ) )
           us_locale := Locale::Construct( 'en_us' );
-          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ).Concat( ' ' ).Concat( monthend.Format( "MM", us_locale ).Concat( '/').Concat( [String]monthend.Month() ).Concat( '鏈�' ) ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
+          this.InventorySummaryColumn( relnew, Name := monthend.Format( "MM", us_locale ).Concat( '/').Concat( [String]monthend.Month() ).Concat( '鏈�' ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
         }
       }
     }
diff --git a/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl b/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
index 2bac9e3..04f00b1 100644
--- a/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -29,10 +29,11 @@
         }
       }
       if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
+        weekstartstr          := ' KW';
         for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
-          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
+          weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();// weekend.Format( "M2/D2/Y" )
           
-          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          this.Column( relnew, Name := weekstartstr.Concat( weekend.Week().Format( 'N(LPad0(2))' ) ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
         }
       }
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_MatrixEditorTable_358_OnUpdateValue.def b/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_MatrixEditorTable_358_OnUpdateValue.def
index 7cda122..56c7966 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_MatrixEditorTable_358_OnUpdateValue.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_MatrixEditorTable_358_OnUpdateValue.def
@@ -24,6 +24,8 @@
           tcel.WerkToRentTransCost( cell.WerkToRentTransCost() );
           tcel.RentStorCost( cell.RentStorCost() );
           tcel.CoefficientValue( cell.CoefficientValue() );
+          estimatetotalcost := tcel.RentInCost() + tcel.RentOutOfCost() + tcel.WerkToRentTransCost() + tcel.RentStorCost();
+          tcel.AllCost( estimatetotalcost * [Real]tcel.CoefficientValue() );
         }
       }
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Response_MatrixEditorTable_OnUpdateValue.def b/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Response_MatrixEditorTable_OnUpdateValue.def
index d14c74f..cb93775 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Response_MatrixEditorTable_OnUpdateValue.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Response_MatrixEditorTable_OnUpdateValue.def
@@ -31,6 +31,8 @@
           tcel.DLRentStorCost( cell.DLRentStorCost() );
           tcel.WerkToDLRentTransCost( cell.WerkToDLRentTransCost() );
           tcel.CoefficientValue( cell.CoefficientValue() );
+          estimatetotalcost := tcel.CCRentInCost() + tcel.CCRentOutOfCost() + tcel.CCLongTransCost() + tcel.CCRentStorCost() + tcel.CCShorTransCost() + tcel.DLRentInCost() + tcel.DLRentOutOfCost() + tcel.DLRentOtherCost() + tcel.DLRentStorCost() + tcel.WerkToDLRentTransCost();
+          tcel.AllCost( estimatetotalcost * [Real]tcel.CoefficientValue() );
         }
       }
     *]

--
Gitblit v1.9.3