From afbad399be481afbe886bc2ad1e22abbcd5df771 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期一, 05 八月 2024 14:56:46 +0800
Subject: [PATCH] 财务报表bug修复

---
 _Main/BL/Type_FinancialSalesRow/Method_Initialize0.qbl                                                                                   |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def                      |    2 
 _Main/BL/Type_InventroySummaryRow/Method_SetCellValue0.qbl                                                                               |    8 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def          |    2 
 _Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl                                                                           |  128 +++++++++------
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelExport.def                                            |   10 +
 _Main/BL/Type_InventorySummaryCell/Attribute_AverageInventory.qbl                                                                        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorStart_OnChanged.def                    |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelMQBMLB_603_ddslMQBMLB_OnSelectionChanged.def                |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_545_ButtonSearch_OnClick#118.def                     |   16 ++
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnCreated.def                             |    2 
 _Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointDLLine.qbl                                                               |    3 
 _Main/BL/Type_FinancialSalesReport/Method_IsInUnit.qbl                                                                                   |   16 ++
 _Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultCCUnit.qbl                                                                     |   11 +
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def       |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def                  |    2 
 _Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultAllUnit.qbl                                                                    |   10 +
 _Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl                                                                             |    6 
 _Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl                                                                         |  129 ++++++++-------
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Component_PanelExport.def                                               |   12 +
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorEnd_OnChanged.def                      |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelFinancialProductionReportOperation.def                |    4 
 _Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl                                                                   |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelFinancialSalesReportOperation.def                          |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_ButtonSearch_OnClick.def                        |   16 ++
 _Main/BL/Type_InventorySummaryCell/Attribute_EndingInventory.qbl                                                                         |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelPower_858_ddslPower_OnSelectionChanged.def                  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnSelectionChanged.def                    |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelCategory_RadioButtonGroupUseForPlanning_OnChanged#847.def |    2 
 _Main/BL/Type_InventorySummaryCell/Attribute_MinimumInventory.qbl                                                                        |    2 
 _Main/BL/Type_InventroySummaryRow/Method_SetCellValue#0.qbl                                                                              |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSearch_OnClick#290.def                       |   16 ++
 /dev/null                                                                                                                                |   11 -
 _Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPower_ddslPower_OnSelectionChanged.def                    |    2 
 _Main/BL/Type_InventorySummaryCell/Attribute_MaximumInventory.qbl                                                                        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelGeneration_844_ddslGeneration_OnSelectionChanged.def        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelPower_ddslPower_OnSelectionChanged.def                 |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def               |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def                   |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelExport#545.def                                             |   10 +
 _Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultDLUnit.qbl                                                                     |   11 +
 _Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointCCLine.qbl                                                               |    3 
 42 files changed, 312 insertions(+), 160 deletions(-)

diff --git a/_Main/BL/Type_FinancialSalesReport/Method_IsInUnit.qbl b/_Main/BL/Type_FinancialSalesReport/Method_IsInUnit.qbl
new file mode 100644
index 0000000..02e06b4
--- /dev/null
+++ b/_Main/BL/Type_FinancialSalesReport/Method_IsInUnit.qbl
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: #root
+Method IsInUnit (
+  StockingPoint_MP sp,
+  String unitname
+) as Boolean
+{
+  Description: '鏄惁灞炰簬鏌愪釜绾�'
+  TextBody:
+  [*
+    // 鐢勫叞楦� Aug-5-2024 (created)
+    unit                  := sp.Unit();
+    parentunits           := unit.GetAllParent();
+    return unit.ID() = unitname or exists( parentunits, Elements, punit, punit.ID() = unitname );
+  *]
+}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultAllUnit.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultAllUnit.qbl
new file mode 100644
index 0000000..e912c3f
--- /dev/null
+++ b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultAllUnit.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultAllUnit () const declarative as String
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    return '<All>';
+  *]
+}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultCCUnit.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultCCUnit.qbl
new file mode 100644
index 0000000..4a17ee3
--- /dev/null
+++ b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultCCUnit () const as String
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    return '闀挎槬宸ュ巶';
+    //return 'Assembly Plant (France)';
+  *]
+}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultDLUnit.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultDLUnit.qbl
new file mode 100644
index 0000000..ba77240
--- /dev/null
+++ b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetDefaultDLUnit () const as String
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    return '澶ц繛宸ュ巶';
+    //return 'Assembly Plant (Spain)';
+  *]
+}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentAll.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentAll.qbl
deleted file mode 100644
index 4163b5e..0000000
--- a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentAll.qbl
+++ /dev/null
@@ -1,10 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod GetSalesSegmentAll () const as String
-{
-  TextBody:
-  [*
-    // 鐢勫叞楦� Jun-28-2024 (created)
-    return '<All>';
-  *]
-}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentDL.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentDL.qbl
deleted file mode 100644
index 062b883..0000000
--- a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetSalesSegmentDL.qbl
+++ /dev/null
@@ -1,11 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod GetSalesSegmentDL () const as String
-{
-  TextBody:
-  [*
-    // 鐢勫叞楦� Jun-28-2024 (created)
-    return '澶ц繛';
-    //return 'Foregin';
-  *]
-}
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointCCLine.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointCCLine.qbl
index a57ce47..1e19bf6 100644
--- a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointCCLine.qbl
+++ b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointCCLine.qbl
@@ -5,6 +5,7 @@
   TextBody:
   [*
     // 鐢勫叞楦� Jun-28-2024 (created)
-    return '闀挎槬瑁呴厤绾胯竟搴�';
+    //return '闀挎槬瑁呴厤绾胯竟搴�';
+    return '闀挎槬瑁呴厤绾�';
   *]
 }
