From 7edeca2ed3587a88d7f94cacf05e49c8db610fb0 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期四, 10 十月 2024 17:54:26 +0800
Subject: [PATCH] 发动机物流成本部分bug处理

---
 _Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl                                          |    3 
 _Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl                                |    8 +
 _Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl                                       |    3 
 _Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl                                |    4 
 _Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl                                                 |    4 
 _Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl                             |   32 ++--
 _Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl                                 |    6 
 _Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw                                         |   10 
 _Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl                                   |   14 +-
 _Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl                           |    4 
 _Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl                                        |    5 
 _Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp                                                   |    5 
 _Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl                                 |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting#568.def   |    2 
 _Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl                                 |   13 +
 _Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl                                |    2 
 _Main/BL/Type_FinancialProductionRow/Method_Initialize#110.qbl                                        |    2 
 _Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl                                      |    4 
 _Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl                                  |   24 +-
 _Main/BL/Type_EnginePipelineReport/Method_Generate.qbl                                                |   16 +-
 _Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl                                                |    7 +
 _Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl                                    |    7 +
 _Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def        |    2 
 _Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl                                     |    1 
 _Main/Sys/Repr/Global/MachiningPipelineCell.qrp                                                       |    8 
 _Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl                                      |    8 +
 /dev/null                                                                                             |    8 -
 _Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl                                             |  180 +++++++++++++++++++++++++
 _Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl                                 |    2 
 _Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl                                        |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def |    2 
 _Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl                                   |    2 
 32 files changed, 316 insertions(+), 84 deletions(-)

diff --git a/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl b/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl
new file mode 100644
index 0000000..1467ced
--- /dev/null
+++ b/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQty.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute CCRentQty
+{
+  #keys: '3[415136.0.1184074701][415136.0.1184074700][415136.0.1184074702]'
+  Description: '闀挎槬澶栫搴撴暟閲�'
+  ValueType: Real
+}
diff --git a/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQuantity.qbl b/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQuantity.qbl
deleted file mode 100644
index cfd2692..0000000
--- a/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_CCRentQuantity.qbl
+++ /dev/null
@@ -1,8 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute CCRentQuantity
-{
-  #keys: '3[415136.0.1160164759][415136.0.1160164758][415136.0.1160164760]'
-  Description: '闀挎槬澶栫搴撴暟閲�'
-  ValueType: Number
-}
diff --git a/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl b/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl
new file mode 100644
index 0000000..84c8e7d
--- /dev/null
+++ b/_Main/BL/Type_CCEngineLogisticsCostCell0/Attribute_DLRentOtherCost.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute DLRentOtherCost
+{
+  #keys: '3[415136.0.1184074682][415136.0.1184074681][415136.0.1184074683]'
+  Description: '澶ц繛澶栫搴撳叾浠栬垂鐢�'
+  ValueType: Real
+}
diff --git a/_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl b/_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl
index d9421bb..1e59ade 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostCell0/Function_CalcEstimateTotalCost.qbl
@@ -4,10 +4,10 @@
 {
   TextBody:
   [*
-    // 鐢勫叞楦� Aug-12-2024 (created)
+    // 鐢勫叞楦� Aug-12-2024 (created) 
     
     value := this.CCRentInCost() + this.CCRentOutOfCost() + this.CCLongTransCost() + this.CCShorTransCost() + this.CCRentStorCost()
-    + this.DLRentInCost() + this.DLRentOutOfCost() + this.WerkToDLRentTransCost() + this.DLRentStorCost()
+    + this.DLRentInCost() + this.DLRentOutOfCost() + this.WerkToDLRentTransCost() + this.DLRentStorCost() + this.DLRentOtherCost()
     
     this.EstimateTotalCost( value );
   *]
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl
index 8d773b6..305d174 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Download.qbl
@@ -107,31 +107,31 @@
         }
         //澶栫搴撳叆搴撹垂鐢�
         rententercostcellElement := xmlDOM.CreateElement( "cell" );
