From dba3b5328e7269c3b0ba8339d6ad32399d1f4352 Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期五, 01 十一月 2024 18:53:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 _Main/BL/Type_InterfaceDataset/Method_GenerateArchiveData.qbl                                                                                  |    4 
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def |   17 +
 _Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelHeader.def                                                       |    1 
 _Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_MatrixEditorTable.def                                                 |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_dsEndDate_OnCreated.def                    |   16 
 _Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Response_OnCreated.def                                                          |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_bRefresh_OnClick.def                              |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixeditorContextMenuArchiveTransferPlan.def                         |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_ListLockPeriod.def                                                              |   20 +
 _Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize#194.qbl                                                                     |   17 +
 _Main/BL/Type_LockPeriod/Method_Enable.qbl                                                                                                     |   49 ++
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_bReSync_OnClick.def                        |   29 +
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan515.def                                        |   14 
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan.def                                           |   11 
 _Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_listContextMenuLockPeriod.def                                                   |   25 +
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def                                        |   41 ++
 _Main/UI/MacroPlannerWebApp/Component_FormAssemblyOnlinePlanVersion/Component_MatrixEditorTable#384.def                                        |    2 
 _Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl                                                                           |    4 
 _Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize0.qbl                                                                        |   25 +
 _Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Component_MatrixEditorTable.def                                                   |    2 
 _Main/BL/Type_LockPeriod/Method_Disable.qbl                                                                                                    |   19 +
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupRestraint.def                                            |   11 
 _Main/BL/Type_CustomerDemandIDS/Method_GenerateColumn.qbl                                                                                      |   16 
 _Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelProduct.def                                                      |    1 
 _Main/UI/MacroPlannerWebApp/Views/LockPeriodData.vw                                                                                            |  199 +++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixEditorActionBarPageArchiveTransferPlan.def                       |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_bRefresh_OnClick.def                                       |    2 
 _Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl                                                                          |    2 
 _Main/BL/Type_LockPeriod/StaticMethod_Create.qbl                                                                                               |   10 
 _Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl                             |    6 
 _Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/Attribute_IsLock.qbl                                                                  |    7 
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupRestraint_ButtonLockPeriodData_OnClick.def   |   17 +
 _Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mDisable_OnClick.def                                              |   21 +
 _Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl                                                                                  |   50 +-
 _Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize.qbl                                                                         |   13 
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/_ROOT_Component_FormActualDailyProduction.def                                  |   18 +
 _Main/BL/Type_NewOfflinePlanRow/Attribute_StockingPointID.qbl                                                                                  |    7 
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/_ROOT_Component_FormArchiveTransferPlan.def                                      |   17 +
 _Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mEnable_OnClick#21.def                                            |   22 +
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listActionBarPageActualDailyProduction.def                           |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_MatrixEditorArchiveTransferPlan.def                                    |   97 +++++
 _Main/UI/MacroPlannerWebApp/Component_DialogZEDPPSMS64/Response_pnlLeft_88_ddslFactory_OnCreated.def                                           |   18 +
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction912.def                                    |   14 
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def                             |   10 
 _Main/BL/Type_AOnlineAndMOfflinePlanMS64/StaticMethod_GenerateData.qbl                                                                         |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/_ROOT_Component_FormArchivePackagingPlan.def                                    |    4 
 /dev/null                                                                                                                                      |    9 
 _Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/_ROOT_Component_FormLockPeriod.def                                                        |    5 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def                  |    1 
 _Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def                                        |   11 
 _Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction.def                                       |   46 ++
 51 files changed, 902 insertions(+), 68 deletions(-)

diff --git a/_Main/BL/Relations/Relation_InterfaceForecast_InterfaceDataset_InterfaceDataset_InterfaceForeca.qbl b/_Main/BL/Relations/Relation_InterfaceForecast_InterfaceDataset_InterfaceDataset_InterfaceForeca.qbl
deleted file mode 100644
index c04afe5..0000000
--- a/_Main/BL/Relations/Relation_InterfaceForecast_InterfaceDataset_InterfaceDataset_InterfaceForeca.qbl
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Relation InterfaceForecast_InterfaceDataset_InterfaceDataset_InterfaceForecast
-{
-  #keys: '1[415136.0.1136940384]'
-  DefaultRelationStrategy
-  {
-  }
-  RelationSide.LeftSide InterfaceDataset
-  {
-    #keys: '3[415136.0.1136940386][415136.0.1136940385][415136.0.1136940387]'
-    Cardinality: '0to1'
-    ObjectDefinition: InterfaceForecast
-    OwningSide: 'Reference'
-  }
-  RelationSide.RightSide InterfaceForecast
-  {
-    #keys: '3[415136.0.1136940389][415136.0.1136940388][415136.0.1136940390]'
-    Cardinality: '1toN'
-    ObjectDefinition: InterfaceDataset
-    OwningSide: 'Owned'
-  }
-}
diff --git a/_Main/BL/Type_AOnlineAndMOfflinePlanMS64/StaticMethod_GenerateData.qbl b/_Main/BL/Type_AOnlineAndMOfflinePlanMS64/StaticMethod_GenerateData.qbl
index 28f43a3..cd645ae 100644
--- a/_Main/BL/Type_AOnlineAndMOfflinePlanMS64/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_AOnlineAndMOfflinePlanMS64/StaticMethod_GenerateData.qbl
@@ -29,7 +29,7 @@
                                                       , Name := Translations::InterfaceDataset_AOnlineAndMOfflinePlanMS64_Name()
                                                       , InterfaceDateTime := nowdate
                                                       , Message := '瑁呴厤涓婄嚎璁″垝 + 鏈哄姞涓嬬嚎璁″垝 - MS64'
-                                                      , IsShow := false
+    //                                                  , IsShow := false
                                                       , Last := true
                                                       , ReturnSuccess := true
                                                       , ReturnMsg := 'Success'
diff --git a/_Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl b/_Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl
index de8c96f..bad399c 100644
--- a/_Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_AOnlineAndMOfflinePlanPIR/StaticMethod_GenerateData.qbl
@@ -28,7 +28,7 @@
                                                       , Name := Translations::InterfaceDataset_AOnlineAndMOfflinePlanPIR_Name()
                                                       , InterfaceDateTime := nowdate
                                                       , Message := '瑁呴厤涓婄嚎璁″垝 + 鏈哄姞涓嬬嚎璁″垝 - PIR'
-                                                      , IsShow := false
+    //                                                  , IsShow := false
                                                       , Last := true
                                                       , ReturnSuccess := true
                                                       , ReturnMsg := 'Success'
diff --git "a/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize\043194.qbl" "b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize\043194.qbl"
new file mode 100644
index 0000000..0f1fe83
--- /dev/null
+++ "b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize\043194.qbl"
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Synchronize (
+  InterfaceDataset interfaceDataset,
+  String executor,
+  Date startDate,
+  Date endDate
+)
+{
+  TextBody:
+  [*
+    // rislai Jul-23-2024 (created)
+    for( i := startDate; i <= endDate; i := i+1 ){
+      ActualDailyProductionData::Synchronize( interfaceDataset, executor, i ); 
+    }
+  *]
+}
diff --git a/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize.qbl b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize.qbl
index 8942535..043837d 100644
--- a/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize.qbl
+++ b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize.qbl
@@ -9,17 +9,6 @@
   [*
     // rislai Jul-23-2024 (created)
     date    := Date::ActualDate() - 1;
-    loginfo := interfaceDataset.InterfaceLoginfo( relnew, ExecuteUser := executor
-                                       , Name := Translations::InterfaceDataset_ActualDailyProductionData_Name()
-                                       , InterfaceDateTime := DateTime::ActualTime()
-                                       , Message := '鐢熶骇瀹為檯鏁版嵁'
-                                       , RequestBody := ActualDailyProductionData::GetRequestBody( date ) );
-    
-    data := InterfaceLoginfo::CallInterface( interfaceDataset,loginfo );
-    
-    options := DatasetFindOptions::Construct( 'Archive' ).IncludeOffline( true ); //to load we must search offline datasets.
-    mdskey := DatasetController::FindUnique( options );
-    
-    MDSArchive::Root( mdskey ) -> ActualDailyProductionData::ParseData( data );
+    ActualDailyProductionData::Synchronize( interfaceDataset,executor,date );
   *]
 }