diff --git a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointDLLine.qbl b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointDLLine.qbl
index 7f89636..c08c31a 100644
--- a/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointDLLine.qbl
+++ b/_Main/BL/Type_FinancialSalesReport/StaticMethod_GetStockingPointDLLine.qbl
@@ -5,6 +5,7 @@
   TextBody:
   [*
     // 鐢勫叞楦� Jun-28-2024 (created)
-    return '澶ц繛瑁呴厤绾胯竟搴�';
+    //return '澶ц繛瑁呴厤绾胯竟搴�';
+    return '澶ц繛瑁呴厤绾�';
   *]
 }
diff --git a/_Main/BL/Type_FinancialSalesRow/Method_Initialize0.qbl b/_Main/BL/Type_FinancialSalesRow/Method_Initialize0.qbl
index dd0f3b8..c7826c1 100644
--- a/_Main/BL/Type_FinancialSalesRow/Method_Initialize0.qbl
+++ b/_Main/BL/Type_FinancialSalesRow/Method_Initialize0.qbl
@@ -2,7 +2,7 @@
 #parent: #root
 Method Initialize (
   FinancialSalesColumn column,
-  Real quantity
+  Number quantity
 )
 {
   TextBody:
@@ -10,7 +10,7 @@
     // 鐢勫叞楦� Jun-24-2024 (created)
     cell := selectobject( this, FinancialSalesCell, cell, cell.FinancialSalesColumn() = column );
           
-    value := [Real]cell.Value() + quantity;
+    value := [Number]cell.Value() + quantity;
     cell.Value( [String]value );
   *]
 }
diff --git a/_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl b/_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
index 804d079..cf1176e 100644
--- a/_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
@@ -10,9 +10,10 @@
     // 鐢勫叞楦� Jun-24-2024 (created)
     owner.FinancialSalesSource( relflush );
     products                  := construct( Product_MPs );
-    allsalessegment           := FinancialSalesReport::GetSalesSegmentAll();
+    allunit                   := FinancialSalesReport::GetDefaultAllUnit();
+    ccunit                    := FinancialSalesReport::GetDefaultCCUnit();
+    dlunit                    := FinancialSalesReport::GetDefaultDLUnit();
     ccsalessegment            := FinancialSalesReport::GetSalesSegmentCC();
-    dlsalessegment            := FinancialSalesReport::GetSalesSegmentDL();
     tjsalessegment            := FinancialSalesReport::GetSalesSegmentTJ();
     fssalessegment            := FinancialSalesReport::GetSalesSegmentFS();
     ccspline                  := FinancialSalesReport::GetStockingPointCCLine();
@@ -22,73 +23,94 @@
     source                    := owner.FinancialSalesSource( relnew, IsImport := false, Name := FinancialSalesReport::GetDefaultName() );
     table                     := source.FinancialSalesReport( relnew, ID := source.Name(), Name := source.Name(), IsImport := false );
     showtable                 := source.FinancialSalesReport( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsImport := false, IsShow := true );
-    startofplanning           := owner.StartOfPlanning();
+    startofplanning           := owner.StartOfPlanning().Date();
     //startofyear               := startofplanning.StartOfYear();
     startofnextyear           := startofplanning.StartOfNextYear();
     
-    search                    := source.FinancialSalesSearch( relnew, Unit := allsalessegment, Generation := allsalessegment, MqbMlb := allsalessegment, Power := allsalessegment );
+    search                    := source.FinancialSalesSearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit );
     
     table.GenerateColumn( owner );
     
-    //浠嶧orecast鏌ヨ
-    traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.StartDate() < startofnextyear.Date() and ( ( forecast.SalesSegmentName() = ccsalessegment and forecast.Product_MP().MQBMLB() = 'MLB' ) 
-              or forecast.SalesSegmentName() = tjsalessegment or forecast.SalesSegmentName() = fssalessegment ) ){
-      product    := forecast.Product_MP();
-      allrow     := table.GetRow( allsalessegment, product.ID() );
-      periodtime := forecast.StartDate().StartOfMonth();
-      periodname := periodtime.Format( "M2/D2/Y" );
-      
-      if( products.Find( product ) < 0 ){
-        products.Add( product );
-      }
-    //  info( '------------------------', periodname, periodtime );
-      column    := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
-    //  info( '------------------------', column.Name() );
+    //棣栧厛鍦╢orecast鐣岄潰鏌ユ壘sales segment涓洪暱鏄ョ殑鎵�鏈夐渶姹傦紝璇嗗埆鍑篗LB鐨勬墍鏈変骇鍝侊紝姣忎釜浜у搧鎸夋湀姹囨�婚渶姹傛暟閲�
+    traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.StartDate() < startofnextyear ){
+      salessegment            := forecast.SalesSegment_MP();
+      parentsalessegments     := salessegment.GetAllParent();
+      //鏄惁灞炰簬闀挎槬
+      iscc                    := salessegment.Name() = ccsalessegment or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name() = ccsalessegment );
+      //鏄惁灞炰簬澶ц繛, 鍗冲ぉ娲ュ拰浣涘北
+      isdl                    := salessegment.Name() = tjsalessegment or salessegment.Name() = fssalessegment 
+                                  or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name() = tjsalessegment ) 
+                                  or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name() = fssalessegment );
       //Forecast鐨凷ales Segment涓洪暱鏄ワ紝璇嗗埆鍑篗LB鐨勬墍鏈変骇鍝佹眹鎬�
