From b60cce908431c22002554b1a23e5621d12cddedf Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 21 八月 2024 21:10:14 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg

---
 _Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl                                                                 |  119 +++++++++++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_OnOK.def                                 |    9 
 _Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl                                                          |   36 +++
 _Main/BL/Type_DispatchShiftPlan/_ROOT_Type_DispatchShiftPlan.qbl                                                   |   10 +
 _Main/BL/Type_DispatchShiftPlan/Attribute_ProductLine.qbl                                                          |    8 
 _Main/BL/Relations/Relation_ShiftDayTime_ShiftPattern_ShiftPattern_ShiftDayTime.qbl                                |   23 ++
 _Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_ListSalesDemands.def                                 |   14 +
 _Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelAllSalesDemands.def                             |    8 
 _Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl                                                          |    8 
 _Main/BL/Type_DispatchShiftPlan/TypeIndex_IDTypeIndex.qbl                                                          |   12 +
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_New.def                                  |    8 
 _Main/BL/Type_DispatchShiftPlan/Attribute_ShiftDate.qbl                                                            |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlContent_npPercentage_OnCreated.def |    2 
 _Main/UI/MacroPlannerWebApp/Views/Time_Capacities.vw                                                               |   92 ++++----
 _Main/BL/Type_DispatchShiftPlan/Attribute_InterfaceTime.qbl                                                        |    8 
 _Main/BL/Type_DispatchShiftPlan/Attribute_Tips.qbl                                                                 |    8 
 _Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl                                                            |    2 
 _Main/BL/Type_DispatchShiftPlan/Attribute_Fac.qbl                                                                  |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Response_pnlActions_btnOk_OnClick.def           |    5 
 _Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Response_ListShiftDayTime_mNew_OnClick.def                  |    6 
 _Main/BL/Type_DispatchShiftPlan/Attribute_FactoryName.qbl                                                          |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlActions_btnOk_OnClick.def          |    8 
 _Main/BL/Type_ShiftDayTime/StaticMethod_EditData.qbl                                                               |   17 +
 _Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Component_ListShiftDayTime.def                              |    6 
 _Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl                                                               |   17 +
 /dev/null                                                                                                          |   23 --
 _Main/BL/Relations/Relation_DispatchShiftPlan_RecycleBin_RecycleBin_DispatchShiftPlan.qbl                          |   23 ++
 _Main/UI/MacroPlannerWebApp/Component_FormForecasts/_ROOT_Component_FormForecasts.def                              |   10 +
 _Main/BL/Type_DispatchShiftPlan/Attribute_VersionName.qbl                                                          |    8 
 _Main/BL/Type_DispatchShiftPlan/Attribute_ID.qbl                                                                   |    8 
 _Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl                                                  |    4 
 _Main/BL/Type_ShiftDayTime/StaticMethod_CreateData.qbl                                                             |   18 +
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Component_pnlContent.def                       |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelSalesDemands.def                                |    8 
 34 files changed, 460 insertions(+), 96 deletions(-)