-        rententercostcellElement.SetAttribute( "value", [String]c.RentInCost() );
+        rententercostcellElement.SetAttribute( "value", c.RentInCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( rententercostcellElement );
         //澶栫搴撳嚭搴撹垂鐢�
         rentoutcostcellElement := xmlDOM.CreateElement( "cell" );
-        rentoutcostcellElement.SetAttribute( "value", [String]c.RentOutOfCost() );
+        rentoutcostcellElement.SetAttribute( "value", c.RentOutOfCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( rentoutcostcellElement );
         //鍘傚唴鍒板绉熷簱杩愯緭璐圭敤
         factorytorenttranscostcellElement := xmlDOM.CreateElement( "cell" );
-        factorytorenttranscostcellElement.SetAttribute( "value", [String]c.WerkToRentTransCost() );
+        factorytorenttranscostcellElement.SetAttribute( "value", c.WerkToRentTransCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( factorytorenttranscostcellElement );
         //澶栫搴撲粨鍌ㄨ垂鐢�
         rentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
-        rentstoragecostcellElement.SetAttribute( "value", [String]c.RentStorCost() );
+        rentstoragecostcellElement.SetAttribute( "value", c.RentStorCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( rentstoragecostcellElement );
         //棰勮鎬昏垂鐢�
         estimatedtotalcostcellElement := xmlDOM.CreateElement( "cell" );
-        estimatedtotalcostcellElement.SetAttribute( "value", [String]c.EstimateTotalCost() );
+        estimatedtotalcostcellElement.SetAttribute( "value", c.EstimateTotalCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( estimatedtotalcostcellElement );
         //绯绘暟
         coefficientcellElement := xmlDOM.CreateElement( "cell" );
-        coefficientcellElement.SetAttribute( "value", [String]c.Coefficient() );
+        coefficientcellElement.SetAttribute( "value", c.Coefficient().Format( 'N(Dec)' ) );
         columnelement.AppendChild( coefficientcellElement );
         //鎬昏垂鐢�
         totalcostcellElement := xmlDOM.CreateElement( "cell" );
-        totalcostcellElement.SetAttribute( "value", [String]c.AllCost() );
+        totalcostcellElement.SetAttribute( "value", c.AllCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( totalcostcellElement );
       }
       tableElement.AppendChild( columnelement );  
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
index 69c2ade..3f5377f 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
@@ -154,7 +154,7 @@
                 if( not isnull( enginecost ) ){
                   periodtime   := pispip.Start().StartOfMonth().Date();
                   periodname   := periodtime.Format( "M2/D2/Y" );
-                  quantity     := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
+                  quantity     := ceil( [Number]pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
                   
                   column       := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
                   
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl
index 977a5d1..dae30bc 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Download.qbl
@@ -147,51 +147,51 @@
         }
         //闀挎槬澶栫搴撳叆搴撹垂鐢�
         ccrententercostcellElement := xmlDOM.CreateElement( "cell" );
-        ccrententercostcellElement.SetAttribute( "value", [String]c.CCRentInCost() );
+        ccrententercostcellElement.SetAttribute( "value", c.CCRentInCost().Format( 'N(Dec)' )  );
         columnelement.AppendChild( ccrententercostcellElement );
         //闀挎槬澶栫搴撳嚭搴撹垂鐢�
         ccrentoutcostcellElement := xmlDOM.CreateElement( "cell" );
-        ccrentoutcostcellElement.SetAttribute( "value", [String]c.CCRentOutOfCost() );
+        ccrentoutcostcellElement.SetAttribute( "value", c.CCRentOutOfCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( ccrentoutcostcellElement );
         //闀挎槬闀块�旇繍杈撹垂鐢�
         cclongtranscostcellElement := xmlDOM.CreateElement( "cell" );
-        cclongtranscostcellElement.SetAttribute( "value", [String]c.CCLongTransCost() );
+        cclongtranscostcellElement.SetAttribute( "value", c.CCLongTransCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( cclongtranscostcellElement );
         //闀挎槬鐭�旇繍杈撹垂鐢�
         ccshorttranscostcellElement := xmlDOM.CreateElement( "cell" );
-        ccshorttranscostcellElement.SetAttribute( "value", [String]c.CCShorTransCost() );
+        ccshorttranscostcellElement.SetAttribute( "value", c.CCShorTransCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( ccshorttranscostcellElement );
         //闀挎槬澶栫搴撲粨鍌ㄨ垂鐢�
         ccrentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
-        ccrentstoragecostcellElement.SetAttribute( "value", [String]c.CCRentStorCost() );
+        ccrentstoragecostcellElement.SetAttribute( "value", c.CCRentStorCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( ccrentstoragecostcellElement );
         //澶ц繛澶栫搴撳叆搴撹垂鐢�
         dlrententercostcellElement := xmlDOM.CreateElement( "cell" );
-        dlrententercostcellElement.SetAttribute( "value", [String]c.DLRentInCost() );
+        dlrententercostcellElement.SetAttribute( "value", c.DLRentInCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( dlrententercostcellElement );
         //澶ц繛澶栫搴撳嚭搴撹垂鐢�
         dlrentoutcostcellElement := xmlDOM.CreateElement( "cell" );
-        dlrentoutcostcellElement.SetAttribute( "value", [String]c.DLRentOutOfCost() );
+        dlrentoutcostcellElement.SetAttribute( "value", c.DLRentOutOfCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( dlrentoutcostcellElement );
         //鍘傚唴鍒板绉熷簱杩愯緭璐圭敤
         factorytorenttranscostcellElement := xmlDOM.CreateElement( "cell" );
-        factorytorenttranscostcellElement.SetAttribute( "value", [String]c.WerkToDLRentTransCost() );
+        factorytorenttranscostcellElement.SetAttribute( "value", c.WerkToDLRentTransCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( factorytorenttranscostcellElement );
         //澶ц繛澶栫搴撲粨鍌ㄨ垂鐢�
         dlrentstoragecostcellElement := xmlDOM.CreateElement( "cell" );
-        dlrentstoragecostcellElement.SetAttribute( "value", [String]c.DLRentStorCost() );
+        dlrentstoragecostcellElement.SetAttribute( "value", c.DLRentStorCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( dlrentstoragecostcellElement );
         //棰勮鎬昏垂鐢�
         estimatedtotalcostcellElement := xmlDOM.CreateElement( "cell" );
-        estimatedtotalcostcellElement.SetAttribute( "value", [String]c.EstimateTotalCost() );
+        estimatedtotalcostcellElement.SetAttribute( "value", c.EstimateTotalCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( estimatedtotalcostcellElement );
         //绯绘暟
         coefficientcellElement := xmlDOM.CreateElement( "cell" );
-        coefficientcellElement.SetAttribute( "value", [String]c.Coefficient() );
+        coefficientcellElement.SetAttribute( "value", c.Coefficient().Format( 'N(Dec)' ) );
         columnelement.AppendChild( coefficientcellElement );
         //鎬昏垂鐢�
         totalcostcellElement := xmlDOM.CreateElement( "cell" );
-        totalcostcellElement.SetAttribute( "value", [String]c.AllCost() );
+        totalcostcellElement.SetAttribute( "value", c.AllCost().Format( 'N(Dec)' ) );
         columnelement.AppendChild( totalcostcellElement );
       }
       tableElement.AppendChild( columnelement );  
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
index bb63502..fe1aaa7 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -62,7 +62,7 @@
                 if( not isnull( enginecost ) ){
                   products.Add( product );
                   cell       := selectobject( row, Cell, cell, cell.Column() = column );
-                  cell.CCRentQuantity( cell.CCRentQuantity() + quantity );
+                  cell.CCRentQty( cell.CCRentQty() + quantity );
                   //闀挎槬澶栫搴撳叆搴撹垂鐢細鍏ュ簱閲�/鍖呰瀹归噺*鍏ュ簱鍗曚环
                   entercost  := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                   //闀挎槬澶栫搴撳嚭搴撹垂鐢�: 鍑哄簱閲�/鍖呰瀹归噺*鍑哄簱鍗曚环
diff --git a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl
index 47d9f59..aa66e0d 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_InitializeNew.qbl
@@ -35,11 +35,11 @@
     traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '澶栫搴�' ) ){
     //  unit                    := stockingpoint.Unit();
     //  parentunits             := unit.GetAllParent();
-      //鏄惁灞炰簬闀挎槬澶栫搴�
+      //鏄惁灞炰簬闀挎槬澶栫搴撶敤浜庨暱鏄ュ绉熷簱浠撳偍璐圭敤
       isccrent                := stockingpoint.ID().StartsWith( '闀挎槬' ) or stockingpoint.ID().StartsWith( 'CC' );
-      //鏄惁灞炰簬澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴�
+      //鏄惁灞炰簬澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴撶敤浜庨暱鏄ュ叆搴�/鍑哄簱璐圭敤
       isdltoccrent            := stockingpoint.ID().StartsWith( '澶ц繛鍙戝姩鏈虹殑闀挎槬' );
-      //鏄惁灞炰簬澶ц繛澶栫搴�
+      //鏄惁灞炰簬澶ц繛澶栫搴撶敤浜庡ぇ杩炲绉熷簱浠撳偍璐圭敤
       isdlrent                := stockingpoint.ID().StartsWith( '澶ц繛' ) or stockingpoint.ID().StartsWith( 'DL' );
       if( isccrent or isdlrent ){
         traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() 
@@ -63,16 +63,15 @@
                   enginecost  := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                      and engine.Factory() = ccfactory );
                    if( not isnull( enginecost ) ){
-                     quantity :=   [Number]pispip.NewSupplyQuantity();
                      if( isccrent ){
-                       cost        := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
-                       cell.CCRentStorCost( cell.CCRentStorCost() + cost );
+                       cost        := ceil( pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
+                       cell.CCRentStorCost( cell.CCRentStorCost() + cost );//闀挎槬澶栫搴撲粨鍌ㄨ垂鐢�
                      }else{
-                       cell.CCRentQuantity( cell.CCRentQuantity() + quantity );
-                       //闀挎槬澶栫搴撳叆搴撹垂鐢細鍏ュ簱閲�/鍖呰瀹归噺*鍏ュ簱鍗曚环
-                       entercost  := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
+                       cell.CCRentQty( cell.CCRentQty() + pispip.NewSupplyQuantity() );
+                       //闀挎槬澶栫搴撳叆搴撹垂鐢細鍏ュ簱閲�/鍖呰瀹归噺*鍏ュ簱鍗曚环 
+                       entercost  := ceil( pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
                        //闀挎槬澶栫搴撳嚭搴撹垂鐢�: 鍑哄簱閲�/鍖呰瀹归噺*鍑哄簱鍗曚环
-                       outcost    := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice();
+                       outcost    := ceil( pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.OutboundPrice();
                        cell.CCRentInCost( cell.CCRentInCost() + entercost );
                        cell.CCRentOutOfCost( cell.CCRentOutOfCost() + outcost );
                      }
@@ -82,8 +81,8 @@
                   enginecost     := selectobject( enginecosts, Elements, engine, engine.StartDate() <= pispip.Start().Date() and engine.EndDate() >= pispip.Start().Date()
                                                      and engine.Factory() = dlfactory  );
                    if( not isnull( enginecost ) ){
-                     cost        := ceil( [Number]pispip.NewSupplyQuantity() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
-                     cell.DLRentStorCost( cell.DLRentStorCost() + cost );
+                     cost        := ceil( [Number]pispip.PlannedInventoryLevelEnd() / enginecost.PackagingCapacity() ) * enginecost.StoragePrice();//鍥涜垗浜斿叆
+                     cell.DLRentStorCost( cell.DLRentStorCost() + cost );//澶ц繛澶栫搴撲粨鍌ㄨ垂鐢�
                    }
                 }
               }   
@@ -242,18 +241,23 @@
           enginecosts         := selectset( owner, LogisticsCostEngine, engine, engine.PackagingCapacity() <> 0 and engine.Generation().ToLower() = product.Generation().ToLower() 
                                                  and engine.MLB_MQB() = product.MQBMLB()
                                                  and engine.Factory() = ccfactory );
+          //鍦ㄨ繍杈撴垚鏈弬鏁拌〃閲屾壘鍒板彂鍔ㄦ満瀵瑰簲杩愯緭鍗曚环鍜岃杞藉閲�
+          transcosts           := selectset( owner, LogisticsCostTransport, trans, trans.LoadingCapacity() <> 0 and trans.Origin() = '闀挎槬澶栫搴�'
+                                                  and trans.Destination() = '瀹㈡埛搴�'
+                                                  and exists( productparents, Elements, e, ifexpr( trans.Product().FindString( '鍙戝姩鏈�', 0 ) >= 0, e.ID() = produtparent,  e.ID() = trans.Product() ) ) );
           if( not isnull( enginecosts ) and enginecosts.Size() > 0 ){
             products.Add( forecast.Product_MP() );
             row               := table.GetRow( forecast.ProductID() );
             traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() > 0 ){
               enginecost      := selectobject( enginecosts, Elements, engine, engine.StartDate() <= psdip.StartDate() and engine.EndDate() >= psdip.StartDate() );
+              transcost       := selectobject( transcosts, Elements, trans, trans.StartDate() <= psdip.StartDate() and trans.EndDate() >= psdip.StartDate() );
               if( not isnull( enginecost ) ){
                 periodtime    := psdip.StartDate().StartOfMonth();
                 periodname    := periodtime.Format( "M2/D2/Y" );
           //      info( '-------------------------', periodname, periodtime );
                 column         := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
           //      info( '-------------------------', column.Name() );
-                cost           := ceil( [Number]psdip.Quantity() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
+                cost           := ceil( ceil( [Number]psdip.Quantity() / enginecost.PackagingCapacity() ) / transcost.LoadingCapacity() ) * transcost.TransportPrice();
                 cell           := selectobject( row, Cell, cell, cell.Column() = column );
                 cell.CCShorTransCost( cell.CCShorTransCost() + cost );
               }
@@ -269,7 +273,7 @@
       e.RowNr( i );
       i := i + 1;
     }
-    info( '-------------------------------------end---------------------------------' );
+    info( '-------------------------------------end----------------------------------' );
     //
     showtable.Generate( search, products );
   *]
diff --git a/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl b/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl
index 691a01c..8445a49 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentEnterCost.qbl
@@ -8,13 +8,15 @@
 {
   TextBody:
   [*
-    // 鐢勫叞楦� Jun-24-2024 (created)
+    // 鐢勫叞楦� Jun-24-2024 (created) 
     cell := selectobject( this, Cell, cell, cell.Column() = column );
-    quantity      := [Number]fpcell.Value() - cell.CCRentQuantity();
+    quantity      := fpcell.Quantity() - cell.CCRentQty();
     //鍏ュ簱閲�/鍖呰瀹归噺*鍏ュ簱鍗曚环锛屽叆搴撻噺绛変簬闀挎槬浜ч噺
     cost          := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
+    othercost     := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.OtherPrice();
           
     value := cell.DLRentInCost() + cost;
     cell.DLRentInCost( value );
+    cell.DLRentOtherCost( cell.DLRentOtherCost() + othercost );
   *]
 }
diff --git a/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl b/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl
index 50f77e6..2c253f0 100644
--- a/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl
+++ b/_Main/BL/Type_CCEngineLogisticsCostRow0/Method_SetDLRentOutCost.qbl
@@ -10,7 +10,7 @@
   [*
     // 鐢勫叞楦� Jun-24-2024 (created)
     cell := selectobject( this, Cell, cell, cell.Column() = column );
-    quantity      := [Number]fscell.Value() - cell.CCRentQuantity();
+    quantity      := [Number]fscell.Value() - cell.CCRentQty();
     //鍏ュ簱閲�/鍖呰瀹归噺*鍏ュ簱鍗曚环锛屽叆搴撻噺绛変簬闀挎槬浜ч噺
     cost          := ceil( quantity / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
           
diff --git a/_Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl b/_Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl
new file mode 100644
index 0000000..d4aa014
--- /dev/null
+++ b/_Main/BL/Type_ChangeLossSetting/Attribute_ShowChangeLossNumber.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ShowChangeLossNumber
+{
+  #keys: '3[415136.0.1184074662][415136.0.1184074661][415136.0.1184074663]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl b/_Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl
new file mode 100644
index 0000000..4cf78cc
--- /dev/null
+++ b/_Main/BL/Type_ChangeLossSetting/Function_CalcShowChangeLossNumber.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcShowChangeLossNumber
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Oct-10-2024 (created)
+    
+    value := [String]this.ChangeLossNumber();
+    
+    this.ShowChangeLossNumber( value );
+  *]
+}
diff --git a/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl b/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
index ebd5300..892d832 100644
--- a/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
+++ b/_Main/BL/Type_ChangeLossSetting/StaticMethod_ValidateInput.qbl
@@ -29,13 +29,15 @@
       feedback := Translations::MP_LibCal_Event_ValidDatePeriod();
     }
     if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit and not ( cls.StartDate() > enddate or cls.EndDate() < startdate )
-                and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) 
-                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
+                and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){
+    //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) 
+    //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
       feedback := Translations::MP_ChangeLossSetting_Exist()
     }
     if( exists( owner, ChangeLossSetting, cls, cls <> old and cls.Unit() = unit  and not ( cls.StartDate() > enddate or cls.EndDate() < startdate )
-                and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) 
-                      or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
+                and cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) ){
+    //            and ( ( cls.ProductFirst() = product1 and cls.ProductSecond() = product2 ) 
+    //                  or ( cls.ProductFirst() = product2 and cls.ProductSecond() = product1 ) ) ) ){
       feedback := Translations::MP_ChangeLossSetting_DateCoincide()
     }
     
diff --git a/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl b/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
index cd19c53..5d5baa7 100644
--- a/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
+++ b/_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
@@ -23,13 +23,13 @@
     models                  := selectuniquevalues( table, Column.Cell.Demand, demand, demand.Model() );
     cellnr                  := 5 + models.Size();
     //鍚堣琛�
-    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '鐢熶骇', rows.Size() * cellnr, true );
+    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '鎬讳骇閲�', rows.Size() * cellnr, true );
     sumrowdlproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '澶ц繛浜ч噺', sumrowproduction.RowNr() + 1, false );
     sumrowccproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '闀挎槬浜ч噺', sumrowproduction.RowNr() + 2, false );
-    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '闇�姹�', sumrowproduction.RowNr() + 3, false );
+    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '鎬婚渶姹�', sumrowproduction.RowNr() + 3, false );
     rowno                   := sumrowproduction.RowNr() + 4;
     traverse( models, Elements, model ){
-      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model, rowno, false ); 
+      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model.Concat( '闇�姹�' ), rowno, false ); 
       rowno                 := rowno + 1;
     }
     sumrowinventory         := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '搴撳瓨', rowno, false );
@@ -38,10 +38,10 @@
     rownr                   := 0;
     traverse( rows, Elements, row, productids.Find( row.Name() ) >= 0 ){
     
-      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '鐢熶骇', rownr, true );;
+      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '鎬荤敓浜�', rownr, true );;
       showrowdlproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '澶ц繛浜ч噺', rownr + 1, false );
       showrowccproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '闀挎槬浜ч噺', rownr + 2, false );
-      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '闇�姹�', rownr + 3, false );
+      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '鎬婚渶姹�', rownr + 3, false );
       rownr               := rownr + 4;
       modelsnr            := rownr + 3;
       models              := construct( Strings );