diff --git a/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize0.qbl b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize0.qbl
new file mode 100644
index 0000000..f235822
--- /dev/null
+++ b/_Main/BL/Type_ActualDailyProductionReport/StaticMethod_Synchronize0.qbl
@@ -0,0 +1,25 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Synchronize (
+  InterfaceDataset interfaceDataset,
+  String executor,
+  Date date
+)
+{
+  TextBody:
+  [*
+    // rislai Jul-23-2024 (created)
+    loginfo := interfaceDataset.InterfaceLoginfo( relnew, ExecuteUser := executor
+                                       , Name := Translations::InterfaceDataset_ActualDailyProductionData_Name()
+                                       , InterfaceDateTime := DateTime::ActualTime()
+                                       , Message := '鐢熶骇瀹為檯鏁版嵁'
+                                       , RequestBody := ActualDailyProductionData::GetRequestBody( date ) );
+    
+    data := InterfaceLoginfo::CallInterface( interfaceDataset,loginfo );
+    
+    options := DatasetFindOptions::Construct( 'Archive' ).IncludeOffline( true ); //to load we must search offline datasets.
+    mdskey := DatasetController::FindUnique( options );
+    
+    MDSArchive::Root( mdskey ) -> ActualDailyProductionData::ParseData( data );
+  *]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/Method_GenerateColumn.qbl b/_Main/BL/Type_CustomerDemandIDS/Method_GenerateColumn.qbl
index 1cf28e8..f97e7fb 100644
--- a/_Main/BL/Type_CustomerDemandIDS/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_CustomerDemandIDS/Method_GenerateColumn.qbl
@@ -8,23 +8,33 @@
   [*
     // 鐢勫叞楦� Jun-25-2024 (created)
     weekstart             := periods.Element( 0 );
+    
     monthstart            := periods.Element( 0 );
     traverse( periods, Elements, periodtime ){
       periodname          := periodtime.Format( "M2/D2/Y" );
       
       this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
       
+      weekend             := ( weekstart + Duration::Days( 6 ) ).Date();
+      if( ( weekend.Year() <> periodtime.Year() and weekend.Month() > 1 ) or ( abs( weekstart.Week() - periodtime.Week() ) > 1 and weekend.Year() = periodtime.Year() ) ){
+        weekstart         := periodtime;
+      }
       if( periodtime = weekstart ){
         weekperiodname    := weekstart.Format( "M2/D2/Y" );
-        this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
-        weekstart         := ( weekstart + Duration::Days( 7 ) ).Date();
+        this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart.StartOfNextWeek() - Duration::Days( 1 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
+        
+      }
+      if( ( monthstart.Year() <> periodtime.Year() and abs( monthstart.Month() - periodtime.Month() ) <> 11 ) or ( abs( monthstart.Month() - periodtime.Month() ) > 1 and monthstart.Year() = periodtime.Year() ) ){
+        monthstart        := periodtime;
       }
       if( periodtime = monthstart ){
         monthperiodname   := monthstart.Format( "M2/D2/Y" );
         enddate           := ( monthstart.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
         this.Column( relnew, Name := monthperiodname, StartDate := monthstart, EndDate := enddate, TimeUnit := Translations::MP_GlobalParameters_Month() );
-        monthstart        := monthstart.StartOfNextMonth();
+        
       }
+      weekstart         := periodtime.StartOfNextWeek();
+      monthstart        := periodtime.StartOfNextMonth();
     }
   *]
 }
diff --git a/_Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl b/_Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl
index 0cbe54d..db43831 100644
--- a/_Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl
@@ -2,6 +2,7 @@
 #parent: #root
 StaticMethod GenerateData (
   InterfaceDataset interface,
+  const MacroPlan macroplan,
   RecycleBin recycle,
   const Archive archive
 )
@@ -11,10 +12,16 @@
   [*
     // 鐢勫叞楦� Aug-20-2024 (created)
     interface.CustomerDemandIDS( relflush );
-    interface.CustomerDemandIDSSearch( relflush );
+    //interface.CustomerDemandIDSSearch( relflush );
+    info( '-------------------------Start---------------------');
     allunit               := CustomerDemandIDS::GetDefaultAllUnit();
-    interface.CustomerDemandIDSSearch( relnew, Generation := allunit, MqbMlb := allunit, Power := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit );
-    idstable              := interface.CustomerDemandIDS( relnew, ID := '瀹㈡埛闇�姹�', Name := '瀹㈡埛闇�姹�' );
+    if( isnull( interface.CustomerDemandIDSSearch() ) ){
+      interface.CustomerDemandIDSSearch( relnew, Generation := allunit, MqbMlb := allunit, Power := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit );
+    }
+    idstable              := selectobject( interface, CustomerDemandIDS, idstable, idstable.ID() = '瀹㈡埛闇�姹�' );
+    if( isnull( idstable ) ){
+      idstable            := interface.CustomerDemandIDS( relnew, ID := '瀹㈡埛闇�姹�', Name := '瀹㈡埛闇�姹�' );
+    }
     binaryValue           := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() );
     source                := GeneralExcelImportAndExportDataSource::Upload( recycle, binaryValue, OS::TempPath() + "template.xlsx" );
     source.ReadStructure();
@@ -23,14 +30,12 @@
     cnv2.SetCustomConversion();
     cnv2.CustomFormatString( "yyyy/MM/dd" );
     idsdates              := selectuniquevalues( source, GeneralExcelImportAndExportDataTable.GeneralExcelImportAndExportDataColumn, column, column.ColumnIndex() > 2, cnv2.Convert( column.Name() ) );
-    ppadates              := selectuniquevalues( interface, InterfaceForecast, forecast, forecast.Origin() = 'PPA', forecast.Date() );
-    //ppadates              := construct( Dates );
-    //traverse( macroplan, SalesDemand.astype( Forecast ), forecast, forecast.Origin() = 'PPA' ){
-    //  ppadates            := ppadates.Union( selectuniquevalues( forecast, PlanningSalesDemandInPeriod, salesdemand, salesdemand.StartDate() ) );
-    //}
+    ppadates              := selectuniquevalues( macroplan, SalesDemand.astype( Forecast ), forecast, forecast.Origin() = 'PPA', forecast.StartDate() );
     periods               := idsdates.Union( ppadates );
-    periods               := selectuniquevalues( periods, Elements, e, e );
-    idstable.GenerateColumn( periods.Sort() );
+    periods               := selectuniquevalues( periods, Elements, e, not exists( idstable, Column, column, column.StartDate() = e ), e );
+    if( periods.Size() > 0 ){
+      idstable.GenerateColumn( periods.Sort() );
+    }
     traverse( recycle, GeneralExcelImportAndExportDataSource.GeneralExcelImportAndExportDataTable, table ){
       traverse( table, GeneralExcelImportAndExportDataRow, row ){
         productcell       := selectobject( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 2 );
@@ -41,22 +46,27 @@
           daycolumn       := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), period );
           weekcolumn      := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), period );
           monthcolumn     := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), period );
+          
           idsrow.SetCellValue( daycolumn, [Number]cell.Value() );
-          idsrow.SetCellValue( weekcolumn, [Number]cell.Value() );
-          idsrow.SetCellValue( monthcolumn, [Number]cell.Value() );
+          idsrow.SetCellValue( weekcolumn, [Number]cell.Value() ); 
+          idsrow.SetCellValue( monthcolumn, [Number]cell.Value() ); 
         }
       }
     }