-      if( forecast.SalesSegmentName() = ccsalessegment and product.MQBMLB() = 'MLB' ){
-    //    info( '------------------------', column.Name() );
-        ccrow := table.GetRow( ccsalessegment, product.ID() );
-    //    info( '------------------------', ccrow.FinancialSalesCell( relsize ), column.FinancialSalesCell( relsize ) );
-        ccrow.Initialize( column, forecast.Quantity() );
-      }else if( forecast.SalesSegmentName() = tjsalessegment or forecast.SalesSegmentName() = fssalessegment ){
-        //澶ц繛璐㈠姟閿�閲忥細棣栧厛鍦╢orecast鐣岄潰鏌ユ壘Sales Segment鏄ぉ娲ュ拰浣涘北鐨勬墍鏈夐渶姹傦紝姣忎釜浜у搧鎸夋湀姹囨�婚渶姹傛暟閲�
-    //    info( '------------------------', column.Name() );
-        dlrow := table.GetRow( dlsalessegment, product.ID() );
-    //    info( '------------------------', dlrow.FinancialSalesCell( relsize ), column.FinancialSalesCell( relsize ) );
-        dlrow.Initialize( column, forecast.Quantity() );
+      //澶ц繛璐㈠姟閿�閲忥細棣栧厛鍦╢orecast鐣岄潰鏌ユ壘Sales Segment鏄ぉ娲ュ拰浣涘北鐨勬墍鏈夐渶姹傦紝姣忎釜浜у搧鎸夋湀姹囨�婚渶姹傛暟閲�
+      if( ( iscc and forecast.Product_MP().MQBMLB() = 'MLB' ) or isdl ){
+        product              := forecast.Product_MP();
+        //鑾峰彇鍚堣琛�
+        allrow               := table.GetRow( allunit, product.ID() );
+        //鑾峰彇宸ュ巶琛�
+        factoryrow           := table.GetRow( ifexpr( iscc and forecast.Product_MP().MQBMLB() = 'MLB', ccunit, dlunit ), product.ID() );
+      
+        if( products.Find( product ) < 0 ){
+          products.Add( product );
+        }
+        traverse( forecast, PlanningSalesDemandInPeriod, psdip ){
+          periodtime         := psdip.StartDate().StartOfMonth();
+          periodname         := periodtime.Format( "M2/D2/Y" );
+    //      info( '-------------------------', periodname, periodtime );
+          column             := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
+    //      info( '-------------------------', column.Name() );
+          quantity   := ceil( psdip.Quantity() );//鍚戜笂鍙栨暣
+          
+          factoryrow.Initialize( column, quantity );
+          allrow.Initialize( column, quantity );
+        }
       }
-      allrow.Initialize( column, forecast.Quantity() );
     }
     //浠嶱roduct planning鏌ユ壘搴撳瓨鐐逛负闀挎槬瑁呴厤绾胯竟搴撶殑鎵�鏈塎QB浜у搧锛屽彇Total Demand瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