@@ -50,7 +50,7 @@
       traverse( uniquemodels, Elements, e ){
     
         if( rownr < modelsnr ){
-          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e, rownr, false ); 
+          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e.Concat( '闇�姹�' ), rownr, false ); 
           models.Add( e );
           rownr             := rownr + 1;
         }
@@ -114,8 +114,8 @@
           sumdemand.Value( [String]( [Real]sumdemand.Value() + cell.DemandQuantity() ) );
           
           traverse( cell, Demand, demand, exists( models, Elements, model, model = demand.Model() ) ){
-            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
-            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model() ) );
+            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '闇�姹�' ) ) );
+            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '闇�姹�' ) ) );
     
             if( not isnull( demandrow ) ){
               demandcell             := column.CellValue( relnew, Value := [String]demand.Quantity() );
diff --git a/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl b/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
index f579568..fa38c09 100644
--- a/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl
@@ -29,10 +29,9 @@
       }
       if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
         for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
-          periodname          := start.Format( "M2/D2/Y" );
           weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
           
-          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
         }
       }
     }
diff --git a/_Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl b/_Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl
new file mode 100644
index 0000000..43b285e
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineReport/Method_GenerateNew.qbl
@@ -0,0 +1,180 @@
+Quintiq file version 2.0
+#parent: #root
+Method GenerateNew (
+  EnginePipelineSearch search,
+  Product_MPs products
+)
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    table                   := selectobject( this, Source.Report, report, not report.IsShow() );
+    //娓呯┖涔嬪墠瀛樺偍鐨勬樉绀烘暟鎹�
+    this.Clear( search.TimeUnit(), search.StartDate(), search.EndDate() );
+    Transaction::Transaction().Propagate( attribute( EnginePipelineColumn, Index ) );
+    Transaction::Transaction().Propagate( attribute( EnginePipelineCell, ProductionQuantity ) );
+    Transaction::Transaction().Propagate( attribute( EnginePipelineCell, DemandQuantity ) );
+    //杩囨护鍚庣殑浜у搧id
+    productids              := selectuniquevalues( products, Elements, product, true, product.ID() );
+    rows                    := selectsortedset( table, Row, row, row.RowNr() );
+    //鏄剧ず鍒�
+    productcolumn           := selectobject( this, Column, column, column.Index() = 0 );
+    attricolumn             := selectobject( this, Column, column, column.Index() = 1 );
+    models                  := selectuniquevalues( table, Column.Cell.Demand, demand, demand.Model() );
+    cellnr                  := 5 + models.Size();
+    //鍚堣琛�
+    sumrowproduction        := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '鎬讳骇閲�', rows.Size() * cellnr, true );
+    sumrowdlproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '澶ц繛浜ч噺', sumrowproduction.RowNr() + 1, false );
+    sumrowccproduction      := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '闀挎槬浜ч噺', sumrowproduction.RowNr() + 2, false );
+    sumrowdemand            := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '鎬婚渶姹�', sumrowproduction.RowNr() + 3, false );
+    rowno                   := sumrowproduction.RowNr() + 4;
+    traverse( models, Elements, model ){
+      EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', model.Concat( '闇�姹�' ), rowno, false ); 
+      rowno                 := rowno + 1;
+    }
+    sumrowinventory         := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, 'SUM', '搴撳瓨', rowno, false );
+    
+    //琛岃鏁�
+    rownr                   := 0;
+    traverse( rows, Elements, row, productids.Find( row.Name() ) >= 0 ){
+    
+    //浜у搧鏄剧ず琛�
+      showrowproduction   := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '鎬荤敓浜�', rownr, true );;
+      showrowdlproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '澶ц繛浜ч噺', rownr + 1, false );
+      showrowccproduction := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '闀挎槬浜ч噺', rownr + 2, false );
+      showrowdemand       := EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '鎬婚渶姹�', rownr + 3, false );
+      rownr               := rownr + 4;
+      modelsnr            := rownr + 3;
+      models              := construct( Strings );
+      uniquemodels        := selectuniquevalues( row, Cell.Demand, demand, true, demand.Model() );
+    //闇�姹傛樉绀�
+      traverse( uniquemodels, Elements, e ){
+    
+        if( rownr < modelsnr ){
+          EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), e.Concat( '闇�姹�' ), rownr, false ); 
+          models.Add( e );
+          rownr             := rownr + 1;
+        }
+      }
+    //绌洪渶姹傝ˉ鍏�
+      for( rownr := rownr; rownr < modelsnr; rownr ++ ){
+    
+        EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '', rownr, false ); 
+      }
+      showrowinventory    :=  EnginePipelineRow::CraeteCellValueForRow( this, productcolumn, attricolumn, row.Name(), '搴撳瓨', rownr, false );
+    
+    //  traverse( this, Column, column ){
+    //    //鏌ヨ鏃堕棿绫诲瀷涓篸ay鐨勫崟鍏冩牸
+    //    daycells          := selectset( row, Cell, daycell, daycell.Column().TimeUnit() = Translations::MP_GlobalParameters_Day() and
+    //                                        cell.Column().StartDate() >= column.StartDate() and 
+    //                                        cell.Column().StartDate() <= column.EndaDate() );
+      traverse( row, Cell, cell, cell.Column().TimeUnit() = search.TimeUnit() ){
+    
+        column            := selectobject( this, Column, column, column.Name() = cell.Column().Name() and column.TimeUnit() = search.TimeUnit() );
+        
+        if( not isnull( column ) ){
+          
+          //鐢熶骇
+          production              := column.CellValue( relnew, Value := [String]cell.ProductionQuantity() );
+          showrowproduction.CellValue( relinsert, production );
+          sumproduction           := selectobject( column, CellValue, c, c.Row() = sumrowproduction );
+    
+          if( isnull( sumproduction ) ){
+            sumproduction         := column.CellValue( relnew, Value := [String]0 );
+            sumrowproduction.CellValue( relinsert, sumproduction );
+          }
+          sumproduction.Value( [String]( [Real]sumproduction.Value() + cell.ProductionQuantity() ) );
+    
+          //澶ц繛浜ч噺
+          dlproductionquantity     := guard( cell.Production().DLProduction(), 0 );
+          dlproduction             := column.CellValue( relnew, Value := [String]dlproductionquantity );
+          showrowdlproduction.CellValue( relinsert, dlproduction );
+          sumdlproduction          := selectobject( column, CellValue, c, c.Row() = sumrowdlproduction );
+    
+          if( isnull( sumdlproduction ) ){
+            sumdlproduction        := column.CellValue( relnew, Value := [String]0 );
+            sumrowdlproduction.CellValue( relinsert, sumdlproduction );
+          }
+          sumdlproduction.Value( [String]( [Real]sumdlproduction.Value() + dlproductionquantity ) );
+          
+          //闀挎槬浜ч噺
+          ccproductionquantity     := guard( cell.Production().CCProduction(), 0 );
+          ccproduction             := column.CellValue( relnew, Value := [String]ccproductionquantity );
+          showrowccproduction.CellValue( relinsert, ccproduction );
+          sumccproduction          := selectobject( column, CellValue, c, c.Row() = sumrowccproduction );
+    
+          if( isnull( sumccproduction ) ){
+            sumccproduction        := column.CellValue( relnew, Value := [String]0 );
+            sumrowccproduction.CellValue( relinsert, sumccproduction );
+          }
+          sumccproduction.Value( [String]( [Real]sumccproduction.Value() + ccproductionquantity ) );
+          
+          //闇�姹�
+          totaldemand              := column.CellValue( relnew, Value := [String]cell.DemandQuantity() );
+          showrowdemand.CellValue( relinsert, totaldemand );
+          sumdemand                := selectobject( column, CellValue, c, c.Row() = sumrowdemand );
+          if( isnull( sumdemand ) ){
+            sumdemand              := column.CellValue( relnew, Value := [String]0 );
+            sumrowdemand.CellValue( relinsert, sumdemand );
+          }
+          sumdemand.Value( [String]( [Real]sumdemand.Value() + cell.DemandQuantity() ) );
+          
+          traverse( cell, Demand, demand, exists( models, Elements, model, model = demand.Model() ) ){
+            demandrow              := selectobject( this, Row, r, r.Name() = row.Name() and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '闇�姹�' ) ) );
+            sumdemandrow           := selectobject( this, Row, r, r.Name() = 'SUM' and exists( r, CellValue, cv, cv.Column() = attricolumn and cv.Value() = demand.Model().Concat( '闇�姹�' ) ) );
+    
+            if( not isnull( demandrow ) ){
+              demandcell             := column.CellValue( relnew, Value := [String]demand.Quantity() );
+              demandrow.CellValue( relinsert, demandcell );
+            }
+            if( not isnull( sumdemandrow ) ){
+            sumdemandcell          := selectobject( column, CellValue, c, c.Row() = sumdemandrow );
+            if( isnull( sumdemandcell ) ){
+              sumdemandcell        := column.CellValue( relnew, Value := [String]0 );
+              sumdemandrow.CellValue( relinsert, sumdemandcell );
+            }
+            sumdemandcell.Value( [String]( [Real]sumdemandcell.Value() + demand.Quantity() ) );
+            }
+          }
+    
+          for( demandr := showrowdemand.RowNr() + 1; demandr < showrowinventory.RowNr(); demandr := demandr + 1 ){
+            demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = row.Name() );
+            if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
+              demandcell           := column.CellValue( relnew, Value := '' );
+              demandrow.CellValue( relinsert, demandcell );
+            }
+          }
+    
+          
+          //搴撳瓨
+          inventory                := column.CellValue( relnew, Value := [String]cell.InventoryQuantity() );
+          showrowinventory.CellValue( relinsert, inventory );
+          suminventory             := selectobject( column, CellValue, c, c.Row() = sumrowinventory );
+          if( isnull( suminventory ) ){
+            suminventory           := column.CellValue( relnew, Value := [String]0 );
+            sumrowinventory.CellValue( relinsert, suminventory );
+          }
+          suminventory.Value( [String]( [Real]suminventory.Value() + cell.InventoryQuantity() ) );
+    
+        }
+      }
+    }
+    traverse( this, Column, column ){
+      for( demandr := sumrowdemand.RowNr() + 1; demandr < sumrowinventory.RowNr(); demandr := demandr + 1 ){
+        demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = 'SUM' );
+    //    info( '------------------14----------------' );
+        if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
+          demandcell           := column.CellValue( relnew, Value := '' );
+          demandrow.CellValue( relinsert, demandcell );
+        }
+      }
+    }
+    
+    rows := selectsortedset( this, Row, row, row.Name(), row.RowNr() );
+    i    := 0;
+    traverse( rows, Elements, e ){
+      e.RowNr( i );
+      i := i + 1;
+    }
+  *]
+}
diff --git a/_Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl b/_Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl
new file mode 100644
index 0000000..bfdefe3
--- /dev/null
+++ b/_Main/BL/Type_EnginePipelineRow/Attribute_ShowName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ShowName
+{
+  #keys: '3[415136.0.1185710016][415136.0.1185710015][415136.0.1185710017]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl b/_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl
index bef755c..98c8ffe 100644
--- a/_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl
+++ b/_Main/BL/Type_EnginePipelineRow/StaticMethod_CraeteCellValueForRow.qbl
@@ -21,6 +21,10 @@
     acell         := attricolumn.CellValue( relnew, Value := attriname );
     row.CellValue( relinsert, pcell );
     row.CellValue( relinsert, acell );
+    traverse( table, Column, column, column.Index() > 1 ){
+      cell        := column.CellValue( relnew, Value := '0' );
+      row.CellValue( relinsert, cell );
+    }
     return row;
   *]
 }
