From 7e32f3de7e82bb64f1d47f888a90b12193eefb5b Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期二, 03 九月 2024 17:11:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 _Main/BL/Type_CustomerDemandIDSRow/_ROOT_Type_CustomerDemandIDSRow.qbl                                    |   10 +
 _Main/BL/Type_CustomerDemandIDSRow/Attribute_DuplicateValueMarker.qbl                                     |    8 
 _Main/BL/Type_CustomerDemandIDSRow/DefaultValue_DuplicateValueMarker.qbl                                  |    6 
 _Main/BL/Type_CustomerDemandIDSCell/DefaultValue_Value.qbl                                                |    6 
 _Main/BL/Type_CustomerDemandIDSRow/DefaultValue_Name.qbl                                                  |    6 
 _Main/BL/Relations/Relation_CustomerDemandIDS_Row_CustomerDemandIDSRow_CustomerDemandIDS.qbl              |   23 ++
 _Main/BL/Type_CustomerDemandIDS/DefaultValue_Name.qbl                                                     |    6 
 _Main/BL/Type_CustomerDemandIDS/Method_SyncRows.qbl                                                       |   39 ++++
 _Main/BL/Relations/Relation_CustomerDemandIDS_Column_CustomerDemandIDSColumn_CustomerDemandIDS.qbl        |   26 ++
 _Main/BL/Type_CustomerDemandIDS/StaticMethod_ReadStructure.qbl                                            |   33 +++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_QuintiqType.qbl                     |    7 
 _Main/BL/Type_CustomerDemandIDSRow/Attribute_RowNr.qbl                                                    |    7 
 _Main/BL/Type_CustomerDemandIDSColumn/_ROOT_Type_CustomerDemandIDSColumn.qbl                              |   10 +
 _Main/BL/Type_CustomerDemandIDSCell/_ROOT_Type_CustomerDemandIDSCell.qbl                                  |   10 +
 _Main/BL/Relations/Relation_CustomerDemandIDSCell_Row_CustomerDemandIDSRow_Cell.qbl                       |   23 ++
 _Main/BL/Type_CustomerDemandIDSColumn/DefaultValue_Name.qbl                                               |    6 
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_table.qbl                          |   27 +++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_QuintiqType.qbl              |    7 
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_column.qbl                         |   27 +++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_Key.qbl                      |    7 
 _Main/BL/Relations/Relation_CustomerDemandIDS_InterfaceDataset_InterfaceDataset_CustomerDemandI.qbl       |   23 ++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_Key.qbl                             |    7 
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_column.qbl                  |   17 +
 _Main/BL/Type_CustomerDemandIDS/Attribute_ID.qbl                                                          |    8 
 _Main/BL/Type_CustomerDemandIDS/Attribute_Name.qbl                                                        |    8 
 _Main/BL/Type_CustomerDemandIDS/_ROOT_Type_CustomerDemandIDS.qbl                                          |   10 +
 _Main/BL/Relations/Relation_CustomerDemandIDSColumn_Cell_CustomerDemandIDSCell_Column.qbl                 |   26 ++
 _Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl                                          |   23 ++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/_ROOT_XML_CustomerDemandIDSXML.qbl               |    8 
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_table.qbl                   |   27 +++
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_cell.qbl                           |   17 +
 _Main/BL/Type_CustomerDemandIDSColumn/Attribute_Name.qbl                                                  |    7 
 _Main/BL/Type_CustomerDemandIDS/DefaultValue_ID.qbl                                                       |    6 
 _Main/BL/Type_CustomerDemandIDSColumn/Function_CalcIndex.qbl                                              |   13 +
 _Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/_ROOT_XML_CustomerDemandIDSXMLHeaders.qbl |    8 
 _Main/BL/Type_CustomerDemandIDSRow/Attribute_Name.qbl                                                     |    7 
 _Main/BL/Type_CustomerDemandIDSCell/Attribute_Value.qbl                                                   |    7 
 _Main/BL/Type_CustomerDemandIDSColumn/Attribute_Index.qbl                                                 |    7 
 _Main/BL/Type_CustomerDemandIDSColumn/Attribute_Period.qbl                                                |    7 
 39 files changed, 529 insertions(+), 1 deletions(-)