-    traverse( owner, Product_MP, product, product.IsLeaf() and product.MQBMLB() = 'MQB' ){//浜у搧涓篗QB
-      traverse( product, ProductInStockingPoint_MP, pisp, pisp.StockingPointID() = ccspline ){//搴撳瓨鐐逛负闀挎槬瑁呴厤绾胯竟搴�
-        traverse( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning
-                and pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() ){
-          periodtime := pispip.Start().StartOfMonth().Date();
-          periodname := periodtime.Format( "M2/D2/Y" );
-          column    := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
-          ccrow := table.GetRow( ccsalessegment, product.ID() );
-          ccrow.Initialize( column, pispip.DependentDemandAndSalesDemandQuantity() );//鍙朤otal Demand瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
-          
-          allrow     := table.GetRow( allsalessegment, product.ID() );
-          allrow.Initialize( column, pispip.DependentDemandAndSalesDemandQuantity() );
+    traverse( owner, StockingPoint_MP, stockingpoint ){
+    //  unit                  := stockingpoint.Unit();
+    //  parentunits           := unit.GetAllParent();
+      //鏄惁灞炰簬闀挎槬瑁呴厤绾�
+    //  iscc                  := unit.ID() = ccspline or exists( parentunits, Elements, punit, punit.ID() = ccspline );
+      if( table.IsInUnit( stockingpoint, ccspline ) ){
+        traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and pisp.Product_MP().MQBMLB() = 'MQB' ){//浜у搧涓篗QB
+          allrow            := table.GetRow( allunit, pisp.ProductID() );
+          ccrow             := table.GetRow( ccunit, pisp.ProductID() );
+          traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear ){
+            periodtime      := pispip.Start().StartOfMonth().Date();
+            periodname      := periodtime.Format( "M2/D2/Y" );
+            column          := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
+            quantity        := ceil( pispip.DependentDemandAndSalesDemandQuantity() );//鍚戜笂鍙栨暣
+            
+            ccrow.Initialize( column, quantity );//鍙朤otal Demand瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
+            allrow.Initialize( column, quantity );
+          }
         }
       }
     }
     startofnextyearlead       := startofplanning.StartOfNextYear() + FinancialSalesReport::GetDefaultTripLeadingTime();
     //澶ц繛璐㈠姟閿�閲忥細闀挎槬鐨勯渶姹傞渶瑕佸湪trip plan閲岄潰鎵惧埌璧峰搴撳瓨鐐逛负澶ц繛瑁呴厤绾胯竟搴擄紝鐩殑鍦颁负闀挎槬澶栫搴撶殑浜у搧锛岀敱浜庨渶瑕佽�冭檻浜у搧杩愯緭lead time锛屾瘡涓湀鐨勬眹鎬绘暟鎹渶瑕佹帹杩熶袱澶╄繘琛岃绠�
-    traverse( owner, Unit.Lane.LaneLeg, laneleg, laneleg.OriginStockingPointID() = dlspline and laneleg.DestinationStockingPointID() = ccrent ){
-      traverse( laneleg, Trip, trip, trip.Arrival() < startofnextyearlead ){
-        periodtime := ( trip.Arrival() - FinancialSalesReport::GetDefaultTripLeadingTime() ).StartOfMonth().Date();
-        periodname := periodtime.Format( "M2/D2/Y" );
-        
-        column    := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
-        traverse( trip, ProductInTrip, pit ){
-          dlrow      := table.GetRow( dlsalessegment, pit.ProductID() );
-          dlrow.Initialize( column, pit.Quantity() );//鍙朤otal Demand瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
+    traverse( owner, Unit.Lane.LaneLeg, laneleg ){
+      //璧峰搴撳瓨鐐规槸鍚︽槸澶ц繛瑁呴厤绾胯竟搴�
+      originsp              := selectobject( owner, StockingPoint_MP, sp, sp.ID() = laneleg.OriginStockingPointID() );
+      isdlspline            := table.IsInUnit( originsp, dlspline );
+      //鐩殑鍦版槸鍚︽槸闀挎槬澶栫搴�
+      destisp               := selectobject( owner, StockingPoint_MP, sp, sp.ID() = laneleg.DestinationStockingPointID() );
+      isccrent              := table.IsInUnit( destisp, ccrent );
+      if( isdlspline and isccrent ){
+        traverse( laneleg, Trip, trip, trip.Arrival() < startofnextyearlead ){
+          periodtime        := ( trip.Arrival() - FinancialSalesReport::GetDefaultTripLeadingTime() ).StartOfMonth().Date();
+          periodname        := periodtime.Format( "M2/D2/Y" );
           
-          allrow     := table.GetRow( allsalessegment, pit.ProductID() );
-          allrow.Initialize( column, pit.Quantity() );
+          column            := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
+          traverse( trip, ProductInTrip, pit ){
+            quantity        := ceil( pit.Quantity() );//鍚戜笂鍙栨暣
+            dlrow           := table.GetRow( dlunit, pit.ProductID() );
+            dlrow.Initialize( column, quantity );//姹囨�绘暟閲�
+            
+            allrow          := table.GetRow( allunit, pit.ProductID() );
+            allrow.Initialize( column, quantity );
+          }
         }
       }
     }
diff --git a/_Main/BL/Type_InventorySummaryCell/Attribute_AverageInventory.qbl b/_Main/BL/Type_InventorySummaryCell/Attribute_AverageInventory.qbl
index cc4cf47..6c32c56 100644
--- a/_Main/BL/Type_InventorySummaryCell/Attribute_AverageInventory.qbl
+++ b/_Main/BL/Type_InventorySummaryCell/Attribute_AverageInventory.qbl
@@ -4,5 +4,5 @@
 {
   #keys: '3[415136.0.865305024][415136.0.865305023][415136.0.865305025]'
   Description: '璇勪环搴撳瓨'
-  ValueType: Real
+  ValueType: Number
 }
diff --git a/_Main/BL/Type_InventorySummaryCell/Attribute_EndingInventory.qbl b/_Main/BL/Type_InventorySummaryCell/Attribute_EndingInventory.qbl
index f51b0bc..592f743 100644
--- a/_Main/BL/Type_InventorySummaryCell/Attribute_EndingInventory.qbl
+++ b/_Main/BL/Type_InventorySummaryCell/Attribute_EndingInventory.qbl
@@ -4,5 +4,5 @@
 {
   #keys: '3[415136.0.865304924][415136.0.865304923][415136.0.865304925]'
   Description: '鏈熸湯搴撳瓨'
-  ValueType: Real
+  ValueType: Number
 }
diff --git a/_Main/BL/Type_InventorySummaryCell/Attribute_MaximumInventory.qbl b/_Main/BL/Type_InventorySummaryCell/Attribute_MaximumInventory.qbl
index 341b8e7..f28a356 100644
--- a/_Main/BL/Type_InventorySummaryCell/Attribute_MaximumInventory.qbl
+++ b/_Main/BL/Type_InventorySummaryCell/Attribute_MaximumInventory.qbl
@@ -4,5 +4,5 @@
 {
   #keys: '3[415136.0.865304944][415136.0.865304943][415136.0.865304945]'
   Description: '鏈�澶у簱瀛�'
-  ValueType: Real
+  ValueType: Number
 }
diff --git a/_Main/BL/Type_InventorySummaryCell/Attribute_MinimumInventory.qbl b/_Main/BL/Type_InventorySummaryCell/Attribute_MinimumInventory.qbl
index d686c7f..1ef30ef 100644
--- a/_Main/BL/Type_InventorySummaryCell/Attribute_MinimumInventory.qbl
+++ b/_Main/BL/Type_InventorySummaryCell/Attribute_MinimumInventory.qbl
@@ -4,5 +4,5 @@
 {
   #keys: '3[415136.0.865304934][415136.0.865304933][415136.0.865304935]'
   Description: '鏈�灏忓簱瀛�'
-  ValueType: Real
+  ValueType: Number
 }
diff --git a/_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl b/_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl
index a85f1cd..c56f1d4 100644
--- a/_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl
+++ b/_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl
@@ -20,20 +20,20 @@
     alldetails := selectset( selections, Elements.InventoryInterfaceDataDetail, detail, detail.PartNumber() = productid and detail.Date() >= start and detail.Date() <= end );
     if( alldetails.Size() > 0 ){
       allrow     := table.GetRow( allunit, productid );
-      allvalue := sum( alldetails, Elements, e, e.Quantity() );
+      allvalue := sum( alldetails, Elements, e, [Number]e.Quantity() );
       allrow.SetCellValue( this, allvalue );
       //闀挎槬
       ccdetails := selectset( alldetails, Elements, detail, ccstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 );
       if( ccdetails.Size() > 0 ){
         ccrow := table.GetRow( ccunit, productid );
-        value := sum( ccdetails, Elements, e, e.Quantity() );
+        value := sum( ccdetails, Elements, e, [Number]e.Quantity() );
         ccrow.SetCellValue( this, value );
       }
       //澶ц繛
       dldetails := selectset( alldetails, Elements, detail, dlstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 );
       if( dldetails.Size() > 0 ){
         dlrow := table.GetRow( dlunit, productid );
-        value := sum( dldetails, Elements, e, e.Quantity() );
+        value := sum( dldetails, Elements, e, [Number]e.Quantity() );
         dlrow.SetCellValue( this, value );
       }
     }
diff --git a/_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl b/_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl
index e504a84..7bf8369 100644
--- a/_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl
+++ b/_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,7 @@
   TextBody:
   [*
     // 鐢勫叞楦� Jun-28-2024 (created)
-    return '闀挎槬宸ョ▼';
+    return '闀挎槬宸ュ巶';
     //return 'Assembly Plant (France)';
   *]
 }
diff --git a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
index f3c7208..47f1246 100644
--- a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -27,68 +27,81 @@
     table.GenerateColumn( owner, 'All', startofyear, startofnextyear );
     //info( '-----------------------------------', table.InventorySummaryColumn( relsize ) );
     //搴撳瓨鏁伴噺涓篈ctual inventories閲岄潰鐨勭偣Planned inventories瀛楁搴撳瓨閲忓姞鎬�
-    traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() and not isnull( pisp.StockingPoint_MP() ) and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){
-      unit := pisp.StockingPoint_MP().UnitID();
-      product := pisp.Product_MP();
-    //  info( '-----------------------------------', unit, product.ID() );
-      weekpispips := construct( ProductInStockingPointInPeriods );
-      monthpispips := construct( ProductInStockingPointInPeriods );
-      nextweek := startofplanning.StartOfNextWeek();
-      nextmonth := startofplanning.StartOfNextMonth();
-      
-      unitrow := table.GetRow( unit, product.ID() );
-      allrow     := table.GetRow( allunit, product.ID() );
-      pispips := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning and pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() );
-    //  info( '-----------------------------------', isnull( allrow ), pispips.Size() );
-      traverse( pispips, Elements, pispip, pispip.Start() = startofplanning ){
-    //    info( '-----------------------------------', pispip.Start() );
-        period     := pispip.Period_MP();
-        periodtime := period.Start().Date();
-        periodname := periodtime.Format( "M2/D2/Y" );
-        //澶╋紝閫夋嫨鏃ラ绮掑害鏃讹紝鏈熸湯搴撳瓨锛屾渶灏忓簱瀛橈紝鏈�澶у簱瀛樺拰骞冲潎搴撳瓨鐨勬暟鍊间繚鎸佷竴鑷�
-        daycolumn := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
-        info( daycolumn.Name(), daycolumn.Period(), daycolumn.TimeUnit() );
-        unitrow.SetCellValue( daycolumn, pispip.PlannedInventoryLevelEnd() );
-        allrow.SetCellValue( daycolumn, pispip.PlannedInventoryLevelEnd() );
-        
-        //鍛紝閫夋嫨鍛ㄦ椂锛屾湡鏈簱瀛樹负姣忎竴鍛ㄦ渶鍚庝竴澶╃殑姹囨�诲簱瀛樹俊鎭紝鏈�灏忓簱瀛樹负杩欎竴鍛ㄥ簱瀛橀噺鏈�灏忕殑涓�澶╃殑鏁板�硷紝鏈�澶у簱瀛樹负杩欎竴鍛ㄥ簱瀛橀噺鏈�澶х殑涓�澶╃殑鏁板�硷紝骞冲潎搴撳瓨涓鸿鍛ㄧ殑骞冲潎鍊�
-        if( period.Start() < nextweek ){
-          weekpispips.Add( pispip );
+    traverse( owner, StockingPoint_MP, stockingpoint ){
+      unit                    := stockingpoint.Unit();
+      parentunits             := unit.GetAllParent();
+      //鏄惁灞炰簬闀挎槬宸ュ巶
+      iscc                    := unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit );
+      //鏄惁灞炰簬澶ц繛宸ュ巶
+      isdl                    := unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit );
+      if( iscc or isdl ){
+        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
+          //鑾峰彇宸ュ巶琛�
+          factoryrow          := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.ProductID() );
+          //鑾峰彇鍚堣琛�
+          allrow              := table.GetRow( allunit, pisp.ProductID() );
+          //鍛ㄥ害鐨勬暟鎹�
+          weekpispips         := construct( ProductInStockingPointInPeriods );
+          //鏈堝害鐨勬暟鎹�
+          monthpispips        := construct( ProductInStockingPointInPeriods );
+          nextweek            := startofplanning.StartOfNextWeek();
+          nextmonth           := startofplanning.StartOfNextMonth();
           
-          weekend := nextweek - Duration::Days( 1 );
-          if( period.Start() = weekend ){
-            weekcolumn := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Week() );
+          pispips             := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() 
+                                                  and pispip.Start() < startofnextyear 
+                                                  and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() );
+    
+          traverse( pispips, Elements, pispip ){
+            period            := pispip.Period_MP();
+            periodtime        := period.Start().Date();
+            periodname        := periodtime.Format( "M2/D2/Y" );
             
-            maxinventory := max( weekpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            mininventory := min( weekpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            aveinventory := average( weekpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            unitrow.SetCellValue( weekcolumn, pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, aveinventory );
-            allrow.SetCellValue( weekcolumn, pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, aveinventory );
-          }
-        }else{
-          weekpispips.Flush();
-          weekpispips.Add( pispip );
-          nextweek := nextweek.StartOfNextWeek();
-        }
-        
-        //鏈堬紝閫夋嫨鏈堟椂锛屾湡鏈簱瀛樹负姣忎竴鏈堟渶鍚庝竴澶╃殑姹囨�诲簱瀛樹俊鎭紝鏈�灏忓簱瀛樹负杩欎竴涓湀搴撳瓨閲忔渶灏忕殑涓�澶╃殑鏁板�硷紝鏈�澶у簱瀛樹负杩欎竴涓湀搴撳瓨閲忔渶澶х殑涓�澶╃殑鏁板�硷紝骞冲潎搴撳瓨涓鸿鏈堢殑骞冲潎鍊�
-        if( period.Start() < nextmonth ){
-          monthpispips.Add( pispip );
-          
-          monthend := nextmonth - Duration::Days( 1 );
-          if( period.Start() = monthend ){
-            monthcolumn := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Month() );
+            //澶╋紝閫夋嫨鏃ラ绮掑害鏃讹紝鏈熸湯搴撳瓨锛屾渶灏忓簱瀛橈紝鏈�澶у簱瀛樺拰骞冲潎搴撳瓨鐨勬暟鍊间繚鎸佷竴鑷�
+            daycolumn         := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
+            info( daycolumn.Name(), daycolumn.Period(), daycolumn.TimeUnit() );
+            factoryrow.SetCellValue( daycolumn, [Number]pispip.PlannedInventoryLevelEnd() );
+            allrow.SetCellValue( daycolumn, [Number]pispip.PlannedInventoryLevelEnd() );
             
-            maxinventory := max( monthpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            mininventory := min( monthpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            aveinventory := average( monthpispips, Elements, e, e.PlannedInventoryLevelEnd() );
-            unitrow.SetCellValue( monthcolumn, pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, aveinventory );
-            allrow.SetCellValue( monthcolumn, pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, aveinventory );
+            //鍛紝閫夋嫨鍛ㄦ椂锛屾湡鏈簱瀛樹负姣忎竴鍛ㄦ渶鍚庝竴澶╃殑姹囨�诲簱瀛樹俊鎭紝鏈�灏忓簱瀛樹负杩欎竴鍛ㄥ簱瀛橀噺鏈�灏忕殑涓�澶╃殑鏁板�硷紝鏈�澶у簱瀛樹负杩欎竴鍛ㄥ簱瀛橀噺鏈�澶х殑涓�澶╃殑鏁板�硷紝骞冲潎搴撳瓨涓鸿鍛ㄧ殑骞冲潎鍊�
+            if( period.Start() < nextweek ){
+              weekpispips.Add( pispip );
+              
+              weekend := nextweek - Duration::Days( 1 );
+              if( period.Start() = weekend ){
+                weekcolumn    := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Week() );
+                
+                maxinventory  := max( weekpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                mininventory  := min( weekpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                aveinventory  := average( weekpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                factoryrow.SetCellValue( weekcolumn, [Number]pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, [Number]aveinventory );
+                allrow.SetCellValue( weekcolumn, [Number]pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, [Number]aveinventory );
+              }
+            }else{
+              weekpispips.Flush();
+              weekpispips.Add( pispip );
+              nextweek        := nextweek.StartOfNextWeek();
+            }
+            
+            //鏈堬紝閫夋嫨鏈堟椂锛屾湡鏈簱瀛樹负姣忎竴鏈堟渶鍚庝竴澶╃殑姹囨�诲簱瀛樹俊鎭紝鏈�灏忓簱瀛樹负杩欎竴涓湀搴撳瓨閲忔渶灏忕殑涓�澶╃殑鏁板�硷紝鏈�澶у簱瀛樹负杩欎竴涓湀搴撳瓨閲忔渶澶х殑涓�澶╃殑鏁板�硷紝骞冲潎搴撳瓨涓鸿鏈堢殑骞冲潎鍊�
+            if( period.Start() < nextmonth ){
+              monthpispips.Add( pispip );
+              
+              monthend := nextmonth - Duration::Days( 1 );
+              if( period.Start() = monthend ){
+                monthcolumn  := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Month() );
+                
+                maxinventory := max( monthpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                mininventory := min( monthpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                aveinventory := average( monthpispips, Elements, e, [Number]e.PlannedInventoryLevelEnd() );
+                factoryrow.SetCellValue( monthcolumn, [Number]pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, [Number]aveinventory );
+                allrow.SetCellValue( monthcolumn, [Number]pispip.PlannedInventoryLevelEnd(), mininventory, maxinventory, [Number]aveinventory );
+              }
+            }else{
+              monthpispips.Flush();
+              monthpispips.Add( pispip );
+              nextmonth      := nextmonth.StartOfNextMonth();
+            }
           }
-        }else{
-          monthpispips.Flush();
-          monthpispips.Add( pispip );
-          nextmonth := nextmonth.StartOfNextMonth();
         }
       }
     }
diff --git "a/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue\0430.qbl" "b/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue\0430.qbl"
index 20f91c4..a9134a7 100644
--- "a/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue\0430.qbl"
+++ "b/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue\0430.qbl"
@@ -2,7 +2,7 @@
 #parent: #root
 Method SetCellValue (
   InventorySummaryColumn column,
-  Real quantity
+  Number quantity
 )
 {
   TextBody:
diff --git a/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue0.qbl b/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue0.qbl
index 7f6b3b2..0250a4b 100644
--- a/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue0.qbl
+++ b/_Main/BL/Type_InventroySummaryRow/Method_SetCellValue0.qbl
@@ -2,10 +2,10 @@
 #parent: #root
 Method SetCellValue (
   InventorySummaryColumn column,
-  Real endinginventory,
-  Real minimuminventory,
-  Real maximuminventory,
-  Real averageinventory
+  Number endinginventory,
+  Number minimuminventory,
+  Number maximuminventory,
+  Number averageinventory
 )
 {
   TextBody:
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelExport.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelExport.def
index 2752b5b..82e986e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelExport.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelExport.def
@@ -12,6 +12,16 @@
       Properties:
       [
         Image: 'EXPORT1'
+        Taborder: 1
+      ]
+    }
+    Component ButtonSearch
+    {
+      #keys: '[415136.0.972170614]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'VIEW'
         Taborder: 0
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelFinancialProductionReportOperation.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelFinancialProductionReportOperation.def
index 7d1a944..3b019a4 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelFinancialProductionReportOperation.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Component_PanelFinancialProductionReportOperation.def
@@ -22,7 +22,7 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Image: 'EXPORT1'
+        Image: 'IMPORT1'
         Taborder: 1
       ]
     }
@@ -32,7 +32,7 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Image: 'IMPORT1'
+        Image: 'EXPORT1'
         Taborder: 2
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_ButtonSearch_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_ButtonSearch_OnClick.def
new file mode 100644
index 0000000..de14896
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_ButtonSearch_OnClick.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelExport/ButtonSearch
+Response OnClick () id:Response_PanelExport_ButtonSearch_OnClick
+{
+  #keys: '[415136.0.972170823]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
index b299a53..786e62f 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
@@ -11,7 +11,7 @@
     [*
       if( dhSearch.Data().Generation() <> selection ){
         dhSearch.Data().Generation( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
index 972e396..a4b08cb 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
@@ -11,7 +11,7 @@
     [*
       if( dhSearch.Data().MqbMlb() <> selection ){
         dhSearch.Data().MqbMlb( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelPower_ddslPower_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
index 782939b..ac5059f 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
@@ -11,7 +11,7 @@
     [*
       if( dhSearch.Data().Power() <> selection ){
         dhSearch.Data().Power( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
index 7fbf5de..8e539cb 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
@@ -11,7 +11,7 @@
     [*
       if( dhSearch.Data().Unit() <> selection ){
         dhSearch.Data().Unit( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelExport\043545.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelExport\043545.def"
index 78299c1..75f5b1b 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelExport\043545.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelExport\043545.def"
@@ -12,6 +12,16 @@
       Properties:
       [
         Image: 'EXPORT1'
+        Taborder: 1
+      ]
+    }
+    Component ButtonSearch id:ButtonSearch_75
+    {
+      #keys: '[415136.0.972100211]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'VIEW'
         Taborder: 0
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelFinancialSalesReportOperation.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelFinancialSalesReportOperation.def
index 5a9bec8..b204aa7 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelFinancialSalesReportOperation.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelFinancialSalesReportOperation.def
@@ -22,7 +22,7 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Image: 'EXPORT1'
+        Image: 'IMPORT1'
         Taborder: 1
       ]
     }
@@ -32,7 +32,7 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Image: 'IMPORT1'
+        Image: 'EXPORT1'
         Taborder: 2
       ]
     }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_545_ButtonSearch_OnClick\043118.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_545_ButtonSearch_OnClick\043118.def"
new file mode 100644
index 0000000..2b48608
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_545_ButtonSearch_OnClick\043118.def"
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelExport_545/ButtonSearch_75
+Response OnClick () id:Response_PanelExport_ButtonSearch_OnClick_118
+{
+  #keys: '[415136.0.972100210]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelGeneration_844_ddslGeneration_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelGeneration_844_ddslGeneration_OnSelectionChanged.def
index 6c500d5..10fe370 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelGeneration_844_ddslGeneration_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelGeneration_844_ddslGeneration_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //浠f暟鏀瑰彉鍚庡埛鏂版樉绀�
       if( dhSearch.Data().Generation() <> selection ){
         dhSearch.Data().Generation( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelMQBMLB_603_ddslMQBMLB_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelMQBMLB_603_ddslMQBMLB_OnSelectionChanged.def
index 1fd2082..7c37c20 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelMQBMLB_603_ddslMQBMLB_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelMQBMLB_603_ddslMQBMLB_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //妯旱鍒舵敼鍙樺悗鍒锋柊鏄剧ず
       if( dhSearch.Data().MqbMlb() <> selection ){
         dhSearch.Data().MqbMlb( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelPower_858_ddslPower_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelPower_858_ddslPower_OnSelectionChanged.def
index 45a6525..c1d3e51 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelPower_858_ddslPower_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelPower_858_ddslPower_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //鍔熺巼鏀瑰彉鍚庡埛鏂版樉绀�
       if( dhSearch.Data().Power() <> selection ){
         dhSearch.Data().Power( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnCreated.def
index 5424b65..28ae246 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnCreated.def
@@ -10,7 +10,7 @@
     Body:
     [*
       
-      valueString := "<All>;" + FinancialSalesReport::GetSalesSegmentCC() + ";" + FinancialSalesReport::GetSalesSegmentDL();
+      valueString := FinancialSalesReport::GetDefaultAllUnit() + ";" + FinancialSalesReport::GetDefaultCCUnit() + ";" + FinancialSalesReport::GetDefaultDLUnit();
       
       this.Strings( valueString );
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnSelectionChanged.def
index 3d59900..698e258 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelUnit_715_ddslUnit_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //Unit鏇存柊鍚庣敓鎴愭柊鐨勬樉绀�
       if( dhSearch.Data().Unit() <> selection ){
         dhSearch.Data().Unit( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Component_PanelExport.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Component_PanelExport.def
index cded950..96e3d3b 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Component_PanelExport.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Component_PanelExport.def
@@ -11,7 +11,17 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Image: 'IMPORT1'
+        Image: 'EXPORT1'
+        Taborder: 1
+      ]
+    }
+    Component ButtonSearch id:ButtonSearch_612
+    {
+      #keys: '[415136.0.972100788]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'VIEW'
         Taborder: 0
       ]
     }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelCategory_RadioButtonGroupUseForPlanning_OnChanged\043847.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelCategory_RadioButtonGroupUseForPlanning_OnChanged\043847.def"
index 83bb279..2a55339 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelCategory_RadioButtonGroupUseForPlanning_OnChanged\043847.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelCategory_RadioButtonGroupUseForPlanning_OnChanged\043847.def"
@@ -12,7 +12,7 @@
       //鍖洪棿鏀瑰彉鍚庡埛鏂版樉绀�
       if( dhSearch.Data().Category() <> this.BoundValue() ){
         dhSearch.Data().Category( this.BoundValue() );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSearch_OnClick\043290.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSearch_OnClick\043290.def"
new file mode 100644
index 0000000..31ffc71
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSearch_OnClick\043290.def"
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelExport/ButtonSearch_612
+Response OnClick () id:Response_PanelExport_ButtonSearch_OnClick_290
+{
+  #keys: '[415136.0.972100787]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
index 41e1fd3..843bc87 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelGeneration_ddslGeneration_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //浠f暟鏀瑰彉鍚庡埛鏂版樉绀�
       if( dhSearch.Data().Generation() <> selection ){
         dhSearch.Data().Generation( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
index a86bd8c..b4bef55 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelMQBMLB_ddslMQBMLB_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //妯旱鍒舵敼鍙樺悗鍒锋柊鏄剧ず
       if( dhSearch.Data().MqbMlb() <> selection ){
         dhSearch.Data().MqbMlb( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorEnd_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorEnd_OnChanged.def
index 503f315..b4945f2 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorEnd_OnChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorEnd_OnChanged.def
@@ -15,7 +15,7 @@
       }else{
         if( dhSearch.Data().EndDate() <> this.Date() ){
           dhSearch.Data().EndDate( this.Date() );
-          DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //    DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
         }
       }
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorStart_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorStart_OnChanged.def
index ba04b08..3a8371e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorStart_OnChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPeriod_DateSelectorStart_OnChanged.def
@@ -15,7 +15,7 @@
       }else{
         if( dhSearch.Data().StartDate() <> this.Date() ){
           dhSearch.Data().StartDate( this.Date() );
-          DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //    DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
         }
       }
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPower_ddslPower_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
index 01ad63c..f6b440e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelPower_ddslPower_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //鍔熺巼鏀瑰彉鍚庡埛鏂版樉绀�
       if( dhSearch.Data().Power() <> selection ){
         dhSearch.Data().Power( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
index a4cb7ef..976128d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelUnit_ddslUnit_OnSelectionChanged.def
@@ -12,7 +12,7 @@
       //Unit鏇存柊鍚庣敓鎴愭柊鐨勬樉绀�
       if( dhSearch.Data().Unit() <> selection ){
         dhSearch.Data().Unit( selection );
-        DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
+      //  DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() );
       }
     *]
     GroupServerCalls: false

--
Gitblit v1.9.3