diff --git a/_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl b/_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl
index eb3e7a1..9dc13b7 100644
--- a/_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl
+++ b/_Main/BL/Type_FinancialProductionImportData/Function_CalcQuantity.qbl
@@ -6,7 +6,7 @@
   [*
     // 鐢勫叞楦� Aug-8-2024 (created)
     
-    value := guard( [Number]this.Cell().Value(), 0 );
+    value := guard( [Number]this.Cell().Quantity(), 0 );
     
     this.Quantity( value );
   *]
diff --git "a/_Main/BL/Type_FinancialProductionRow/Method_Initialize\043110.qbl" "b/_Main/BL/Type_FinancialProductionRow/Method_Initialize\043110.qbl"
index bdd6e85..5662263 100644
--- "a/_Main/BL/Type_FinancialProductionRow/Method_Initialize\043110.qbl"
+++ "b/_Main/BL/Type_FinancialProductionRow/Method_Initialize\043110.qbl"
@@ -13,7 +13,7 @@
     cell := column.FinancialProductionCell( relnew, Quantity := 0 );
     
     this.FinancialProductionCell( relinsert, cell );
-    if( unit <> FinancialProductionReport::GetDefaultAllUnit() ){
+    if( unit <> FinancialProductionReport::GetDefaultAllUnit() and not column.IsDay()){
       importdata := product.MacroPlan().FPImportData( relnew, Generation := product.Generation()
                                                       , MqbMlb := product.MQBMLB()
                                                       , Power := product.Power()
diff --git a/_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl b/_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl
index 658b23c..a6d4f72 100644
--- a/_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl
+++ b/_Main/BL/Type_FinancialSalesRow/Method_Initialize.qbl
@@ -10,10 +10,10 @@
   TextBody:
   [*
     // 鐢勫叞楦� Jun-24-2024 (created) 
-    cell := column.FinancialSalesCell( relnew, Value := '' );
+    cell := column.FinancialSalesCell( relnew, Value := '0' );
     
     this.FinancialSalesCell( relinsert, cell );
-    if( unit <> FinancialProductionReport::GetDefaultAllUnit() ){
+    if( unit <> FinancialProductionReport::GetDefaultAllUnit() and not column.IsDay() ){
       importdata := product.MacroPlan().FSImportData( relnew, Generation := product.Generation()
                                                       , MqbMlb := product.MQBMLB()
                                                       , Power := product.Power()
diff --git a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
index 4afd265..5d0c8a8 100644
--- a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
@@ -9,6 +9,7 @@
   [*
     // 鐢勫叞楦� Jun-24-2024 (created)
     owner.FinancialSalesSource( relflush );
+    owner.FSImportData( relflush );
     products                  := construct( Product_MPs );
     allunit                   := FinancialSalesReport::GetDefaultAllUnit();
     ccunit                    := FinancialSalesReport::GetDefaultCCUnit();
diff --git a/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl b/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
index 3af1676..257071d 100644
--- a/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_InventorySummaryReport/Method_GenerateColumn.qbl
@@ -28,16 +28,17 @@
           this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
         }
       }else if( timeunit = Translations::MP_GlobalParameters_Week() ){
+        weekstartstr          := ' KW';
         for( start := starttime; start <= endtime; start := start.StartOfNextWeek() ){
           weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
           
-          this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          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() );
         }
       }else if( timeunit = Translations::MP_GlobalParameters_Month() ){
         for( start := starttime; start <= endtime; start := start.StartOfNextMonth() ){
           monthend            := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
           
-          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
+          this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ).Concat( ' ' ).Concat( monthend.Format( "MM" ).Concat( '/').Concat( [String]monthend.Month() ).Concat( '鏈�' ) ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() );
         }
       }
     }
diff --git a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
index a1b13f7..dd97f73 100644
--- a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -47,10 +47,10 @@
             products.Add( pisp.Product_MP() );
             period            := pispip.Period_MP();
             periodtime        := period.Start().Date();
-            periodname        := periodtime.Format( "M2/D2/Y" );
+    //        periodname        := periodtime.Format( "M2/D2/Y" );
             
             //澶╋紝閫夋嫨鏃ラ绮掑害鏃讹紝鏈熸湯搴撳瓨锛屾渶灏忓簱瀛橈紝鏈�澶у簱瀛樺拰骞冲潎搴撳瓨鐨勬暟鍊间繚鎸佷竴鑷�
-            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
+            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
             quantity          := ifexpr( pispip.Period_MP().IsHistorical(), [Number]pispip.ActualInventoryLevelEnd(), [Number]pispip.PlannedInventoryLevelEnd() );
             factoryrow.SetCellValue( daycolumn, quantity );
             allrow.SetCellValue( daycolumn, quantity );
diff --git a/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl b/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
index a421f47..2bac9e3 100644
--- a/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -30,10 +30,9 @@
       }
       if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){
         for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){
-          periodname          := start.Format( "M2/D2/Y" );
           weekend             := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date();
           
-          this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
+          this.Column( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() );
         }
       }
     }