-    traverse( interface, InterfaceForecast, forecast, forecast.Origin() = 'PPA' ){
-      idsrow              := idstable.GetRowByUnit( forecast.PartNumber(), forecast.Factory() );
-      daycolumn           := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), forecast.Date() );
-      weekcolumn          := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), forecast.Date() );
-      monthcolumn         := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), forecast.Date() );
-      idsrow.SetCellValue( daycolumn, [Number]forecast.Quantity() );
-      idsrow.SetCellValue( weekcolumn, [Number]forecast.Quantity() );
-      idsrow.SetCellValue( monthcolumn, [Number]forecast.Quantity() );
+    traverse ( macroplan, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.Product_MP() ) and forecast.Origin() = 'PPA' ){
+      traverse( forecast, PlanningSalesDemandInPeriod, sdip ){
+        idsrow              := idstable.GetRowByUnit( forecast.ProductID(), forecast.SalesSegmentName() );
+        daycolumn           := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), sdip.StartDate() );
+        weekcolumn          := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), sdip.StartDate() );
+        monthcolumn         := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), sdip.StartDate() );
+        info( '-----------------', isnull( idsrow ), isnull( daycolumn ), isnull( weekcolumn ), isnull( monthcolumn ), sdip.StartDate() );
+        idsrow.SetCellValue( daycolumn, [Number]sdip.Quantity() );
+        idsrow.SetCellValue( weekcolumn, [Number]sdip.Quantity() );
+        idsrow.SetCellValue( monthcolumn, [Number]sdip.Quantity() );
+      }
     }
     
     source.Delete();
+    info( '-------------------------End---------------------');
   *]
 }