diff --git a/_Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl b/_Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl
new file mode 100644
index 0000000..3e006d1
--- /dev/null
+++ b/_Main/BL/EDI/Broker_RB_DispatchShiftPlanBroker.qbl
@@ -0,0 +1,119 @@
+Quintiq file version 2.0
+#parent: #root
+EDIBroker RB_DispatchShiftPlanBroker
+{
+  MDSDefinition: RecycleBin
+  TimeZone: 'ACT'
+  UseOSTimeZone: false
+  EDIModelLink.Source DispatchShiftPlanSource
+  {
+    EDIMLTable DispatchShiftPlan
+    {
+      TargetType: DispatchShiftPlan
+      EDIMLColumn Fac { Attribute: Fac ValueType: String }
+      EDIMLColumn FactoryName { Attribute: FactoryName ValueType: String }
+      EDIMLColumn ID { Attribute: ID ValueType: String }
+      EDIMLColumn InterfaceTime { Attribute: InterfaceTime ValueType: DateTime }
+      EDIMLColumn ProductLine { Attribute: ProductLine ValueType: String }
+      EDIMLColumn ShiftDate { Attribute: ShiftDate ValueType: Date }
+      EDIMLColumn Tips { Attribute: Tips ValueType: String }
+      EDIMLColumn VersionFlag { Attribute: VersionFlag ValueType: String }
+      EDIMLColumn VersionName { Attribute: VersionName ValueType: String }
+    }
+  }
+  EDIODBCLink.Destination DispatchShiftPlanDestination
+  {
+    DataIntegrityStrategy: 'Disabled'
+    SettingsEngineLink: 'domainmodel.ediremotedatasourcedefinition.remotestorage.vwed'
+    EDIODBCLinkTable A_DispatchShiftPlan
+    {
+      MayCreateTable: true
+      MayDeleteRow: true
+      MayDropTable: true
+      MayFlushTable: true
+      MayInsertRow: true
+      Parameters: '/owner="dbo"'
+      PrimaryKeyColumns: ID
+      RecordModificationHintStrategy: 'None'
+      EDIODBCLinkColumn Fac
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn FactoryName
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn ID
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn InterfaceTime
+      {
+        MayUpdateColumn: true
+        ValueType: DateTime
+      }
+      EDIODBCLinkColumn ProductLine
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn ShiftDate
+      {
+        MayUpdateColumn: true
+        ValueType: DateTime
+      }
+      EDIODBCLinkColumn Tips
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn VersionFlag
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+      EDIODBCLinkColumn VersionName
+      {
+        MayUpdateColumn: true
+        ValueType: String
+      }
+    }
+  }
+  EDITransformation.Transformation DispatchShiftPlanTransformation
+  {
+    EDITableTransformation
+    {
+      InputTable: DispatchShiftPlan
+      OutputTable: A_DispatchShiftPlan
+      EDIColumnMatch { InputColumn: Fac OutputColumn: Fac }
+      EDIColumnMatch { InputColumn: FactoryName OutputColumn: FactoryName }
+      EDIColumnMatch { InputColumn: ID OutputColumn: ID }
+      EDIColumnMatch { InputColumn: InterfaceTime OutputColumn: InterfaceTime }
+      EDIColumnMatch { InputColumn: ProductLine OutputColumn: ProductLine }
+      EDIColumnMatch
+      {
+        InputColumn: ShiftDate
+        OutputColumn: ShiftDate
+        Converter
+        {
+          XMLDefinition:
+          [*
+            <?xml version="1.0" encoding="UTF-16"?>
+            <DateToDateTime xmlns="http://www.quintiq.com/GEB/DateToDateTime" Key="@1">
+              <IsStandard>true</IsStandard>
+              <IsISO>false</IsISO>
+              <IsCustom>false</IsCustom>
+              <ConversionType>0</ConversionType>
+            </DateToDateTime>
+          *]
+        }
+      }
+      EDIColumnMatch { InputColumn: Tips OutputColumn: Tips }
+      EDIColumnMatch { InputColumn: VersionFlag OutputColumn: VersionFlag }
+      EDIColumnMatch { InputColumn: VersionName OutputColumn: VersionName }
+    }
+  }
+}
diff --git a/_Main/BL/Relations/Relation_DispatchShiftPlan_RecycleBin_RecycleBin_DispatchShiftPlan.qbl b/_Main/BL/Relations/Relation_DispatchShiftPlan_RecycleBin_RecycleBin_DispatchShiftPlan.qbl
new file mode 100644
index 0000000..37b7f50
--- /dev/null
+++ b/_Main/BL/Relations/Relation_DispatchShiftPlan_RecycleBin_RecycleBin_DispatchShiftPlan.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation DispatchShiftPlan_RecycleBin_RecycleBin_DispatchShiftPlan
+{
+  #keys: '1[414996.1.17706936]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide RecycleBin
+  {
+    #keys: '3[414996.1.17706938][414996.1.17706937][414996.1.17706939]'
+    Cardinality: '0to1'
+    ObjectDefinition: DispatchShiftPlan
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide DispatchShiftPlan
+  {
+    #keys: '3[414996.1.17706941][414996.1.17706940][414996.1.17706942]'
+    Cardinality: '1toN'
+    ObjectDefinition: RecycleBin
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_ShiftDayTime_ShiftDay_ShiftDay_ShiftDayTime.qbl b/_Main/BL/Relations/Relation_ShiftDayTime_ShiftDay_ShiftDay_ShiftDayTime.qbl
deleted file mode 100644
index cd9cd96..0000000
--- a/_Main/BL/Relations/Relation_ShiftDayTime_ShiftDay_ShiftDay_ShiftDayTime.qbl
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Relation ShiftDayTime_ShiftDay_ShiftDay_ShiftDayTime
-{
-  #keys: '1[413988.0.1371171483]'
-  DefaultRelationStrategy
-  {
-  }
-  RelationSide.LeftSide ShiftDay
-  {
-    #keys: '3[413988.0.1371171485][413988.0.1371171484][413988.0.1371171486]'
-    Cardinality: '0to1'
-    ObjectDefinition: ShiftDayTime
-    OwningSide: 'Reference'
-  }
-  RelationSide.RightSide ShiftDayTime
-  {
-    #keys: '3[413988.0.1371171488][413988.0.1371171487][413988.0.1371171489]'
-    Cardinality: '1toN'
-    ObjectDefinition: ShiftDay
-    OwningSide: 'Owned'
-  }
-}
diff --git a/_Main/BL/Relations/Relation_ShiftDayTime_ShiftPattern_ShiftPattern_ShiftDayTime.qbl b/_Main/BL/Relations/Relation_ShiftDayTime_ShiftPattern_ShiftPattern_ShiftDayTime.qbl
new file mode 100644
index 0000000..2fc800d
--- /dev/null
+++ b/_Main/BL/Relations/Relation_ShiftDayTime_ShiftPattern_ShiftPattern_ShiftDayTime.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation ShiftDayTime_ShiftPattern_ShiftPattern_ShiftDayTime
+{
+  #keys: '1[415754.0.123915968]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide ShiftPattern
+  {
+    #keys: '3[415754.0.123915970][415754.0.123915969][415754.0.123915971]'
+    Cardinality: '0to1'
+    ObjectDefinition: ShiftDayTime
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide ShiftDayTime
+  {
+    #keys: '3[415754.0.123915973][415754.0.123915972][415754.0.123915974]'
+    Cardinality: '1toN'
+    ObjectDefinition: ShiftPattern
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl b/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
index a24173c..0b65024 100644
--- a/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
+++ b/_Main/BL/Type_Archive/StaticMethod_GenerateForecast.qbl
@@ -11,7 +11,7 @@
       f.Delete();
     }
     
-    traverse ( archiveExecutionStatus, TemporaryDemandData, tdd ,tdd.StartDate() >= macroPlan.StartOfPlanning().Date()) {
+    traverse ( archiveExecutionStatus, TemporaryDemandData, tdd ,tdd.Origin() = "" or tdd.StartDate() >= macroPlan.StartOfPlanning().Date()) {
       targetProduct_MP       := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = tdd.ProductID() );
       targetStockingPoint_MP := select( macroPlan, StockingPoint_MP, tempSPMP, tempSPMP.ID() = tdd.StockingPointID() );
       info( tdd.SalesSegmentName() );
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_Fac.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_Fac.qbl
new file mode 100644
index 0000000..65d0636
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_Fac.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Fac
+{
+  #keys: '3[414996.1.17706904][414996.1.17706903][414996.1.17706905]'
+  Description: '宸ュ巶绠�鍐�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_FactoryName.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_FactoryName.qbl
new file mode 100644
index 0000000..a4bee3b
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_FactoryName.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute FactoryName
+{
+  #keys: '3[414996.1.17706894][414996.1.17706893][414996.1.17706895]'
+  Description: '宸ュ巶鍚嶇О'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_ID.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_ID.qbl
new file mode 100644
index 0000000..1c70718
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_ID.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ID
+{
+  #keys: '3[414996.1.17710059][414996.1.17710058][414996.1.17710060]'
+  IsReadOnly: true
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_InterfaceTime.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_InterfaceTime.qbl
new file mode 100644
index 0000000..7c56e26
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_InterfaceTime.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute InterfaceTime
+{
+  #keys: '3[414996.1.17706914][414996.1.17706913][414996.1.17706915]'
+  Description: '涓嬪彂鏃堕棿'
+  ValueType: DateTime
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_ProductLine.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_ProductLine.qbl
new file mode 100644
index 0000000..446e53f
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_ProductLine.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ProductLine
+{
+  #keys: '3[414996.1.17706957][414996.1.17706956][414996.1.17706958]'
+  Description: '浜х嚎'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_ShiftDate.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_ShiftDate.qbl
new file mode 100644
index 0000000..4d0b8f8
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_ShiftDate.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ShiftDate
+{
+  #keys: '3[414996.1.17706855][414996.1.17706854][414996.1.17706856]'
+  Description: '鐝鏃ユ湡'
+  ValueType: Date
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_Tips.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_Tips.qbl
new file mode 100644
index 0000000..c180089
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_Tips.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Tips
+{
+  #keys: '3[414996.1.17706865][414996.1.17706864][414996.1.17706866]'
+  Description: '澶囨敞'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl
new file mode 100644
index 0000000..047acd8
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionFlag.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute VersionFlag
+{
+  #keys: '3[414996.1.17706927][414996.1.17706926][414996.1.17706928]'
+  Description: '鐗堟湰鏍囪瘑'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionName.qbl b/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionName.qbl
new file mode 100644
index 0000000..7fc4ab5
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Attribute_VersionName.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute VersionName
+{
+  #keys: '3[414996.1.17706875][414996.1.17706874][414996.1.17706876]'
+  Description: '鐗堟湰鍚嶇О'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl b/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl
new file mode 100644
index 0000000..a20b0a3
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/Function_CalcFac.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcFac
+{
+  TextBody:
+  [*
+    // Akari Aug-21-2024 (created)
+    value := "";
+    if( this.FactoryName() = "澶ц繛宸ュ巶" ){
+      value := "DL";
+    }else if( this.FactoryName() = "闀挎槬宸ュ巶"){
+      value := "CC";
+    }
+    
+    this.Fac( value );
+  *]
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
new file mode 100644
index 0000000..cbf8db1
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/StaticMethod_Dispatch.qbl
@@ -0,0 +1,36 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Dispatch (
+  const MacroPlan macroPlan,
+  RecycleBin owner
+)
+{
+  TextBody:
+  [*
+    // Akari Aug-21-2024 (created)
+    now := DateTime::Now();
+    macroPlanName := macroPlan.MDSMacroPlan().Description();
+    traverse( macroPlan,Unit.UnitPeriod.astype( UnitPeriodTime ).ShiftPlan,shiftPlan ){
+       factory := shiftPlan.UnitPeriodTime().Unit();
+       while( factory.HasParent() ){
+         temp1 := factory;
+         factory := factory.Parent();
+         if( not factory.HasParent() ){
+           factory := temp1;
+         }
+       }
+      
+       owner.DispatchShiftPlan( relnew,ID := OS::GenerateGUIDAsString(),
+                                ProductLine := shiftPlan.UnitPeriodTime().Unit().ID(),
+                                ShiftDate := shiftPlan.UnitPeriodTime().Period_MP().StartDate(),
+                                Tips := shiftPlan.Remark(),
+                                VersionName := macroPlanName,
+                                FactoryName := factory.ID(),
+                                InterfaceTime := now
+                                );
+                                
+    }
+    
+    owner.RB_DispatchShiftPlanBroker().AsyncExecute();
+  *]
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/TypeIndex_IDTypeIndex.qbl b/_Main/BL/Type_DispatchShiftPlan/TypeIndex_IDTypeIndex.qbl
new file mode 100644
index 0000000..18969ed
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/TypeIndex_IDTypeIndex.qbl
@@ -0,0 +1,12 @@
+Quintiq file version 2.0
+#parent: #root
+TypeIndex IDTypeIndex
+{
+  Attributes:
+  [
+    TypeIndexAttribute
+    {
+      ModelElement: ID
+    }
+  ]
+}
diff --git a/_Main/BL/Type_DispatchShiftPlan/_ROOT_Type_DispatchShiftPlan.qbl b/_Main/BL/Type_DispatchShiftPlan/_ROOT_Type_DispatchShiftPlan.qbl
new file mode 100644
index 0000000..2986864
--- /dev/null
+++ b/_Main/BL/Type_DispatchShiftPlan/_ROOT_Type_DispatchShiftPlan.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type DispatchShiftPlan
+{
+  #keys: '5[414996.1.17706851][414996.1.17706849][0.0.0][414996.1.17706850][414996.1.17706852]'
+  BaseType: Object
+  Description: '涓嬪彂鐝淇℃伅'
+  StructuredName: 'DispatchShiftPlans'
+}
diff --git a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
index e21f43c..fd28df5 100644
--- a/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
+++ b/_Main/BL/Type_OfflinePlanCell/StaticMethod_RefreshOfflinePlan.qbl
@@ -106,7 +106,7 @@
       traverse ( shiftStartDateOPRs, Elements, ssdOPR ) {
         shift := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = ssdOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1" ); 
         if ( not isnull( shift ) ) {
-          startDate     := guard( minselect( macroPlan, ShiftPattern.ShiftDay.ShiftDayTime, tempSDT, tempSDT.ShiftDay().ShiftPatternName() = shift.Shift(), tempSDT.Sequence() ).StartDateTime().Format( "H:m" ), "" );
+          startDate     := guard( minselect( macroPlan, ShiftPattern.ShiftDayTime, tempSDT, tempSDT.ShiftPattern().Name() = shift.Shift(), tempSDT.Sequence() ).StartDateTime().Format( "H:m" ), "" );
           startDateCell := opc.OfflinePlanCell( relnew, Value := startDate );
           startDateCell.OfflinePlanRow( relset, ssdOPR );
         }
@@ -115,7 +115,7 @@
       traverse ( shiftEndDateOPRs, Elements, sedOPR ) {
         shift := select( opc, OfflinePlanCell, tempOPC, tempOPC.OfflinePlanRow().ProductionLine() = sedOPR.ProductionLine() and tempOPC.OfflinePlanRow().Type() = "1" ); 
         if ( not isnull( shift ) ) {
-          endDate     := guard( maxselect( macroPlan, ShiftPattern.ShiftDay.ShiftDayTime, tempSDT, tempSDT.ShiftDay().ShiftPatternName() = shift.Shift(), tempSDT.Sequence() ).EndDateTIme().Format( "H:m" ), "" );
+          endDate     := guard( maxselect( macroPlan, ShiftPattern.ShiftDayTime, tempSDT, tempSDT.ShiftPattern().Name() = shift.Shift(), tempSDT.Sequence() ).EndDateTIme().Format( "H:m" ), "" );
           endDateCell := opc.OfflinePlanCell( relnew, Value := endDate );
           endDateCell.OfflinePlanRow( relset, sedOPR );
         }
diff --git a/_Main/BL/Type_ShiftDayTime/StaticMethod_CreateData.qbl b/_Main/BL/Type_ShiftDayTime/StaticMethod_CreateData.qbl
new file mode 100644
index 0000000..47ebc25
--- /dev/null
+++ b/_Main/BL/Type_ShiftDayTime/StaticMethod_CreateData.qbl
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CreateData (
+  MacroPlan macroPlan,
+  DateTime startDateTime,
+  DateTime endDateTime,
+  String name
+)
+{
+  TextBody:
+  [*
+    sp := select( macroPlan, ShiftPattern, tempSP, tempSP.Name() = name );
+    sp.ShiftDayTime( relnew, 
+                     StartDateTime := startDateTime,
+                     EndDateTIme   := endDateTime,
+                     Name          := name );
+  *]
+}
diff --git a/_Main/BL/Type_ShiftDayTime/StaticMethod_EditData.qbl b/_Main/BL/Type_ShiftDayTime/StaticMethod_EditData.qbl
new file mode 100644
index 0000000..60bacbd
--- /dev/null
+++ b/_Main/BL/Type_ShiftDayTime/StaticMethod_EditData.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod EditData (
+  MacroPlan macroPlan,
+  ShiftDayTime sdt,
+  DateTime startDateTime,
+  DateTime endDateTime,
+  String name
+)
+{
+  TextBody:
+  [*
+    sdt.Delete();
+    
+    ShiftDayTime::CreateData( macroPlan, startDateTime, endDateTime, name );
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_New.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_New.def
index f2f1b4b..7a4b21a 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_New.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_New.def
@@ -1,16 +1,10 @@
 Quintiq file version 2.0
 #parent: #root
-Method New (
-  ShiftDay selection
-) id:Method_DialogCreateEditShiftDayTime_New
+Method New () id:Method_DialogCreateEditShiftDayTime_New
 {
   #keys: '[413988.0.1372696375]'
   Body:
   [*
-    data := selection.ShiftDayTime( relnew );
-    
-    DataHolderDialogData.Data( data );
-    
     ApplicationMacroPlanner.ShowFormModal( this );
   *]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_OnOK.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_OnOK.def
index 5d5f39e..68ce532 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_OnOK.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Method_OnOK.def
@@ -6,7 +6,14 @@
   Body:
   [*
     // On ok
-    Form.ApplyChanges();
+    
+    if ( isnull( DataHolderDialogData.Data() ) ) {
+      ShiftDayTime::CreateData( MacroPlan, dtsStart.DateTime(),
+                                dtsEnd.DateTime(), ddslName.Text() );
+    } else {
+      ShiftDayTime::EditData( MacroPlan, DataHolderDialogData.Data(), dtsStart.DateTime(),
+                                dtsEnd.DateTime(), ddslName.Text() );
+    }
     
     Form.Close();
   *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Response_pnlActions_btnOk_OnClick.def
index ae0d49e..201d7bd 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditShiftDayTime/Response_pnlActions_btnOk_OnClick.def
@@ -4,13 +4,12 @@
 {
   #keys: '[413988.0.1372501452]'
   DefinitionID: 'Responsedef_WebButton_OnClick'
-  GroupServerCalls: true
   QuillAction
   {
     Body:
     [*
-      Form.ApplyChanges();
-      Form.Close();
+      Form.OnOK();
     *]
+    GroupServerCalls: false
   }
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Component_pnlContent.def
index b421616..a63289d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Component_pnlContent.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Component_pnlContent.def
@@ -62,8 +62,8 @@
       [
         DataBinding: 'dhDialogData.Data.Percentage'
         Label: 'Percentage'
-        Max: '100'
-        Min: '0'
+        Max: '99'
+        Min: '1'
         Taborder: 3
       ]
     }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlActions_btnOk_OnClick.def
index 2efb364..d855b10 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlActions_btnOk_OnClick.def
@@ -13,8 +13,12 @@
   {
     Body:
     [*
-      Form.OnOK();
-      Form.Close();
+      if( WebMessageBox::Warning( Form, "鏄惁纭鐢熸垚宸ヨ壓璺嚎锛�",Translations::MessageBox_OKCancel() ,true ) = 0 ){
+        Form.OnOK();
+        Form.Close(); 
+      }else{
+        Form.Close(); 
+      }
     *]
   }
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlContent_npPercentage_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlContent_npPercentage_OnCreated.def
index d36b2e9..96f9151 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlContent_npPercentage_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditUphillRouting/Response_pnlContent_npPercentage_OnCreated.def
@@ -11,7 +11,7 @@
     Body:
     [*
       if( isnull( dhDialogData.Data() )){
-        this.Number( 100 ); 
+        this.Number( 90 ); 
       }
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_ListSalesDemands.def b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_ListSalesDemands.def
new file mode 100644
index 0000000..8fc3953
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_ListSalesDemands.def
@@ -0,0 +1,14 @@
+Quintiq file version 2.0
+Component ListSalesDemands #extension
+{
+  Children:
+  [
+    Component DataSetLevelSalesDemands #extension
+    {
+      Properties:
+      [
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ImgNotLinkedToPeriod","title":"ImgNotLinkedToPeriod","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ImgNotLinkedToPeriod"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ImgIsPostponed","title":"ImgIsPostponed","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ImgIsPostponed"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPoint_MP.ID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPoint_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegment_MP.Name","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegment_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product_MP.ID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Product_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Start","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"End","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasure_MP.Name","title":"Quantity UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"UnitOfMeasure_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Quantity","title":"Original Qty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Quantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"NettedQuantity","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"NettedQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantity","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment Illustration","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfillment","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round(2)"}},{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue(object.NettedQuantity()-object.FulfilledQuantity(),0.0).Round(2)"}}]}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Price","title":"Price","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Price"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PriceUoM","title":"PriceUoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"PriceUoM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Priority.Name","title":"Priority","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Priority.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"DemandUncertaintyPercentage","title":"Uncertainty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"DemandUncertaintyPercentage"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Origin","title":"Origin","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Origin"}}]'
+      ]
+    }
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelAllSalesDemands.def b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelAllSalesDemands.def
new file mode 100644
index 0000000..b6550d1
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelAllSalesDemands.def
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+Component PanelAllSalesDemands #extension
+{
+  Children:
+  [
+    #child: ListSalesDemands
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelSalesDemands.def b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelSalesDemands.def
new file mode 100644
index 0000000..14acdde
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/Component_PanelSalesDemands.def
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+Component PanelSalesDemands #extension
+{
+  Children:
+  [
+    #child: PanelAllSalesDemands
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/_ROOT_Component_FormForecasts.def b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/_ROOT_Component_FormForecasts.def
new file mode 100644
index 0000000..697d046
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormForecasts/_ROOT_Component_FormForecasts.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: LibMacroPlannerWebUI
+OrphanComponent FormForecasts #extension
+{
+  Children:
+  [
+    #child: PanelSalesDemands
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Component_ListShiftDayTime.def b/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Component_ListShiftDayTime.def
index 79e95fe..5788514 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Component_ListShiftDayTime.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Component_ListShiftDayTime.def
@@ -11,10 +11,10 @@
       BaseType: 'WebDataExtractor'
       Properties:
       [
-        DataType: 'ShiftDay'
-        Source: 'ApplicationMacroPlanner.dhSelectedShiftDay'
+        DataType: 'MacroPlan'
+        Source: 'MacroPlan'
         Taborder: 0
-        Transformation: 'ShiftDayTime'
+        Transformation: 'ShiftPattern.ShiftDayTime'
       ]
     }
     #child: listActionBarPageShiftDayTime
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Response_ListShiftDayTime_mNew_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Response_ListShiftDayTime_mNew_OnClick.def
index f4712ac..d0c74a4 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Response_ListShiftDayTime_mNew_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormShiftDayTime/Response_ListShiftDayTime_mNew_OnClick.def
@@ -6,17 +6,13 @@
   CanBindMultiple: false
   DefinitionID => /ListShiftDayTime/Responsedef_ListShiftDayTime_WebMenu_OnClick
   Initiator: 'mNew'
-  Precondition:
-  [*
-    return not isnull( ApplicationMacroPlanner.dhSelectedShiftDay().Data() );
-  *]
   QuillAction
   {
     Body:
     [*
       dlg := construct( DialogCreateEditShiftDayTime );
       
-      dlg.New( ApplicationMacroPlanner.dhSelectedShiftDay().Data() );
+      dlg.New();
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Views/Time_Capacities.vw b/_Main/UI/MacroPlannerWebApp/Views/Time_Capacities.vw
index e91d249..d39df36 100644
--- a/_Main/UI/MacroPlannerWebApp/Views/Time_Capacities.vw
+++ b/_Main/UI/MacroPlannerWebApp/Views/Time_Capacities.vw
@@ -25,52 +25,6 @@
           rowSpan: 15
         }
       }
-      form_FormProductionLineBatchData
-      {
-        title: 'QMacroPlanner::FormProductionLineBatchData'
-        shown: true
-        componentID: 'QMacroPlanner::FormProductionLineBatchData'
-        layout
-        {
-          mode: 'open'
-          rowPosition: 26
-          rowSpan: 9
-          columnPosition: 1
-          columnSpan: 8
-        }
-        components
-        {
-          FormProductionLineBatchData_PanelProductionLineBatchData
-          {
-            sizeRatio: 1
-          }
-          FormProductionLineBatchData_ListProductionLineBatchData
-          {
-          }
-          FormProductionLineBatchData_DataSetLevelProductionLineBatchData
-          {
-            groupDepth: -1
-            column_StartDate
-            {
-              columnId: 'StartDate'
-              dataPath: 'StartDate'
-              dataType: 'date'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_EndDate
-            {
-              columnId: 'EndDate'
-              dataPath: 'EndDate'
-              dataType: 'date'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-          }
-        }
-      }
       form_FormShiftDayTime
       {
         title: 'QMacroPlanner::FormShiftDayTime'
@@ -122,6 +76,52 @@
           }
         }
       }
+      form_FormProductionLineBatchData
+      {
+        title: 'QMacroPlanner::FormProductionLineBatchData'
+        shown: true
+        componentID: 'QMacroPlanner::FormProductionLineBatchData'
+        layout
+        {
+          mode: 'open'
+          rowPosition: 26
+          rowSpan: 9
+          columnPosition: 1
+          columnSpan: 8
+        }
+        components
+        {
+          FormProductionLineBatchData_PanelProductionLineBatchData
+          {
+            sizeRatio: 1
+          }
+          FormProductionLineBatchData_ListProductionLineBatchData
+          {
+          }
+          FormProductionLineBatchData_DataSetLevelProductionLineBatchData
+          {
+            groupDepth: -1
+            column_StartDate
+            {
+              columnId: 'StartDate'
+              dataPath: 'StartDate'
+              dataType: 'date'
+              index: 0
+              subtotals: ''
+              width: 150
+            }
+            column_EndDate
+            {
+              columnId: 'EndDate'
+              dataPath: 'EndDate'
+              dataType: 'date'
+              index: 1
+              subtotals: ''
+              width: 150
+            }
+          }
+        }
+      }
     }
   }
   formatversion: 2

--
Gitblit v1.9.3