diff --git a/_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp b/_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp
index d2bf8d1..9fbd9c5 100644
--- a/_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp
+++ b/_Main/Sys/Repr/Global/DLEngineLogisticsCostCell.qrp
@@ -42,6 +42,11 @@
     AttributeKey: '[415136.0.1160164787]'
     Synonym: '澶ц繛澶栫搴撳叆搴撹垂鐢�'
   }
+  AttributeRepresentation DLRentOtherCost
+  {
+    AttributeKey: '[415136.0.1184074681]'
+    Synonym: '澶ц繛澶栫搴撳叾浠栬垂鐢�'
+  }
   AttributeRepresentation DLRentOutOfCost
   {
     AttributeKey: '[415136.0.1160164795]'
diff --git a/_Main/Sys/Repr/Global/MachiningPipelineCell.qrp b/_Main/Sys/Repr/Global/MachiningPipelineCell.qrp
index 0e40a27..77a9570 100644
--- a/_Main/Sys/Repr/Global/MachiningPipelineCell.qrp
+++ b/_Main/Sys/Repr/Global/MachiningPipelineCell.qrp
@@ -15,12 +15,12 @@
   AttributeRepresentation CCProductionQty
   {
     AttributeKey: '[415136.0.886711530]'
-    Synonym: 'CC鐢熶骇璁″垝'
+    Synonym: 'CC鏈哄姞璁″垝'
   }
   AttributeRepresentation CCTransferQty
   {
     AttributeKey: '[415136.0.894481175]'
-    Synonym: 'CC璋冩嫧璁″垝'
+    Synonym: 'CC to DL'
   }
   AttributeRepresentation DLAssemblyPlanQty
   {
@@ -35,12 +35,12 @@
   AttributeRepresentation DLProductionQty
   {
     AttributeKey: '[415136.0.894481151]'
-    Synonym: 'DL鐢熶骇璁″垝'
+    Synonym: 'DL鏈哄姞璁″垝'
   }
   AttributeRepresentation DLTransferQty
   {
     AttributeKey: '[415136.0.894481185]'
-    Synonym: 'DL璋冩嫧璁″垝'
+    Synonym: 'DL to CC'
   }
   AttributeRepresentation TotalInventoryQty
   {
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting\043568.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting\043568.def"
index 19e17fb..e09da9c 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting\043568.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormChangeLossSetting/Component_ListChangeLossSetting\043568.def"
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit.ID","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Unit.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductFirst.ID","title":"Product1","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductFirst.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSecond.ID","title":"Product2","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductSecond.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ChangeLossNumber","title":"ChangeLossNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ChangeLossNumber"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit.ID","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Unit.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductFirst.ID","title":"Product1","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductFirst.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSecond.ID","title":"Product2","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductSecond.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ShowChangeLossNumber","title":"ChangeLossNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ShowChangeLossNumber"}}]'
         ContextMenu: 'listContextMenuChangeLossSetting'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def b/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def