diff --git a/_Main/BL/Relations/Relation_CustomerDemandIDSCell_Row_CustomerDemandIDSRow_Cell.qbl b/_Main/BL/Relations/Relation_CustomerDemandIDSCell_Row_CustomerDemandIDSRow_Cell.qbl
new file mode 100644
index 0000000..cb2c688
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CustomerDemandIDSCell_Row_CustomerDemandIDSRow_Cell.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CustomerDemandIDSCell_Row_CustomerDemandIDSRow_Cell
+{
+  #keys: '1[415136.0.1109674731]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide Row
+  {
+    #keys: '3[415136.0.1109674733][415136.0.1109674732][415136.0.1109674734]'
+    Cardinality: '0to1'
+    ObjectDefinition: CustomerDemandIDSCell
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide Cell
+  {
+    #keys: '3[415136.0.1109674736][415136.0.1109674735][415136.0.1109674737]'
+    Cardinality: '1toN'
+    ObjectDefinition: CustomerDemandIDSRow
+    OwningSide: 'Reference'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_CustomerDemandIDSColumn_Cell_CustomerDemandIDSCell_Column.qbl b/_Main/BL/Relations/Relation_CustomerDemandIDSColumn_Cell_CustomerDemandIDSCell_Column.qbl
new file mode 100644
index 0000000..55480b7
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CustomerDemandIDSColumn_Cell_CustomerDemandIDSCell_Column.qbl
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CustomerDemandIDSColumn_Cell_CustomerDemandIDSCell_Column
+{
+  #keys: '1[415136.0.1109674700]'
+  ProceduralSequenceRelationStrategy
+  {
+    #keys: '13[0.0.0][415136.0.1109674719][415136.0.1109674713][415136.0.1109674720][415136.0.1109674714][415136.0.1109674721][415136.0.1109674715][415136.0.1109674722][415136.0.1109674716][415136.0.1109674723][415136.0.1109674717][415136.0.1109674724][415136.0.1109674718]'
+    SequenceElementSuffix: 'CellInColumn'
+    SequenceSuffix: 'CellInColumn'
+  }
+  RelationSide.LeftSide Cell
+  {
+    #keys: '3[415136.0.1109674702][415136.0.1109674701][415136.0.1109674703]'
+    Cardinality: '1toN'
+    ObjectDefinition: CustomerDemandIDSColumn
+    OwningSide: 'Owned'
+  }
+  RelationSide.RightSide Column
+  {
+    #keys: '3[415136.0.1109674705][415136.0.1109674704][415136.0.1109674706]'
+    Cardinality: '0to1'
+    ObjectDefinition: CustomerDemandIDSCell
+    OwningSide: 'Reference'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_CustomerDemandIDS_Column_CustomerDemandIDSColumn_CustomerDemandIDS.qbl b/_Main/BL/Relations/Relation_CustomerDemandIDS_Column_CustomerDemandIDSColumn_CustomerDemandIDS.qbl
new file mode 100644
index 0000000..7057e02
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CustomerDemandIDS_Column_CustomerDemandIDSColumn_CustomerDemandIDS.qbl
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CustomerDemandIDS_Column_CustomerDemandIDSColumn_CustomerDemandIDS
+{
+  #keys: '1[415136.0.1109674656]'
+  ProceduralSequenceRelationStrategy
+  {
+    #keys: '13[0.0.0][415136.0.1109674675][415136.0.1109674669][415136.0.1109674676][415136.0.1109674670][415136.0.1109674677][415136.0.1109674671][415136.0.1109674678][415136.0.1109674672][415136.0.1109674679][415136.0.1109674673][415136.0.1109674680][415136.0.1109674674]'
+    SequenceElementSuffix: 'Column'
+    SequenceSuffix: 'Column'
+  }
+  RelationSide.LeftSide Column
+  {
+    #keys: '3[415136.0.1109674658][415136.0.1109674657][415136.0.1109674659]'
+    Cardinality: '1toN'
+    ObjectDefinition: CustomerDemandIDS
+    OwningSide: 'Owned'
+  }
+  RelationSide.RightSide CustomerDemandIDS
+  {
+    #keys: '3[415136.0.1109674661][415136.0.1109674660][415136.0.1109674662]'
+    Cardinality: '0to1'
+    ObjectDefinition: CustomerDemandIDSColumn
+    OwningSide: 'Reference'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_CustomerDemandIDS_InterfaceDataset_InterfaceDataset_CustomerDemandI.qbl b/_Main/BL/Relations/Relation_CustomerDemandIDS_InterfaceDataset_InterfaceDataset_CustomerDemandI.qbl
new file mode 100644
index 0000000..2818276
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CustomerDemandIDS_InterfaceDataset_InterfaceDataset_CustomerDemandI.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CustomerDemandIDS_InterfaceDataset_InterfaceDataset_CustomerDemandIDS
+{
+  #keys: '1[415136.0.1109686108]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide InterfaceDataset
+  {
+    #keys: '3[415136.0.1109686110][415136.0.1109686109][415136.0.1109686111]'
+    Cardinality: '0to1'
+    ObjectDefinition: CustomerDemandIDS
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide CustomerDemandIDS
+  {
+    #keys: '3[415136.0.1109686113][415136.0.1109686112][415136.0.1109686114]'
+    Cardinality: '1toN'
+    ObjectDefinition: InterfaceDataset
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_CustomerDemandIDS_Row_CustomerDemandIDSRow_CustomerDemandIDS.qbl b/_Main/BL/Relations/Relation_CustomerDemandIDS_Row_CustomerDemandIDSRow_CustomerDemandIDS.qbl
new file mode 100644
index 0000000..3755323
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CustomerDemandIDS_Row_CustomerDemandIDSRow_CustomerDemandIDS.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CustomerDemandIDS_Row_CustomerDemandIDSRow_CustomerDemandIDS
+{
+  #keys: '1[415136.0.1109674643]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide Row
+  {
+    #keys: '3[415136.0.1109674645][415136.0.1109674644][415136.0.1109674646]'
+    Cardinality: '1toN'
+    ObjectDefinition: CustomerDemandIDS
+    OwningSide: 'Owned'
+  }
+  RelationSide.RightSide CustomerDemandIDS
+  {
+    #keys: '3[415136.0.1109674648][415136.0.1109674647][415136.0.1109674649]'
+    Cardinality: '0to1'
+    ObjectDefinition: CustomerDemandIDSRow
+    OwningSide: 'Reference'
+  }
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/Attribute_ID.qbl b/_Main/BL/Type_CustomerDemandIDS/Attribute_ID.qbl
new file mode 100644
index 0000000..82fd242
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/Attribute_ID.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ID
+{
+  #keys: '3[415136.0.1109686029][415136.0.1109686028][415136.0.1109686030]'
+  IsReadOnly: true
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/Attribute_Name.qbl b/_Main/BL/Type_CustomerDemandIDS/Attribute_Name.qbl
new file mode 100644
index 0000000..5da9a7e
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/Attribute_Name.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Name
+{
+  #keys: '3[415136.0.1109686038][415136.0.1109686037][415136.0.1109686039]'
+  Description: '鍚嶇О'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/DefaultValue_ID.qbl b/_Main/BL/Type_CustomerDemandIDS/DefaultValue_ID.qbl
new file mode 100644
index 0000000..049abc0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/DefaultValue_ID.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: ID
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/DefaultValue_Name.qbl b/_Main/BL/Type_CustomerDemandIDS/DefaultValue_Name.qbl
new file mode 100644
index 0000000..86c3d59
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/DefaultValue_Name.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: Name
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/Method_SyncRows.qbl b/_Main/BL/Type_CustomerDemandIDS/Method_SyncRows.qbl
new file mode 100644
index 0000000..0106865
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/Method_SyncRows.qbl
@@ -0,0 +1,39 @@
+Quintiq file version 2.0
+#parent: #root
+Method SyncRows
+{
+  TextBody:
+  [*
+    totalRows := 0;
+    totalColumns := this.Column( relsize );
+    
+    if ( totalColumns > 0 ) {
+      randomCol := select( this, Column, tempFPC, true );
+      totalRows := randomCol.Cell( relsize );
+      
+      this.Row( relflush );
+      
+      cells := construct( CustomerDemandIDSCells );
+      traverse ( this, Column, fpc ) {
+        cells.Add( fpc.FirstCellInColumn() );
+      }
+      
+      for ( i := 0; i < totalRows; i++ ) {
+        assert( selectvalues( cells, Elements, c, true, c.Column().Index() ).ToString( "" ) = 
+                selectvalues( selectsortedset( cells, Elements, c, true, c.Column().Index() ), Elements, c, true, c.Column().Index() ).ToString( "" ),
+                "Assertion error in FrockDataTable::syncRows: Cells not sorted by column index" );
+        row := this.Row( relnew, RowNr := i );
+        
+        newCells := construct( CustomerDemandIDSCells );
+        
+        traverse ( cells, Elements, c ) {
+          row.Cell( relinsert, c );
+          
+          newCells.Add( c.NextCellInColumn() );
+        }
+        
+        cells := &newCells;
+      }
+    }
+  *]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/StaticMethod_ReadStructure.qbl b/_Main/BL/Type_CustomerDemandIDS/StaticMethod_ReadStructure.qbl
new file mode 100644
index 0000000..f0b4327
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/StaticMethod_ReadStructure.qbl
@@ -0,0 +1,33 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod ReadStructure (
+  BinaryValue binaryvalue,
+  InterfaceDataset owner
+)
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Sep-3-2024 (created)
+    tableGroupHandle := TableGroupHandle::Create( 'IDS鍏ㄨ〃' );
+    tableGroupHandle := XLS::LoadTableGroupFromBinaryData( binaryvalue.AsBinaryData(), tableGroupHandle, true, true );
+    sheets := tableGroupHandle.TableNames();
+    
+    traverse ( sheets, Elements, sheetName ) {
+      tableHandle := tableGroupHandle.Table( sheetName );
+      tableXML := TableHandle::ExportXML( tableHandle );
+      
+    //  info( tableXML.AsQUILL() );
+      
+      CustomerDemandIDS::XMLFileImportCustomerDemandIDSXMLHeaders( tableXML );
+      xlstable := CustomerDemandIDS::XMLImportCustomerDemandIDSXML( tableXML );
+    
+      xlstable.SyncRows();
+    
+      xlstable.Name( sheetName );
+      owner.CustomerDemandIDS( relinsert, &xlstable ); 
+      
+      Transaction::Transaction().Propagate( attribute( CustomerDemandIDSColumn, Index ) );
+    
+    }
+  *]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_Key.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_Key.qbl
new file mode 100644
index 0000000..4f408a0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_Key.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+XMLElementId
+{
+  XMLAddressType { }
+  XMLID Key { }
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_QuintiqType.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_QuintiqType.qbl
new file mode 100644
index 0000000..7468757
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLElementId_QuintiqType.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+XMLElementId
+{
+  XMLID QuintiqType { }
+  XMLQualifierType { }
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_cell.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_cell.qbl
new file mode 100644
index 0000000..c4fd297
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_cell.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+XMLObjectBase.ObjectDefinitions
+{
+  IdField: Key
+  ObjectTypeField: QuintiqType
+  TargetType: CustomerDemandIDSCell
+  XMLID cell { }
+  Attributes:
+  [
+    XMLAttribute
+    {
+      Attribute: Value
+      XMLID value { }
+    }
+  ]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_column.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_column.qbl
new file mode 100644
index 0000000..4a97560
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_column.qbl
@@ -0,0 +1,27 @@
+Quintiq file version 2.0
+#parent: #root
+XMLObjectBase.ObjectDefinitions
+{
+  IdField: Key
+  ObjectTypeField: QuintiqType
+  TargetType: CustomerDemandIDSColumn
+  XMLID column { }
+  Aggregates:
+  [
+    XMLAggregate
+    {
+      ElementDefinition: cell
+      GenerateOutput: false
+      Relation: Cell
+      XMLID Cell { }
+    }
+  ]
+  Attributes:
+  [
+    XMLAttribute
+    {
+      Attribute: Name
+      XMLID name { }
+    }
+  ]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_table.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_table.qbl
new file mode 100644
index 0000000..ebf311d
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/XMLObjectBase_table.qbl
@@ -0,0 +1,27 @@
+Quintiq file version 2.0
+#parent: #root
+XMLObjectBase.ObjectDefinitions
+{
+  IdField: Key
+  ObjectTypeField: QuintiqType
+  TargetType: CustomerDemandIDS
+  XMLID table { }
+  Aggregates:
+  [
+    XMLAggregate
+    {
+      ElementDefinition: column
+      GenerateOutput: false
+      Relation: Column
+      XMLID Column { }
+    }
+  ]
+  Attributes:
+  [
+    XMLAttribute
+    {
+      Attribute: Name
+      XMLID name { }
+    }
+  ]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/_ROOT_XML_CustomerDemandIDSXML.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/_ROOT_XML_CustomerDemandIDSXML.qbl
new file mode 100644
index 0000000..a0513a0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXML/_ROOT_XML_CustomerDemandIDSXML.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#root
+#parent: #root
+XML CustomerDemandIDSXML
+{
+  Direction: 'ImportExport'
+  Root: table
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_Key.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_Key.qbl
new file mode 100644
index 0000000..4f408a0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_Key.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+XMLElementId
+{
+  XMLAddressType { }
+  XMLID Key { }
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_QuintiqType.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_QuintiqType.qbl
new file mode 100644
index 0000000..7468757
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLElementId_QuintiqType.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+XMLElementId
+{
+  XMLID QuintiqType { }
+  XMLQualifierType { }
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_column.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_column.qbl
new file mode 100644
index 0000000..c3c96e9
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_column.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+XMLObjectBase.ObjectDefinitions
+{
+  IdField: Key
+  ObjectTypeField: QuintiqType
+  TargetType: CustomerDemandIDSColumn
+  XMLID column { }
+  Attributes:
+  [
+    XMLAttribute
+    {
+      Attribute: Name
+      XMLID name { }
+    }
+  ]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_table.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_table.qbl
new file mode 100644
index 0000000..ebf311d
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/XMLObjectBase_table.qbl
@@ -0,0 +1,27 @@
+Quintiq file version 2.0
+#parent: #root
+XMLObjectBase.ObjectDefinitions
+{
+  IdField: Key
+  ObjectTypeField: QuintiqType
+  TargetType: CustomerDemandIDS
+  XMLID table { }
+  Aggregates:
+  [
+    XMLAggregate
+    {
+      ElementDefinition: column
+      GenerateOutput: false
+      Relation: Column
+      XMLID Column { }
+    }
+  ]
+  Attributes:
+  [
+    XMLAttribute
+    {
+      Attribute: Name
+      XMLID name { }
+    }
+  ]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/_ROOT_XML_CustomerDemandIDSXMLHeaders.qbl b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/_ROOT_XML_CustomerDemandIDSXMLHeaders.qbl
new file mode 100644
index 0000000..8c8b3e2
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/XML_CustomerDemandIDSXMLHeaders/_ROOT_XML_CustomerDemandIDSXMLHeaders.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#root
+#parent: #root
+XML CustomerDemandIDSXMLHeaders
+{
+  Direction: 'ImportExport'
+  Root: table
+}
diff --git a/_Main/BL/Type_CustomerDemandIDS/_ROOT_Type_CustomerDemandIDS.qbl b/_Main/BL/Type_CustomerDemandIDS/_ROOT_Type_CustomerDemandIDS.qbl
new file mode 100644
index 0000000..cbc8e64
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDS/_ROOT_Type_CustomerDemandIDS.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CustomerDemandIDS
+{
+  #keys: '5[415136.0.1109686026][415136.0.1109686024][0.0.0][415136.0.1109686025][415136.0.1109686027]'
+  BaseType: Object
+  Description: '瀹㈡埛闇�姹傜殑IDS鍏ㄨ〃鏁版嵁'
+  StructuredName: 'CustomerDemandIDSs'
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSCell/Attribute_Value.qbl b/_Main/BL/Type_CustomerDemandIDSCell/Attribute_Value.qbl
new file mode 100644
index 0000000..a61a183
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSCell/Attribute_Value.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Value
+{
+  #keys: '3[415136.0.1109686090][415136.0.1109686089][415136.0.1109686091]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSCell/DefaultValue_Value.qbl b/_Main/BL/Type_CustomerDemandIDSCell/DefaultValue_Value.qbl
new file mode 100644
index 0000000..913414b
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSCell/DefaultValue_Value.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: Value
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSCell/_ROOT_Type_CustomerDemandIDSCell.qbl b/_Main/BL/Type_CustomerDemandIDSCell/_ROOT_Type_CustomerDemandIDSCell.qbl
new file mode 100644
index 0000000..696e85a
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSCell/_ROOT_Type_CustomerDemandIDSCell.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CustomerDemandIDSCell
+{
+  #keys: '5[415136.0.1109686084][415136.0.1109686082][0.0.0][415136.0.1109686083][415136.0.1109686085]'
+  BaseType: Object
+  Description: '瀹㈡埛闇�姹傜殑IDS鍏ㄨ〃鏁版嵁'
+  StructuredName: 'CustomerDemandIDSCells'
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Index.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Index.qbl
new file mode 100644
index 0000000..112a42c
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Index.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Index
+{
+  #keys: '3[415136.0.1109686070][415136.0.1109686069][415136.0.1109686071]'
+  ValueType: Number
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Name.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Name.qbl
new file mode 100644
index 0000000..411803f
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Name.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Name
+{
+  #keys: '3[415136.0.1109686073][415136.0.1109686072][415136.0.1109686074]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Period.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Period.qbl
new file mode 100644
index 0000000..4ec77c1
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/Attribute_Period.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Period
+{
+  #keys: '3[415136.0.1109686076][415136.0.1109686075][415136.0.1109686077]'
+  ValueType: Date
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/DefaultValue_Name.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/DefaultValue_Name.qbl
new file mode 100644
index 0000000..86c3d59
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/DefaultValue_Name.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: Name
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/Function_CalcIndex.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/Function_CalcIndex.qbl
new file mode 100644
index 0000000..3efd068
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/Function_CalcIndex.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcIndex
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-22-2024 (created)
+    
+    value := ifexpr( isnull( this.PreviousColumn() ), 0, this.PreviousColumn().Index() + 1 );
+    
+    this.Index( value );
+  *]
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSColumn/_ROOT_Type_CustomerDemandIDSColumn.qbl b/_Main/BL/Type_CustomerDemandIDSColumn/_ROOT_Type_CustomerDemandIDSColumn.qbl
new file mode 100644
index 0000000..3df6694
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSColumn/_ROOT_Type_CustomerDemandIDSColumn.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CustomerDemandIDSColumn
+{
+  #keys: '5[415136.0.1109686067][415136.0.1109686065][0.0.0][415136.0.1109686066][415136.0.1109686068]'
+  BaseType: Object
+  Description: '瀹㈡埛闇�姹傜殑IDS鍏ㄨ〃鏁版嵁'
+  StructuredName: 'CustomerDemandIDSColumns'
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/Attribute_DuplicateValueMarker.qbl b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_DuplicateValueMarker.qbl
new file mode 100644
index 0000000..b28a0d0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_DuplicateValueMarker.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute DuplicateValueMarker
+{
+  #keys: '3[415136.0.1109686049][415136.0.1109686048][415136.0.1109686050]'
+  Description: '鍒ゆ柇鏄惁瀛樺湪閲嶅鍊�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/Attribute_Name.qbl b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_Name.qbl
new file mode 100644
index 0000000..3a140dd
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_Name.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Name
+{
+  #keys: '3[415136.0.1109686052][415136.0.1109686051][415136.0.1109686053]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/Attribute_RowNr.qbl b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_RowNr.qbl
new file mode 100644
index 0000000..33efbf6
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/Attribute_RowNr.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute RowNr
+{
+  #keys: '3[415136.0.1109686055][415136.0.1109686054][415136.0.1109686056]'
+  ValueType: Number
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_DuplicateValueMarker.qbl b/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_DuplicateValueMarker.qbl
new file mode 100644
index 0000000..bbb8a45
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_DuplicateValueMarker.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: DuplicateValueMarker
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_Name.qbl b/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_Name.qbl
new file mode 100644
index 0000000..86c3d59
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/DefaultValue_Name.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: Name
+}
diff --git a/_Main/BL/Type_CustomerDemandIDSRow/_ROOT_Type_CustomerDemandIDSRow.qbl b/_Main/BL/Type_CustomerDemandIDSRow/_ROOT_Type_CustomerDemandIDSRow.qbl
new file mode 100644
index 0000000..8d40747
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandIDSRow/_ROOT_Type_CustomerDemandIDSRow.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CustomerDemandIDSRow
+{
+  #keys: '5[415136.0.1109686046][415136.0.1109686044][0.0.0][415136.0.1109686045][415136.0.1109686047]'
+  BaseType: Object
+  Description: '瀹㈡埛闇�姹傜殑IDS鍏ㄨ〃鏁版嵁'
+  StructuredName: 'CustomerDemandIDSRows'
+}
diff --git a/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
index c09496a..2139612 100644
--- a/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
@@ -2,6 +2,7 @@
 #parent: #root
 StaticMethod GenerateData (
   const MacroPlan macroplan,
+  const Archive archive,
   InterfaceDataset interfaceDataset,
   String executor,
   Boolean versionflag
@@ -31,7 +32,7 @@
                                                                  , ReturnMsg                 := 'Success'
                                                                  , Success                   := true
                                                                   );
-    traverse( macroplan, SalesDemand.astype( Forecast ), forecast ){
+    traverse( macroplan, SalesDemand.astype( Forecast ), forecast, forecast.Origin() = 'PPA' ){
       cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := forecast.ProductID()
                                                                    , DemandDate              := forecast.StartDate()
                                                                    , DemandQty               := [Number]forecast.Quantity()
@@ -41,6 +42,26 @@
                                                                    );
       loginfo.CustomerDemandPPAIDS( relinsert, cd );
     }
+    binaryValue           := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() );
+    CustomerDemandIDS::ReadStructure( binaryValue, interfaceDataset );
+    productcolumn         := select( interfaceDataset, CustomerDemandIDS.Column, column, column.Index() = 1 );
+    cnv2 := StringToDate::StandardConverter();
+    cnv2.SetCustomConversion();
+    cnv2.CustomFormatString( "dd/MM/yyyy" );
+    traverse( interfaceDataset, CustomerDemandIDS.Row, row ){
+      product             := selectobject( row, Cell, cell, cell.Column() = productcolumn );
+      traverse( row, Cell, cell, cell.Column().Index() > 3 ){
+        period := cnv2.Convert( cell.Column().Name() );
+        cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := product.Value()
+                                                                     , DemandDate              := period
+                                                                     , DemandQty               := [Number]cell.Value()
+                                                                     , VersionName             := macroplan.ScenarioName()
+                                                                     , InterfaceTime           := nowdate
+                                                                     , VersionFlag             := versionflag
+                                                                     );
+        loginfo.CustomerDemandPPAIDS( relinsert, cd );
+      }
+    }
     loginfo.TotalRow( loginfo.CustomerDemandPPAIDS( relsize ) );
   *]
 }

--
Gitblit v1.9.3