diff --git a/_Main/BL/Type_InterfaceDataset/Method_GenerateArchiveData.qbl b/_Main/BL/Type_InterfaceDataset/Method_GenerateArchiveData.qbl
index 12d072c..2e3eff1 100644
--- a/_Main/BL/Type_InterfaceDataset/Method_GenerateArchiveData.qbl
+++ b/_Main/BL/Type_InterfaceDataset/Method_GenerateArchiveData.qbl
@@ -17,8 +17,8 @@
   TextBody:
   [*
     // 鐢勫叞楦� Oct-30-2024 (created)
-    if( iscustomdemand ){//鍏ㄥ勾鏃ュ害闇�姹�/瀹㈡埛闇�姹�
-      CustomerDemandIDS::GenerateData( this, recyclebin, archive );
+    if( iscustomdemand ){//鍏ㄥ勾鏃ュ害闇�姹�/瀹㈡埛闇�姹� 
+      CustomerDemandIDS::GenerateData( this, macroplan, recyclebin, archive );
     }
     if( isofflineplan ){//鍚勪骇绾夸笅绾胯鍒�
       OfflinePlanArchiveVersion::RefreshData( this, macroplan, archive );
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Date.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Date.qbl
deleted file mode 100644
index 1112fa9..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Date.qbl
+++ /dev/null
@@ -1,8 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Date
-{
-  #keys: '3[415136.0.1136940360][415136.0.1136940359][415136.0.1136940361]'
-  Description: '鏃ユ湡'
-  ValueType: Date
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Factory.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Factory.qbl
deleted file mode 100644
index 4dc2060..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Factory.qbl
+++ /dev/null
@@ -1,8 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Factory
-{
-  #keys: '3[415136.0.1136940363][415136.0.1136940362][415136.0.1136940364]'
-  Description: '宸ュ巶'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Generation.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Generation.qbl
deleted file mode 100644
index 382bcbe..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Generation.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Generation
-{
-  #keys: '3[415136.0.1136940366][415136.0.1136940365][415136.0.1136940367]'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_MLBMQB.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_MLBMQB.qbl
deleted file mode 100644
index 72745af..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_MLBMQB.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute MLBMQB
-{
-  #keys: '3[415136.0.1136940369][415136.0.1136940368][415136.0.1136940370]'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Origin.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Origin.qbl
deleted file mode 100644
index 99bd907..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Origin.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Origin
-{
-  #keys: '3[415136.0.1136940398][415136.0.1136940397][415136.0.1136940399]'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_PartNumber.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_PartNumber.qbl
deleted file mode 100644
index 316b918..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_PartNumber.qbl
+++ /dev/null
@@ -1,8 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute PartNumber
-{
-  #keys: '3[415136.0.1136940372][415136.0.1136940371][415136.0.1136940373]'
-  Description: '闆朵欢鍙�'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Power.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Power.qbl
deleted file mode 100644
index 77a32b4..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Power.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Power
-{
-  #keys: '3[415136.0.1136940375][415136.0.1136940374][415136.0.1136940376]'
-  ValueType: String
-}
diff --git a/_Main/BL/Type_InterfaceForecast/Attribute_Quantity.qbl b/_Main/BL/Type_InterfaceForecast/Attribute_Quantity.qbl
deleted file mode 100644
index 69a83ca..0000000
--- a/_Main/BL/Type_InterfaceForecast/Attribute_Quantity.qbl
+++ /dev/null
@@ -1,7 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Attribute Quantity
-{
-  #keys: '3[415136.0.1136940378][415136.0.1136940377][415136.0.1136940379]'
-  ValueType: Real
-}
diff --git a/_Main/BL/Type_InterfaceForecast/DefaultValue_Factory.qbl b/_Main/BL/Type_InterfaceForecast/DefaultValue_Factory.qbl
deleted file mode 100644
index 49653fb..0000000
--- a/_Main/BL/Type_InterfaceForecast/DefaultValue_Factory.qbl
+++ /dev/null
@@ -1,6 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  TargetAttribute: Factory
-}
diff --git a/_Main/BL/Type_InterfaceForecast/DefaultValue_Generation.qbl b/_Main/BL/Type_InterfaceForecast/DefaultValue_Generation.qbl
deleted file mode 100644
index 9e5b51e..0000000
--- a/_Main/BL/Type_InterfaceForecast/DefaultValue_Generation.qbl
+++ /dev/null
@@ -1,6 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  TargetAttribute: Generation
-}
diff --git a/_Main/BL/Type_InterfaceForecast/DefaultValue_MLBMQB.qbl b/_Main/BL/Type_InterfaceForecast/DefaultValue_MLBMQB.qbl
deleted file mode 100644
index 9ddeec7..0000000
--- a/_Main/BL/Type_InterfaceForecast/DefaultValue_MLBMQB.qbl
+++ /dev/null
@@ -1,6 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  TargetAttribute: MLBMQB
-}
diff --git a/_Main/BL/Type_InterfaceForecast/DefaultValue_PartNumber.qbl b/_Main/BL/Type_InterfaceForecast/DefaultValue_PartNumber.qbl
deleted file mode 100644
index cead834..0000000
--- a/_Main/BL/Type_InterfaceForecast/DefaultValue_PartNumber.qbl
+++ /dev/null
@@ -1,6 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  TargetAttribute: PartNumber
-}
diff --git a/_Main/BL/Type_InterfaceForecast/DefaultValue_Power.qbl b/_Main/BL/Type_InterfaceForecast/DefaultValue_Power.qbl
deleted file mode 100644
index 4922731..0000000
--- a/_Main/BL/Type_InterfaceForecast/DefaultValue_Power.qbl
+++ /dev/null
@@ -1,6 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-DefaultValue
-{
-  TargetAttribute: Power
-}
diff --git a/_Main/BL/Type_InterfaceForecast/StaticMethod_ArchivedData.qbl b/_Main/BL/Type_InterfaceForecast/StaticMethod_ArchivedData.qbl
deleted file mode 100644
index 0a0552f..0000000
--- a/_Main/BL/Type_InterfaceForecast/StaticMethod_ArchivedData.qbl
+++ /dev/null
@@ -1,33 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod ArchivedData (
-  InterfaceDataset interfaceDataset,
-  MacroPlan macroPlan
-)
-{
-  TextBody:
-  [*
-    traverse ( macroPlan, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.Product_MP() ) ){
-    //  factory := f.Origin().Tokenize( "-" ).Element( 0 );
-      product := forecast.Product_MP();
-      traverse( forecast, PlanningSalesDemandInPeriod, sdip ){
-        itrcf := selectobject( interfaceDataset, InterfaceForecast, tempITRCF, tempITRCF.PartNumber() = forecast.ProductID() and tempITRCF.Date() = sdip.StartDate() );
-    
-        if ( not isnull( itrcf ) ) {
-          itrcf.Delete();
-        }
-      
-        interfaceDataset.InterfaceForecast( relnew, 
-                                             Date       := sdip.StartDate(),
-                                             Factory    := forecast.SalesSegmentName(),
-                                             PartNumber := forecast.ProductID(),
-                                             Quantity   := sdip.Quantity(),
-                                             Generation := product.Generation(),
-                                             MLBMQB     := product.MQBMLB(),
-                                             Power      := product.Power(),
-                                             Origin     := forecast.Origin()
-                                            );
-      }
-    }
-  *]
-}
diff --git a/_Main/BL/Type_InterfaceForecast/_ROOT_Type_InterfaceForecast.qbl b/_Main/BL/Type_InterfaceForecast/_ROOT_Type_InterfaceForecast.qbl
deleted file mode 100644
index 5f8de80..0000000
--- a/_Main/BL/Type_InterfaceForecast/_ROOT_Type_InterfaceForecast.qbl
+++ /dev/null
@@ -1,9 +0,0 @@
-Quintiq file version 2.0
-#root
-#parent: #DomainModel
-Type InterfaceForecast
-{
-  #keys: '5[415136.0.1136940357][415136.0.1136940355][0.0.0][415136.0.1136940356][415136.0.1136940358]'
-  BaseType: Object
-  StructuredName: 'InterfaceForecasts'
-}
diff --git a/_Main/BL/Type_LockPeriod/Method_Disable.qbl b/_Main/BL/Type_LockPeriod/Method_Disable.qbl
new file mode 100644
index 0000000..1f03c2b
--- /dev/null
+++ b/_Main/BL/Type_LockPeriod/Method_Disable.qbl
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: #root
+Method Disable
+{
+  TextBody:
+  [*
+    // Akari Nov-1-2024 (created)
+    if( this.IsEnable()){
+      this.IsEnable( false );
+      
+      pispips := selectset( this,ProductInStockingPoint_MP.ProductInStockingPointInPeriod.astype( ProductInStockingPointInPeriodPlanningLeaf ),period,period.Period_MP().StartDate() <= this.LockDate() );
+      traverse( pispips,Elements,element ){
+        element.IsLock( false );
+      }
+      
+      ProductInStockingPointInPeriod::LockUnlockPlanning( pispips, false, true );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_LockPeriod/Method_Enable.qbl b/_Main/BL/Type_LockPeriod/Method_Enable.qbl
index d613476..ccff833 100644
--- a/_Main/BL/Type_LockPeriod/Method_Enable.qbl
+++ b/_Main/BL/Type_LockPeriod/Method_Enable.qbl
@@ -7,26 +7,57 @@
   TextBody:
   [*
     // Akari Oct-30-2024 (created)
-    offlinePlanRow := select( offlinePlanTable,NewOfflinePlanRow,row,row.ProductID() = this.ProductInStockingPoint_MP().ProductID() );
+    offlinePlanRow := select( offlinePlanTable,NewOfflinePlanRow,row,row.ProductID() = this.ProductInStockingPoint_MP().ProductID() and row.StockingPointID() = this.ProductInStockingPoint_MP().StockingPointID() );
+    
+    offlinePlanCells := selectset( offlinePlanRow, NewOfflinePlanCell,cell,true );
+    offlinePlanCellIndexTree := NamedValueTree::Create();
+    for( i := 0; i< offlinePlanCells.Size(); i++ ){
+      offlinePlanCell := offlinePlanCells.Element( i );
+      offlinePlanCellHandle := offlinePlanCellIndexTree.GetHandle( offlinePlanCell.NewOfflinePlanColumn().StartDate().AsQUILL() );
+      offlinePlanCellIndexTree.Root().AddChild( offlinePlanCellHandle,i );
+    }
+    
     
     if( not this.IsEnable() ){
+      this.IsEnable( true );
+      
       pispips := selectset( this,ProductInStockingPoint_MP.ProductInStockingPointInPeriod.astype( ProductInStockingPointInPeriodPlanningLeaf ),period,period.Period_MP().StartDate() <= this.LockDate() );
       traverse( pispips,Elements,element ){
+        element.IsLock( true );
+        offlinePlanCellHandle := offlinePlanCellIndexTree.GetHandle( element.Period_MP().StartDate().AsQUILL() );
+        offlinePlanCellIndex := guard( offlinePlanCellIndexTree.Root().Child( offlinePlanCellHandle),null( NamedValue ));
+        offlinePlanCellQuantity := 0.0;
+        if( not isnull( offlinePlanCellIndex )){
+          offlinePlanCell := offlinePlanCells.Element( offlinePlanCellIndex.GetValueAsNumber() );
+          offlinePlanCellQuantity := offlinePlanCell.Quantity();
+        }
         if( element.NewSupply( relsize ) = 1 ){
           traverse( element,NewSupply,newSupply ){
-            
+            newSupply.Update( offlinePlanCellQuantity );
           }
         }else if( element.NewSupply( relsize ) > 1 ){
-          
+          newSupplys := selectset( element,NewSupply,newSupply,true );
+          for( i := 1; i < newSupplys.Size(); i++ ){
+            newSupply := newSupplys.Element( i );
+            newSupply.Update( 0.0 );
+          }
+          newSupplys.Element( 0 ).Update( offlinePlanCellQuantity )
         }else if( element.NewSupply( relsize ) = 0 ){
-          unit := element.StockingPointInPeriod().StockingPoint_MP().Unit();
-          operaction := select( unit,Operation,op,true );
-          // PeriodTaskOperation::Create( )
+          if( offlinePlanCellQuantity <> 0 ){
+            info( "new supply is null" );
+            unit := element.StockingPointInPeriod().StockingPoint_MP().Unit();
+            operaction := select( unit,Operation,op,true );
+            if( not isnull( operaction )){
+              info( "operaction is null" );
+              // unitPeriod := element.Period_MP().UnitPeriod()
+              // PeriodTaskOperation::Create( operaction,unitPeriod,quantity,false );
+            }else{
+              
+            }
+          }
         }
-        
-        
-    
       }
+      ProductInStockingPointInPeriod::LockUnlockPlanning( pispips, true, true );
     }
   *]
 }
diff --git a/_Main/BL/Type_LockPeriod/StaticMethod_Create.qbl b/_Main/BL/Type_LockPeriod/StaticMethod_Create.qbl
index 4aa7e39..667e135 100644
--- a/_Main/BL/Type_LockPeriod/StaticMethod_Create.qbl
+++ b/_Main/BL/Type_LockPeriod/StaticMethod_Create.qbl
@@ -8,6 +8,14 @@
   TextBody:
   [*
     // rislai Jun-13-2024 (created)
-    owner.LockPeriod( relnew, LockDate := lockDate );
+    lockPeriod := owner.LockPeriod( relnew, LockDate := lockDate );
+    
+    macroPlan := owner.MacroPlan();
+    
+    offlineTable := select( macroPlan,NewOfflinePlanTable,table,true );
+    
+    if( not isnull( offlineTable )){
+      lockPeriod.Enable( offlineTable ); 
+    }
   *]
 }
diff --git a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
index 6dd9a3b..e51e83c 100644
--- a/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
+++ b/_Main/BL/Type_NewOfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -39,9 +39,9 @@
           sdt      := select( sp, ShiftDayTime, tempSDT, tempSDT.Name() = tempSDT.ShiftPattern().Name() );
           
           // 鐢熸垚涓嬬嚎璁″垝銆愪骇绾挎槑缁嗐�戣
-          detailedNOPR   := select( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.ProductID() = pisp.ProductID() and tempNOPR.Type() = "1" );
+          detailedNOPR   := select( nopt, NewOfflinePlanRow, tempNOPR, tempNOPR.ProductionLine() = u.ID() and tempNOPR.ProductID() = pisp.ProductID() and tempNOPR.StockingPointID() = pisp.StockingPointID() and tempNOPR.Type() = "1" );
           if ( isnull( detailedNOPR ) ) {
-            detailedNOPR := nopt.NewOfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := pisp.ProductID(), Type := "1", OperationID := o.ID() );
+            detailedNOPR := nopt.NewOfflinePlanRow( relnew, ProductionLine := u.ID(), ProductID := pisp.ProductID(),StockingPointID := pisp.StockingPointID(), Type := "1", OperationID := o.ID() );
           }
           
           // 鐢熸垚涓嬬嚎璁″垝鍒�
diff --git a/_Main/BL/Type_NewOfflinePlanRow/Attribute_StockingPointID.qbl b/_Main/BL/Type_NewOfflinePlanRow/Attribute_StockingPointID.qbl
new file mode 100644
index 0000000..aa10488
--- /dev/null
+++ b/_Main/BL/Type_NewOfflinePlanRow/Attribute_StockingPointID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute StockingPointID
+{
+  #keys: '3[414996.1.183584732][414996.1.183584731][414996.1.183584733]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/Attribute_IsLock.qbl b/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/Attribute_IsLock.qbl
new file mode 100644
index 0000000..f22dee4
--- /dev/null
+++ b/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/Attribute_IsLock.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute IsLock
+{
+  #keys: '3[414996.1.185600021][414996.1.185600020][414996.1.185600022]'
+  ValueType: Boolean
+}
diff --git a/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl b/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl
new file mode 100644
index 0000000..8c6a2c8
--- /dev/null
+++ b/_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+TypeSpecialization ProductInStockingPointInPeriodPlanningLeaf #extension
+{
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
index 10f9121..5298ee8 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupArchiveReport.def
@@ -38,6 +38,17 @@
         Taborder: 2
       ]
     }
+    Component ButtonActualDailyProduction
+    {
+      #keys: '[414996.1.186223693]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'RSS'
+        Label: '瀹為檯姣忔棩鐢熶骇璁″垝'
+        Taborder: 3
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupRestraint.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupRestraint.def
index f6b290e..ad5b573 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupRestraint.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Component_ActionBarGroupRestraint.def
@@ -27,6 +27,17 @@
         Taborder: 1
       ]
     }
+    Component ButtonLockPeriodData
+    {
+      #keys: '[414996.1.185742569]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'GEAR_VIEW'
+        Label: 'Lock period data'
+        Taborder: 2
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def
new file mode 100644
index 0000000..c2d70f3
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProductio.def
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: ActionBarGroupArchiveReport/ButtonActualDailyProduction
+Response OnClick () id:Response_MacroPlanner_ActionBarGroupArchiveReport_ButtonActualDailyProduction_OnClick
+{
+  #keys: '[414996.1.186223803]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      // Open view
+      ApplicationMacroPlanner.OpenView( 'ActualDailyProduction', this );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupRestraint_ButtonLockPeriodData_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupRestraint_ButtonLockPeriodData_OnClick.def
new file mode 100644
index 0000000..9f569c5
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_ApplicationMacroPlanner/Response_MacroPlanner_ActionBarGroupRestraint_ButtonLockPeriodData_OnClick.def
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: ActionBarGroupRestraint/ButtonLockPeriodData
+Response OnClick () id:Response_MacroPlanner_ActionBarGroupRestraint_ButtonLockPeriodData_OnClick
+{
+  #keys: '[414996.1.185904137]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      // Open view
+      ApplicationMacroPlanner.OpenView( 'LockPeriodData', this );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
index ada5d7e..3be14e0 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateLockPeriod/Response_pnlContent661_cbAllProductInStockingPoint_OnChanged.def
@@ -14,6 +14,7 @@
         ddlProductInStockingPoint.Enabled( false,"" ); 
       }else{
         ddlProductInStockingPoint.Enabled( true,"" );
+        cbAllProduct.Checked( false );
       }
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogZEDPPSMS64/Response_pnlLeft_88_ddslFactory_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_DialogZEDPPSMS64/Response_pnlLeft_88_ddslFactory_OnCreated.def
new file mode 100644
index 0000000..81ddd11
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogZEDPPSMS64/Response_pnlLeft_88_ddslFactory_OnCreated.def
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: pnlLeft_88/ddslFactory
+Response OnCreated () id:Response_pnlLeft_88_ddslFactory_OnCreated
+{
+  #keys: '[415136.0.1271601330]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  QuillAction
+  {
+    Body:
+    [*
+      valueString := "All";
+      
+      this.Strings( valueString.Concat( ";" ).Concat( FinancialProductionReport::GetDefaultCCUnit().Concat( ";" ) ).Concat( FinancialProductionReport::GetDefaultDLUnit() ) );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def
new file mode 100644
index 0000000..9771638
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_ListActualDailyProduction.def
@@ -0,0 +1,41 @@
+Quintiq file version 2.0
+Component ListActualDailyProduction
+{
+  #keys: '[414996.1.184390814]'
+  BaseType: 'WebList'
+  Children:
+  [
+    Component DataExtractorActualDailyProduction
+    {
+      #keys: '[414996.1.184390815]'
+      BaseType: 'WebDataExtractor'
+      Properties:
+      [
+        DataType: 'external[Archive]'
+        Source: 'Archive'
+        Taborder: 0
+        Transformation: 'ActualDailyProductionData'
+      ]
+    }
+    #child: listActionBarPageActualDailyProduction
+    Component DataSetLevelActualDailyProduction
+    {
+      #keys: '[414996.1.184390820]'
+      BaseType: 'WebDataSetLevel'
+      Children:
+      [
+        #child: listContextMenuActualDailyProduction
+      ]
+      Properties:
+      [
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ActualOut","title":"瀹為檯浜у嚭鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ActualOut"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Fac","title":"宸ュ巶绠�鍐�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Fac"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"LineName","title":"浜х嚎鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"LineName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductionDate","title":"鐢熶骇鏃ユ湡","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductionDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductNo","title":"浜у搧ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductNo"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ShiftCode","title":"鐝鍙�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ShiftCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ShiftName","title":"浜х嚎鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ShiftName"}}]'
+        ContextMenu: 'listContextMenuActualDailyProduction'
+        Taborder: 2
+      ]
+    }
+  ]
+  Properties:
+  [
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction.def
new file mode 100644
index 0000000..a9c5a73
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction.def
@@ -0,0 +1,46 @@
+Quintiq file version 2.0
+Component PanelActualDailyProduction
+{
+  #keys: '[414996.1.184390778]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component dsStartDate
+    {
+      #keys: '[414996.1.184361099]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        Label: 'Start date'
+        Taborder: 0
+      ]
+    }
+    Component dsEndDate
+    {
+      #keys: '[414996.1.185982342]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        Label: 'End date'
+        Taborder: 1
+      ]
+    }
+    Component bReSync
+    {
+      #keys: '[414996.1.185982355]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'ARROW_CIRCLE2'
+        Label: 'Re Sync'
+        Taborder: 2
+      ]
+    }
+  ]
+  Properties:
+  [
+    FixedSize: true
+    Orientation: 'horizontal'
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction912.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction912.def
new file mode 100644
index 0000000..00285b4
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_PanelActualDailyProduction912.def
@@ -0,0 +1,14 @@
+Quintiq file version 2.0
+Component PanelActualDailyProduction912
+{
+  #keys: '[414996.1.184390800]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    #child: ListActualDailyProduction
+  ]
+  Properties:
+  [
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listActionBarPageActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listActionBarPageActualDailyProduction.def
new file mode 100644
index 0000000..ff79c37
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listActionBarPageActualDailyProduction.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component listActionBarPageActualDailyProduction
+{
+  #keys: '[414996.1.184390817]'
+  BaseType: 'listActionBarPage'
+  Properties:
+  [
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def
new file mode 100644
index 0000000..d9f75a7
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Component_listContextMenuActualDailyProduction.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component listContextMenuActualDailyProduction
+{
+  #keys: '[414996.1.184390822]'
+  BaseType: 'listContextMenu'
+  Properties:
+  [
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_bReSync_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_bReSync_OnClick.def
new file mode 100644
index 0000000..bf422af
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_bReSync_OnClick.def
@@ -0,0 +1,29 @@
+Quintiq file version 2.0
+#parent: PanelActualDailyProduction/bReSync
+Response OnClick () id:Response_PanelActualDailyProduction_bReSync_OnClick
+{
+  #keys: '[414996.1.185702537]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  GroupServerCalls: true
+  Precondition:
+  [*
+    return dsEndDate.Date() > dsStartDate.Date();
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      days := dsEndDate.Date() - dsStartDate.Date();
+      if( days >= 365 ){
+        if( WebMessageBox::Question( "褰撳墠鏃堕棿璺ㄥ害銆�"+ [String]days +"澶┿�戣繃澶э紝鏄惁缁х画锛�",Translations::MessageBox_YesNo() ) = 0 ){
+          ActualDailyProductionData::Synchronize( InterfaceDataset,"User",dsStartDate.Date(),dsEndDate.Date() ); 
+        }else{
+          WebMessageBox::Information( "Canceled." ); 
+        }
+      }else{
+        ActualDailyProductionData::Synchronize( InterfaceDataset,"User",dsStartDate.Date(),dsEndDate.Date() );
+      }
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_dsEndDate_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_dsEndDate_OnCreated.def
new file mode 100644
index 0000000..a1db4af
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/Response_PanelActualDailyProduction_dsEndDate_OnCreated.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelActualDailyProduction/dsEndDate
+Response OnCreated () id:Response_PanelActualDailyProduction_dsEndDate_OnCreated
+{
+  #keys: '[414996.1.185563333]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  GroupServerCalls: true
+  QuillAction
+  {
+    Body:
+    [*
+      this.Date( Date::ActualDate() - 1 );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/_ROOT_Component_FormActualDailyProduction.def b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/_ROOT_Component_FormActualDailyProduction.def
new file mode 100644
index 0000000..cced845
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormActualDailyProduction/_ROOT_Component_FormActualDailyProduction.def
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#root
+#parent: MacroPlannerWebApp
+OrphanComponent FormActualDailyProduction
+{
+  #keys: '[414996.1.184390758]'
+  BaseType: 'WebForm'
+  Children:
+  [
+    #child: PanelActualDailyProduction
+    #child: PanelActualDailyProduction912
+  ]
+  Properties:
+  [
+    Image: 'RSS'
+    Title: 'Actual Daily Production'
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/_ROOT_Component_FormArchivePackagingPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/_ROOT_Component_FormArchivePackagingPlan.def
index 6dcd1e7..9e6ec7a 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/_ROOT_Component_FormArchivePackagingPlan.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchivePackagingPlan/_ROOT_Component_FormArchivePackagingPlan.def
@@ -10,4 +10,8 @@
     #child: PanelArchivePackagingPlan
     #child: PanelArchivePackagingPlan922
   ]
+  Properties:
+  [
+    Title: 'Archive Packaging Plan'
+  ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_MatrixEditorArchiveTransferPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_MatrixEditorArchiveTransferPlan.def
new file mode 100644
index 0000000..cab7630
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_MatrixEditorArchiveTransferPlan.def
@@ -0,0 +1,97 @@
+Quintiq file version 2.0
+Component MatrixEditorArchiveTransferPlan
+{
+  #keys: '[414996.1.183850516]'
+  BaseType: 'WebMatrixEditor'
+  Children:
+  [
+    Component MatrixEditorCellArchiveTransferPlan
+    {
+      #keys: '[414996.1.183850517]'
+      BaseType: 'WebMatrixEditorCell'
+      Children:
+      [
+        Component DataExtractorArchiveTransferPlan
+        {
+          #keys: '[414996.1.183850518]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'Archive'
+            Source: 'Archive'
+            Taborder: 0
+            Transformation: 'ArchiveTransferPlanRow.ArchiveTransferPlanCell'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Attributes: 'Value'
+        Column: 'ArchiveTransferPlanColumn'
+        Row: 'ArchiveTransferPlanRow'
+        Taborder: 0
+      ]
+    }
+    Component MatrixEditorRowsArchiveTransferPlan
+    {
+      #keys: '[414996.1.183850521]'
+      BaseType: 'WebMatrixEditorHeaderLevel'
+      Children:
+      [
+        Component DataExtractor568
+        {
+          #keys: '[414996.1.183850522]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'Archive'
+            Source: 'Archive'
+            Taborder: 0
+            Transformation: 'ArchiveTransferPlanRow'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Legend: 'Name'
+        SortCriteria: 'SourceStockpoingPointID;TargetStockpoingPointID;ProductID'
+        Taborder: 1
+      ]
+    }
+    Component MatrixEditorColumnsArchiveTransferPlan
+    {
+      #keys: '[414996.1.183850525]'
+      BaseType: 'WebMatrixEditorHeaderLevel'
+      Children:
+      [
+        Component DataExtractor802
+        {
+          #keys: '[414996.1.183850526]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'Archive'
+            Source: 'Archive'
+            Taborder: 0
+            Transformation: 'ArchiveTransferPlanColumn'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Legend: 'ColumnName'
+        SortCriteria: 'ColumnDate'
+        Taborder: 2
+      ]
+    }
+    #child: matrixEditorActionBarPageArchiveTransferPlan
+    #child: matrixeditorContextMenuArchiveTransferPlan
+  ]
+  Properties:
+  [
+    Columns: 'MatrixEditorColumnsArchiveTransferPlan'
+    ContextMenu: 'matrixeditorContextMenuArchiveTransferPlan'
+    Rows: 'MatrixEditorRowsArchiveTransferPlan'
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan.def
new file mode 100644
index 0000000..5faab36
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan.def
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+Component PanelArchiveTransferPlan
+{
+  #keys: '[414996.1.183850471]'
+  BaseType: 'WebPanel'
+  Properties:
+  [
+    FixedSize: true
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan515.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan515.def
new file mode 100644
index 0000000..7347773
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_PanelArchiveTransferPlan515.def
@@ -0,0 +1,14 @@
+Quintiq file version 2.0
+Component PanelArchiveTransferPlan515
+{
+  #keys: '[414996.1.183850483]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    #child: MatrixEditorArchiveTransferPlan
+  ]
+  Properties:
+  [
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixEditorActionBarPageArchiveTransferPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixEditorActionBarPageArchiveTransferPlan.def
new file mode 100644
index 0000000..45d88f8
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixEditorActionBarPageArchiveTransferPlan.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component matrixEditorActionBarPageArchiveTransferPlan
+{
+  #keys: '[414996.1.183850529]'
+  BaseType: 'matrixEditorActionBarPage'
+  Properties:
+  [
+    Taborder: 3
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixeditorContextMenuArchiveTransferPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixeditorContextMenuArchiveTransferPlan.def
new file mode 100644
index 0000000..49019ea
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/Component_matrixeditorContextMenuArchiveTransferPlan.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component matrixeditorContextMenuArchiveTransferPlan
+{
+  #keys: '[414996.1.183850532]'
+  BaseType: 'matrixeditorContextMenu'
+  Properties:
+  [
+    Taborder: 4
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/_ROOT_Component_FormArchiveTransferPlan.def b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/_ROOT_Component_FormArchiveTransferPlan.def
new file mode 100644
index 0000000..4e5be49
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormArchiveTransferPlan/_ROOT_Component_FormArchiveTransferPlan.def
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#root
+#parent: MacroPlannerWebApp
+OrphanComponent FormArchiveTransferPlan
+{
+  #keys: '[414996.1.183850405]'
+  BaseType: 'WebForm'
+  Children:
+  [
+    #child: PanelArchiveTransferPlan
+    #child: PanelArchiveTransferPlan515
+  ]
+  Properties:
+  [
+    Title: 'Archive Transfer Plan'
+  ]
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormAssemblyOnlinePlanVersion/Component_MatrixEditorTable\043384.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormAssemblyOnlinePlanVersion/Component_MatrixEditorTable\043384.def"
index 3dacaf1..02e669b 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormAssemblyOnlinePlanVersion/Component_MatrixEditorTable\043384.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormAssemblyOnlinePlanVersion/Component_MatrixEditorTable\043384.def"
@@ -77,7 +77,7 @@
           [
             DataType: 'InterfaceDataset'
             FilterArguments: 'search:QMacroPlanner::FormAssemblyOnlinePlanVersion.dhSearch'
-            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and object.StartDate() >= search.StartDate() and object.StartDate() <= search.EndDate()'
+            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and  ( search.StartDate().IsMinInfinity() or object.StartDate() >= search.StartDate() ) and ( search.EndDate().IsMaxInfinity() or object.StartDate() <= search.EndDate() )'
             Source: 'InterfaceDataset'
             Taborder: 0
             Transformation: 'AssemblyOnlinePlanVersion.Column'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_MatrixEditorTable.def b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_MatrixEditorTable.def
index e2c57d0..f6b9390 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_MatrixEditorTable.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_MatrixEditorTable.def
@@ -77,7 +77,7 @@
           [
             DataType: 'InterfaceDataset'
             FilterArguments: 'search:QMacroPlanner::FormCustomerDemandPPAIDS.dhSearch'
-            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and object.StartDate() >= search.StartDate() and object.StartDate() <= search.EndDate()'
+            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and ( search.StartDate().IsMinInfinity() or object.StartDate() >= search.StartDate() ) and ( search.EndDate().IsMaxInfinity() or object.StartDate() <= search.EndDate() )'
             Source: 'InterfaceDataset'
             Taborder: 0
             Transformation: 'CustomerDemandIDS.Column'
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelHeader.def b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelHeader.def
index ac63393..380c727 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelHeader.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelHeader.def
@@ -15,6 +15,7 @@
   ]
   Properties:
   [
+    FixedSize: true
     Orientation: 'horizontal'
     Taborder: 1
   ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelProduct.def b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelProduct.def
index b932d01..a8679fc 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelProduct.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Component_PanelProduct.def
@@ -13,6 +13,7 @@
       [
         FixedSize: false
         Label: 'Product'
+        Sorting: 'none'
         Taborder: 0
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Response_OnCreated.def
index e7d653c..d90d27b 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCustomerDemandPPAIDS/Response_OnCreated.def
@@ -10,9 +10,9 @@
     Body:
     [*
       //鍒濆鍖� 
-      CustomerDemandIDS::GenerateData( InterfaceDataset, RecycleBin, Archive );
+      //CustomerDemandIDS::GenerateData( InterfaceDataset, RecycleBin, Archive );
       
-      dhSearch.Data( InterfaceDataset.CustomerDemandIDSSearch() );
+      //dhSearch.Data( InterfaceDataset.CustomerDemandIDSSearch() );
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_bRefresh_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_bRefresh_OnClick.def
index 6b29c26..a47aeb3 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_bRefresh_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_bRefresh_OnClick.def
@@ -14,7 +14,7 @@
     Body:
     [*
       FinancialProductionSource::Initialize( MacroPlan );
-      excelsource               := selectobject( MacroPlan, FinancialProductionSource, excelsource, excelsource.IsImport() );
+      excelsource               := maxobject( MacroPlan, FinancialProductionSource, excelsource, excelsource.IsImport(), excelsource.UploadDateTime() );
       if( not isnull( excelsource ) ){
         excelsource.AfterImport();
       }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_bRefresh_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_bRefresh_OnClick.def
index 0182c4e..b42d5d3 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_bRefresh_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_bRefresh_OnClick.def
@@ -14,7 +14,7 @@
     Body:
     [*
       FinancialSalesSource::InitializeNew( MacroPlan );
-      excelsource               := selectobject( MacroPlan, FinancialSalesSource, excelsource, excelsource.IsImport() );
+      excelsource               := maxobject( MacroPlan, FinancialSalesSource, excelsource, excelsource.IsImport(), excelsource.UploadDateTime() );
       if( not isnull( excelsource ) ){
         excelsource.AfterImport();
       }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_ListLockPeriod.def b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_ListLockPeriod.def
index 4308ad7..2ea65a5 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_ListLockPeriod.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_ListLockPeriod.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductInStockingPoint_MP.ProductID","title":"ProductID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductInStockingPoint_MP.ProductID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductInStockingPoint_MP.StockingPointID","title":"StockingPointID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductInStockingPoint_MP.StockingPointID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"LockDate","title":"LockDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"LockDate"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductInStockingPoint_MP.ProductID","title":"ProductID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductInStockingPoint_MP.ProductID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductInStockingPoint_MP.StockingPointID","title":"StockingPointID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductInStockingPoint_MP.StockingPointID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"LockDate","title":"LockDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"LockDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsEnable","title":"IsEnable","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsEnable"}}]'
         ContextMenu: 'listContextMenuLockPeriod'
         Taborder: 2
       ]
@@ -38,4 +38,22 @@
   [
     Taborder: 0
   ]
+  ResponseDefinitions:
+  [
+    DelegatedResponseDefinition OnClick id:Responsedef_ListLockPeriod_WebMenu_OnClick
+    {
+      #keys: '[414996.1.185430534]'
+      Initiator: 'WebMenu'
+      IsInherited: false
+      ResponseType: 'OnClick'
+      Arguments:
+      [
+        ResponseDefinitionArgument selection
+        {
+          #keys: '[345.0.11072389]'
+          Binding: 'this.Selection()'
+        }
+      ]
+    }
+  ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_listContextMenuLockPeriod.def b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_listContextMenuLockPeriod.def
index f2db74c..8e57ed9 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_listContextMenuLockPeriod.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Component_listContextMenuLockPeriod.def
@@ -3,6 +3,31 @@
 {
   #keys: '[414996.1.179381094]'
   BaseType: 'listContextMenu'
+  Children:
+  [
+    Component mDisable
+    {
+      #keys: '[414996.1.185701729]'
+      BaseType: 'WebMenu'
+      Properties:
+      [
+        Image: 'EMPTYCHECKBOX'
+        Taborder: 3
+        Title: 'Disable'
+      ]
+    }
+    Component mEnable
+    {
+      #keys: '[414996.1.184360918]'
+      BaseType: 'WebMenu'
+      Properties:
+      [
+        Image: 'CHECKEDCHECKBOX'
+        Taborder: 4
+        Title: 'Enable'
+      ]
+    }
+  ]
   Properties:
   [
     Taborder: 0
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mDisable_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mDisable_OnClick.def
new file mode 100644
index 0000000..1d08608
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mDisable_OnClick.def
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: ListLockPeriod
+Response OnClick (
+  structured[LockPeriod] selection
+) id:Response_ListLockPeriod_mDisable_OnClick
+{
+  #keys: '[414996.1.185430554]'
+  CanBindMultiple: false
+  DefinitionID => /ListLockPeriod/Responsedef_ListLockPeriod_WebMenu_OnClick
+  GroupServerCalls: true
+  Initiator: 'mDisable'
+  QuillAction
+  {
+    Body:
+    [*
+      traverse( selection,Elements,element ,element.IsEnable() ){
+        element.Disable(); 
+      }
+    *]
+  }
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mEnable_OnClick\04321.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mEnable_OnClick\04321.def"
new file mode 100644
index 0000000..c1e9778
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/Response_ListLockPeriod_mEnable_OnClick\04321.def"
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#parent: ListLockPeriod
+Response OnClick (
+  structured[LockPeriod] selection
+) id:Response_ListLockPeriod_mEnable_OnClick
+{
+  #keys: '[414996.1.185400954]'
+  CanBindMultiple: false
+  DefinitionID => /ListLockPeriod/Responsedef_ListLockPeriod_WebMenu_OnClick
+  GroupServerCalls: true
+  Initiator: 'mEnable'
+  QuillAction
+  {
+    Body:
+    [*
+      offlinePlanTable := select( MacroPlan,NewOfflinePlanTable,table,true );
+      traverse( selection,Elements,element ,not element.IsEnable() ){
+        element.Enable( offlinePlanTable ); 
+      }
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/_ROOT_Component_FormLockPeriod.def b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/_ROOT_Component_FormLockPeriod.def
index 7150c91..12ce217 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/_ROOT_Component_FormLockPeriod.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormLockPeriod/_ROOT_Component_FormLockPeriod.def
@@ -10,4 +10,9 @@
     #child: PanelLockPeriod
     #child: PanelLockPeriod633
   ]
+  Properties:
+  [
+    Image: 'GEAR_VIEW'
+    Title: 'Lock period data'
+  ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Component_MatrixEditorTable.def b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Component_MatrixEditorTable.def
index 59c4aeb..b67b8eb 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Component_MatrixEditorTable.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormOfflinePlanArchive/Component_MatrixEditorTable.def
@@ -77,7 +77,7 @@
           [
             DataType: 'InterfaceDataset'
             FilterArguments: 'search:QMacroPlanner::FormAssemblyOnlinePlanVersion.dhSearch'
-            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and object.StartDate() >= search.StartDate() and object.StartDate() <= search.EndDate()'
+            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and  ( search.StartDate().IsMinInfinity() or object.StartDate() >= search.StartDate() )  and ( search.EndDate().IsMaxInfinity() or object.StartDate() <= search.EndDate() )'
             Source: 'InterfaceDataset'
             Taborder: 0
             Transformation: 'OfflinePlanArchiveVersion.Column'
diff --git a/_Main/UI/MacroPlannerWebApp/Views/LockPeriodData.vw b/_Main/UI/MacroPlannerWebApp/Views/LockPeriodData.vw
new file mode 100644
index 0000000..8b88f12
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Views/LockPeriodData.vw
@@ -0,0 +1,199 @@
+Quintiq file version 2.0
+{
+  viewcontents
+  {
+    forms
+    {
+      form_FormLockPeriod
+      {
+        title: 'QMacroPlanner::FormLockPeriod'
+        shown: true
+        componentID: 'QMacroPlanner::FormLockPeriod'
+        layout
+        {
+          mode: 'open'
+          rowPosition: 1
+          rowSpan: 22
+          columnPosition: 1
+          columnSpan: 8
+        }
+        components
+        {
+          FormLockPeriod_PanelLockPeriod
+          {
+            sizeRatio: 1
+          }
+          FormLockPeriod_PanelLockPeriod633
+          {
+            sizeRatio: 1
+          }
+          FormLockPeriod_ListLockPeriod
+          {
+          }
+          FormLockPeriod_DataSetLevelLockPeriod
+          {
+            groupDepth: -1
+            column_ProductInStockingPoint_MP_ProductID
+            {
+              columnId: 'ProductInStockingPoint_MP.ProductID'
+              dataPath: 'ProductInStockingPoint_MP.ProductID'
+              dataType: 'string'
+              index: 0
+              subtotals: ''
+              width: 150
+            }
+            column_ProductInStockingPoint_MP_StockingPointID
+            {
+              columnId: 'ProductInStockingPoint_MP.StockingPointID'
+              dataPath: 'ProductInStockingPoint_MP.StockingPointID'
+              dataType: 'string'
+              index: 1
+              subtotals: ''
+              width: 150
+            }
+            column_LockDate
+            {
+              columnId: 'LockDate'
+              dataPath: 'LockDate'
+              dataType: 'date'
+              index: 2
+              subtotals: ''
+              width: 150
+            }
+            column_IsEnable
+            {
+              columnId: 'IsEnable'
+              dataPath: 'IsEnable'
+              dataType: 'boolean'
+              index: 3
+              subtotals: ''
+              width: 150
+            }
+          }
+        }
+      }
+      form_FormOptimizerPuzzles
+      {
+        title: 'Optimizer Puzzles'
+        shown: false
+        componentID: 'FormOptimizerPuzzles'
+        layout
+        {
+          mode: 'dockright'
+          index: 0
+        }
+        components
+        {
+          FormOptimizerPuzzles_ListOptimizerPuzzles
+          {
+          }
+          FormOptimizerPuzzles_DataSetLevelOptimizerPuzzles
+          {
+            groupDepth: -1
+            column_All_constraints
+            {
+              columnId: 'All constraints'
+              dataPath: 'All constraints'
+              dataType: 'string'
+              title: 'All constraints'
+              index: 0
+              subtotals: ''
+              width: 32
+            }
+            column_Name
+            {
+              columnId: 'Name'
+              dataPath: 'Name'
+              dataType: 'string'
+              title: 'Name'
+              index: 1
+              subtotals: ''
+              width: 109
+            }
+            column_Description
+            {
+              columnId: 'Description'
+              dataPath: 'Description'
+              dataType: 'string'
+              title: 'Description'
+              index: 2
+              subtotals: ''
+              width: 207
+            }
+          }
+        }
+      }
+      form_FormKPI
+      {
+        title: 'KPI Dashboard'
+        shown: true
+        componentID: 'FormKPI'
+        layout
+        {
+          mode: 'dockright'
+          index: 1
+        }
+        components
+        {
+          FormKPI_PanelKPI
+          {
+            sizeRatio: 1
+            activeChild: 'PanelKPISelection'
+          }
+          FormKPI_PanelKPIDashboard
+          {
+            sizeRatio: 1
+          }
+          FormKPI_PanelKPISelection
+          {
+            sizeRatio: 1
+          }
+          FormKPI_ListKPISelection
+          {
+            QuillViewData
+            {
+              Food_KPISetting: 'Cost of sales;Fulfillment;Fulfillment target;Inventory holding cost;Labor cost;Margin;Safety stock;Sales;Sourcing cost;Total CO2 emission;Transportation cost;Volume'
+            }
+          }
+          FormKPI_DataSetLevelKPISelection
+          {
+            groupDepth: -1
+            column_All_constraints
+            {
+              columnId: 'All constraints'
+              dataPath: 'All constraints'
+              dataType: 'string'
+              title: 'All constraints'
+              index: 0
+              subtotals: ''
+              width: 32
+            }
+            column_Name
+            {
+              columnId: 'Name'
+              dataPath: 'Name'
+              dataType: 'string'
+              title: 'Name'
+              index: 1
+              subtotals: ''
+              width: 200
+            }
+          }
+        }
+      }
+    }
+    userconfigurableinformation
+    {
+    }
+    image: 'GEAR_VIEW'
+    page: ''
+    group: ''
+    index: 0
+    description: ''
+  }
+  formatversion: 2
+  id: 'LockPeriodData'
+  name: 'LockPeriodData'
+  isglobal: false
+  isroot: true
+}

--
Gitblit v1.9.3