index 8bfb505..bb6c8c4 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormDLEngineLogisticsCostReport/Component_MatrixEditorTable.def
@@ -26,7 +26,7 @@
       ]
       Properties:
       [
-        Attributes: 'CCRentInCost;CCRentOutOfCost;CCLongTransCost;CCShorTransCost;CCRentStorCost;DLRentInCost;DLRentOutOfCost;WerkToDLRentTransCost;DLRentStorCost;EstimateTotalCost;Coefficient;AllCost'
+        Attributes: 'CCRentInCost;CCRentOutOfCost;CCLongTransCost;CCShorTransCost;CCRentStorCost;DLRentInCost;DLRentOutOfCost;WerkToDLRentTransCost;DLRentStorCost;DLRentOtherCost;EstimateTotalCost;Coefficient;AllCost'
         Column: 'Column'
         Row: 'Row'
         Taborder: 0
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def b/_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def
index b681d32..1b36875 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormEnginePipelineReport/Component_MatrixEditorTable.def
@@ -53,7 +53,7 @@
       ]
       Properties:
       [
-        Legend: 'RowNr'
+        Legend: 'ShowName'
         SortCriteria: 'RowNr'
         Taborder: 1
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw b/_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw
index 3bafc0d..5a964f4 100644
--- a/_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw
+++ b/_Main/UI/MacroPlannerWebApp/Views/Change_loss_setting_view.vw
@@ -78,14 +78,14 @@
               subtotals: ''
               width: 150
             }
-            column_ChangeLossNumber
+            column_ShowChangeLossNumber
             {
-              columnId: 'ChangeLossNumber'
-              dataPath: 'ChangeLossNumber'
-              dataType: 'real'
+              columnId: 'ShowChangeLossNumber'
+              dataPath: 'ShowChangeLossNumber'
+              dataType: 'string'
               index: 5
               subtotals: ''
-              width: 183
+              width: 150
             }
           }
         }

--
Gitblit v1.9.3