From 2237ad24deb34ca1aeaf659ea1d4f523d708cd26 Mon Sep 17 00:00:00 2001
From: yypsybs <yypsybs@foxmail.com>
Date: 星期三, 20 九月 2023 14:57:53 +0800
Subject: [PATCH] PRData现场测试用

---
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_PlaceOfProductionOfArray.qbl                                            |    8 
 _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByYear.qbl                                                             |    4 
 _Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRowProduct_CapacityAndSaleBudgeChartRow_Ca.qbl                          |   23 +
 _Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetBySeason.qbl                                                         |   21 +
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_OnCreated.def                                   |    2 
 _Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/Attribute_ProductCode.qbl                                                  |    8 
 _Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeCompare.qbl                                                         |    6 
 _Main/UI/MacroPlannerWebApp/Component_Form633/Component_listContextMenuPRData#1.def                                          |   11 
 _Main/UI/MacroPlannerWebApp/Component_Form633/Response_OnCreated.def                                                         |   14 
 _Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl                                                                     |    2 
 _Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/_ROOT_Type_CapacityAndSaleBudgeChartRowProduct.qbl                         |    9 
 _Main/BL/Type_ProductInStockingPointInPeriod/StaticMethod_GetByMRPCalverNo.qbl                                               |   12 
 _Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/DefaultValue_ProductCode.qbl                                               |    6 
 _Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByYear.qbl                                                              |    2 
 _Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyBySeason.qbl                                                               |   21 +
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/Method_GetProductCodes.qbl                                                        |   10 
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_CreateIfNotExist.qbl                                                 |   18 +
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_BusinessType.qbl                                                        |    8 
 _Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/StaticMethod_CreateIfNotExist.qbl                                          |   17 +
 _Main/UI/MacroPlannerWebApp/Component_Form633/Response_PanelPRDataButton_ButtonLoad_OnClick.def                              |   21 +
 _Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl                                                       |   14 
 _Main/UI/MacroPlannerWebApp/Component_Form633/Response_ListPRData_844_MenuPrintRequest_OnClick#623.def                       |   23 +
 _Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInHalfYear.qbl                                                   |   19 +
 _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByMonth.qbl                                                            |    9 
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_ButtonCapacityAndSaleBudgeChartTest_OnClick.def |    2 
 _Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRow_ScenarioManager_ScenarioManager_Capaci.qbl                          |   23 +
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/DefaultValue_BusinessType.qbl                                                     |    6 
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/_ROOT_Type_CapacityAndSaleBudgeChartRow.qbl                                       |    9 
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/_ROOT_Component_FormCapacityAndSaleBudgeChart.def        |    4 
 _Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl                                                                         |   83 ++--
 _Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Response_ListPRHistoryData_844_MenuPrintRequest_OnClick#338.def      |   19 +
 _Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning#662.qbl                                                                 |   29 +
 _Main/UI/MacroPlannerWebApp/Component_Form633/Component_PanelPRDataButton.def                                                |   15 
 _Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInPCSInYear.qbl                                                         |   15 
 _Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyByHalfYear#1.qbl                                                           |   21 +
 _Main/BL/Type_PRHistoryData/Method_PrintCall.qbl                                                                             |   23 +
 _Main/BL/Type_ERPRequestOfPR/Method_GetCallJSONString.qbl                                                                    |   28 +
 _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByHalfYear.qbl                                                         |   24 +
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByPlaceOfProductionOfArray.qbl                        |   15 
 _Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeChart.qbl                                                           |  231 +++++++++++++
 _Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInSeason.qbl                                                     |   19 +
 _Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetByHalfYear#1.qbl                                                     |   21 +
 _Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByMonth.qbl                                                             |    6 
 _Main/BL/Type_PRData/Method_PrintCall.qbl                                                                                    |   47 ++
 _Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Component_listContextMenuPRHistoryData#1.def                         |   11 
 _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityBySeason.qbl                                                           |   24 +
 _Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByBusinessType.qbl                                    |   15 
 47 files changed, 891 insertions(+), 87 deletions(-)

diff --git a/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRowProduct_CapacityAndSaleBudgeChartRow_Ca.qbl b/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRowProduct_CapacityAndSaleBudgeChartRow_Ca.qbl
new file mode 100644
index 0000000..5e2a588
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRowProduct_CapacityAndSaleBudgeChartRow_Ca.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CapacityAndSaleBudgeChartRowProduct_CapacityAndSaleBudgeChartRow_CapacityAndSaleBudgeChartRow_CapacityAndSaleBudgeChartRowProduct
+{
+  #keys: '1[414384.0.852471810]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide CapacityAndSaleBudgeChartRow
+  {
+    #keys: '3[414384.0.852471812][414384.0.852471811][414384.0.852471813]'
+    Cardinality: '0to1'
+    ObjectDefinition: CapacityAndSaleBudgeChartRowProduct
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide CapacityAndSaleBudgeChartRowProduct
+  {
+    #keys: '3[414384.0.852471815][414384.0.852471814][414384.0.852471816]'
+    Cardinality: '1toN'
+    ObjectDefinition: CapacityAndSaleBudgeChartRow
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRow_ScenarioManager_ScenarioManager_Capaci.qbl b/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRow_ScenarioManager_ScenarioManager_Capaci.qbl
new file mode 100644
index 0000000..13e8d6d
--- /dev/null
+++ b/_Main/BL/Relations/Relation_CapacityAndSaleBudgeChartRow_ScenarioManager_ScenarioManager_Capaci.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation CapacityAndSaleBudgeChartRow_ScenarioManager_ScenarioManager_CapacityAndSaleBudgeChartRow
+{
+  #keys: '1[414384.0.852471828]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide ScenarioManager
+  {
+    #keys: '3[414384.0.852471830][414384.0.852471829][414384.0.852471831]'
+    Cardinality: '0to1'
+    ObjectDefinition: CapacityAndSaleBudgeChartRow
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide CapacityAndSaleBudgeChartRow
+  {
+    #keys: '3[414384.0.852471833][414384.0.852471832][414384.0.852471834]'
+    Cardinality: '1toN'
+    ObjectDefinition: ScenarioManager
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInPCSInYear.qbl b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInPCSInYear.qbl
new file mode 100644
index 0000000..8e5ce5e
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInPCSInYear.qbl
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetCapacityInPCSInYear () as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    result := 0.0;
+    for( i := 1; i <= 12; i := i + 1 ) {
+      field := Reflection::FindAttribute( "CapacityAndSaleBudge", "CapacityInPCSInMonth" + [String]i );
+      result := result + field.GetReal( this );
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInHalfYear.qbl b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInHalfYear.qbl
new file mode 100644
index 0000000..54eecdf
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInHalfYear.qbl
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetCapacityInSheetInHalfYear (
+  Number halfNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    result := 0.0;
+    fromMonth := 1 + ( halfNo - 1 ) * 6;
+    toMonth := 6 + ( halfNo - 1 ) * 6;
+    for( i := fromMonth; i <= toMonth; i := i + 1 ) {
+      field := Reflection::FindAttribute( "CapacityAndSaleBudge", "CapacityInSheetInMonth" + [String]i );
+      result := result + field.GetReal( this );
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInSeason.qbl b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInSeason.qbl
new file mode 100644
index 0000000..5af224d
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudge/Method_GetCapacityInSheetInSeason.qbl
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetCapacityInSheetInSeason (
+  Number seasonNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    result := 0.0;
+    fromMonth := 1 + ( seasonNo - 1 ) * 3;
+    toMonth := 3 + ( seasonNo - 1 ) * 3;
+    for( i := fromMonth; i <= toMonth; i := i + 1 ) {
+      field := Reflection::FindAttribute( "CapacityAndSaleBudge", "CapacityInSheetInMonth" + [String]i );
+      result := result + field.GetReal( this );
+    }
+    return result;
+  *]
+}
diff --git "a/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetByHalfYear\0431.qbl" "b/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetByHalfYear\0431.qbl"
new file mode 100644
index 0000000..7f929c7
--- /dev/null
+++ "b/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetByHalfYear\0431.qbl"
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetSheetByHalfYear (
+  Strings productNo,
+  GlobalOTDTable parent,
+  Number yearNo,
+  Number halfNo
+) as Real
+{
+  Description: '浜ц兘 - 瀹炴暟澶у紶'
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    result := sum( parent, 
+                   CapacityAndSaleBudge, 
+                   item, 
+                   productNo.Find( item.ProductCode() ) > -1,
+                   item.GetCapacityInSheetInHalfYear( halfNo ) );
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetBySeason.qbl b/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetBySeason.qbl
new file mode 100644
index 0000000..a0193ae
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudge/StaticMethod_GetSheetBySeason.qbl
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetSheetBySeason (
+  Strings productNo,
+  GlobalOTDTable parent,
+  Number yearNo,
+  Number seasonNo
+) as Real
+{
+  Description: '浜ц兘 - 瀹炴暟澶у紶'
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    result := sum( parent, 
+                   CapacityAndSaleBudge, 
+                   item, 
+                   productNo.Find( item.ProductCode() ) > -1,
+                   item.GetCapacityInSheetInSeason( seasonNo ) );
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl
new file mode 100644
index 0000000..2acad18
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl
@@ -0,0 +1,14 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Create (
+  ScenarioManager parent,
+  String timeStringAndScenarioName,
+  String businessTypeOrOrgCode,
+  Real quantity
+)
+{
+  TextBody:
+  [*
+    // yypsybs Sep-20-2023 (created)
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_BusinessType.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_BusinessType.qbl
new file mode 100644
index 0000000..3f0eec8
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_BusinessType.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute BusinessType
+{
+  #keys: '3[414384.0.850180080][414384.0.850180079][414384.0.850180081]'
+  Description: '浜嬩笟閮�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_PlaceOfProductionOfArray.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_PlaceOfProductionOfArray.qbl
new file mode 100644
index 0000000..57beec6
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Attribute_PlaceOfProductionOfArray.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute PlaceOfProductionOfArray
+{
+  #keys: '3[414384.0.850180083][414384.0.850180082][414384.0.850180084]'
+  Description: '缁勭粐缂栫爜'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/DefaultValue_BusinessType.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/DefaultValue_BusinessType.qbl
new file mode 100644
index 0000000..1672b03
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/DefaultValue_BusinessType.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: BusinessType
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Method_GetProductCodes.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Method_GetProductCodes.qbl
new file mode 100644
index 0000000..facff27
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/Method_GetProductCodes.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetProductCodes () as owning Strings
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    return selectuniquevalues( this, CapacityAndSaleBudgeChartRowProduct, item, item.ProductCode() );
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_CreateIfNotExist.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_CreateIfNotExist.qbl
new file mode 100644
index 0000000..cb76a5f
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_CreateIfNotExist.qbl
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CreateIfNotExist (
+  ScenarioManager scenarioManager,
+  String businessType,
+  String placeOfProductionOfArray
+) as CapacityAndSaleBudgeChartRow
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    value := select( scenarioManager, CapacityAndSaleBudgeChartRow, row, row.BusinessType() = businessType and row.PlaceOfProductionOfArray() = placeOfProductionOfArray );
+    if( isnull( value ) ) {
+      value := scenarioManager.CapacityAndSaleBudgeChartRow( relnew, BusinessType := businessType, PlaceOfProductionOfArray := placeOfProductionOfArray );  
+    } 
+    return value;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByBusinessType.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByBusinessType.qbl
new file mode 100644
index 0000000..a664cdc
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByBusinessType.qbl
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetProductCodesByBusinessType (
+  CapacityAndSaleBudgeChartRows list,
+  String businessTyoe
+) as owning Strings
+{
+  TextBody:
+  [*
+    // yypsybs Sep-20-2023 (created)
+    return selectuniquevalues(  list, Elements, item, 
+                                item.BusinessType() = businessTyoe,
+                                item.BusinessType() );
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByPlaceOfProductionOfArray.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByPlaceOfProductionOfArray.qbl
new file mode 100644
index 0000000..109e1d7
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/StaticMethod_GetProductCodesByPlaceOfProductionOfArray.qbl
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetProductCodesByPlaceOfProductionOfArray (
+  CapacityAndSaleBudgeChartRows list,
+  String placeOfProductionOfArray
+) as owning Strings
+{
+  TextBody:
+  [*
+    // yypsybs Sep-20-2023 (created)
+    return selectuniquevalues(  list, Elements, item, 
+                                item.PlaceOfProductionOfArray() = placeOfProductionOfArray,
+                                item.PlaceOfProductionOfArray() );
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRow/_ROOT_Type_CapacityAndSaleBudgeChartRow.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/_ROOT_Type_CapacityAndSaleBudgeChartRow.qbl
new file mode 100644
index 0000000..0ecbf2c
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRow/_ROOT_Type_CapacityAndSaleBudgeChartRow.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CapacityAndSaleBudgeChartRow
+{
+  #keys: '5[414384.0.852471790][414384.0.852471788][0.0.0][414384.0.852471789][414384.0.852471791]'
+  BaseType: Object
+  StructuredName: 'CapacityAndSaleBudgeChartRows'
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/Attribute_ProductCode.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/Attribute_ProductCode.qbl
new file mode 100644
index 0000000..63014d7
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/Attribute_ProductCode.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ProductCode
+{
+  #keys: '3[414384.0.852471849][414384.0.852471848][414384.0.852471850]'
+  Description: '浜у搧缂栫爜'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/DefaultValue_ProductCode.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/DefaultValue_ProductCode.qbl
new file mode 100644
index 0000000..73158ab
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/DefaultValue_ProductCode.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#parent: #root
+DefaultValue
+{
+  TargetAttribute: ProductCode
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/StaticMethod_CreateIfNotExist.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/StaticMethod_CreateIfNotExist.qbl
new file mode 100644
index 0000000..8d05fbd
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/StaticMethod_CreateIfNotExist.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CreateIfNotExist (
+  CapacityAndSaleBudgeChartRow parent,
+  String productCode
+) as CapacityAndSaleBudgeChartRowProduct
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    value := select( parent, CapacityAndSaleBudgeChartRowProduct, item, item.ProductCode() = productCode );
+    if( isnull( value ) ) {
+      parent.CapacityAndSaleBudgeChartRowProduct( relnew, ProductCode := productCode );
+    }
+    return value;
+  *]
+}
diff --git a/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/_ROOT_Type_CapacityAndSaleBudgeChartRowProduct.qbl b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/_ROOT_Type_CapacityAndSaleBudgeChartRowProduct.qbl
new file mode 100644
index 0000000..f52d6fe
--- /dev/null
+++ b/_Main/BL/Type_CapacityAndSaleBudgeChartRowProduct/_ROOT_Type_CapacityAndSaleBudgeChartRowProduct.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type CapacityAndSaleBudgeChartRowProduct
+{
+  #keys: '5[414384.0.852471769][414384.0.852471767][0.0.0][414384.0.852471768][414384.0.852471770]'
+  BaseType: Object
+  StructuredName: 'CapacityAndSaleBudgeChartRowProducts'
+}
diff --git a/_Main/BL/Type_ERPRequestOfPR/Method_GetCallJSONString.qbl b/_Main/BL/Type_ERPRequestOfPR/Method_GetCallJSONString.qbl
new file mode 100644
index 0000000..0c9c74e
--- /dev/null
+++ b/_Main/BL/Type_ERPRequestOfPR/Method_GetCallJSONString.qbl
@@ -0,0 +1,28 @@
+Quintiq file version 2.0
+#parent: #root
+Method GetCallJSONString () as String
+{
+  TextBody:
+  [*
+    // yypsybs Sep-20-2023 (created)
+    conv := DateTimeToString::StandardConverter();
+    conv.SetCustomConversion();
+    conv.CustomFormatString( 'yyyyMMdd' );
+    
+    requestJSON := JSON::Object();
+    requestJSON.Add( "BusinessType", this.BusinessType() );
+    requestJSON.Add( "DataID", this.DataID() );
+    requestJSON.Add( "DeliveryDate", conv.Convert( this.DeliveryDate().DateTime() ) );
+    requestJSON.Add( "MRPCalverNo", this.MRPCalverNo() );
+    requestJSON.Add( "OrganCode", this.OrganCode() );
+    requestJSON.Add( "ProductID", this.ProductID() );
+    requestJSON.Add( "ProductName", this.ProductName() );
+    requestJSON.Add( "ProvideCode", this.ProviderCode() );
+    requestJSON.Add( "ProviderName", this.ProviderName() );
+    requestJSON.Add( "Quantity", this.Quantity() );
+    requestJSON.Add( "StockingPointID", this.StockingPointID() );
+    requestJSON.Add( "UnitOfMeasure", this.UnitOfMeasure() );
+    
+    return requestJSON.AsString();
+  *]
+}
diff --git a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl
index db96b72..f69a011 100644
--- a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl
+++ b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl
@@ -22,46 +22,49 @@
     info( "CapacityAndSaleBudge::InitTestData" )
     this.CapacityAndSaleBudge( relflush );
     for( i := 1; i < 100; i := i + 1 ) {
-      this.CapacityAndSaleBudge( relnew, 
-                                 PlaceOfProductionOfArray := "闈㈡澘鍩哄湴" + [String]Number::Random( 1, 10 ), 
-                                 BusinessType := "浜嬩笟閮�" + [String]Number::Random( 1, 10 ), 
-                                 CapacityInPCSInMonth1 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth2 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth3 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth4 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth5 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth6 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth7 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth8 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth9 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth10 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth11 := Number::Random( 1, 10000 ),  
-                                 CapacityInPCSInMonth12 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth1 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth2 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth3 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth4 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth5 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth6 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth7 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth8 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth9 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth10 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth11 := Number::Random( 1, 10000 ),  
-                                 CapacityInSheetInMonth12 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth1 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth2 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth3 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth4 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth5 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth6 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth7 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth8 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth9 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth10 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth11 := Number::Random( 1, 10000 ),
-                                 SaleAmountInMonth12 := Number::Random( 1, 10000 ) 
-                               );
+      row := this.CapacityAndSaleBudge( relnew, 
+                                        PlaceOfProductionOfArray := "闈㈡澘鍩哄湴" + [String]Number::Random( 1, 10 ), 
+                                        BusinessType := "浜嬩笟閮�" + [String]Number::Random( 1, 10 ), 
+                                        CapacityInPCSInMonth1 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth2 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth3 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth4 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth5 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth6 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth7 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth8 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth9 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth10 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth11 := Number::Random( 1, 10000 ),  
+                                        CapacityInPCSInMonth12 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth1 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth2 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth3 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth4 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth5 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth6 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth7 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth8 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth9 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth10 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth11 := Number::Random( 1, 10000 ),  
+                                        CapacityInSheetInMonth12 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth1 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth2 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth3 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth4 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth5 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth6 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth7 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth8 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth9 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth10 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth11 := Number::Random( 1, 10000 ),
+                                        SaleAmountInMonth12 := Number::Random( 1, 10000 ) 
+                                      );
+      row.CapacityInPCSTotal( row.GetCapacityInPCSInYear() );
+      row.CapacityInSheetTotal( row.GetCapacityInSheetInYear() );
+      row.SaleAmountTotal( row.GetSaleAmountInYear() );
     }
   *]
 }
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByMonth.qbl
similarity index 87%
rename from _Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl
rename to _Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByMonth.qbl
index f289073..6b7351c 100644
--- a/_Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByMonth.qbl
@@ -1,10 +1,10 @@
 Quintiq file version 2.0
 #parent: #root
-StaticMethod GetByMonth (
+StaticMethod GetBalanceByMonth (
   Strings productCodes,
   MacroPlan parent,
-  Number monthNo,
-  Number yearNo
+  Number yearNo,
+  Number monthNo
 ) as Real
 {
   Description: 'todo changeParent'
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByYear.qbl
similarity index 93%
rename from _Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl
rename to _Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByYear.qbl
index ddf0484..dfc4872 100644
--- a/_Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetBalanceByYear.qbl
@@ -1,6 +1,6 @@
 Quintiq file version 2.0
 #parent: #root
-StaticMethod GetByYear (
+StaticMethod GetBalanceByYear (
   Strings productCodes,
   MacroPlan parent,
   Number yearNo
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByHalfYear.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByHalfYear.qbl
new file mode 100644
index 0000000..ecf844c
--- /dev/null
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByHalfYear.qbl
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetQuantityByHalfYear (
+  Strings productCodes,
+  MacroPlan parent,
+  Number yearNo,
+  Number halfNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-19-2023 (created)
+    value := 0.0;
+    
+    startMonth := 1 + ( halfNo - 1 ) * 6;
+    endMonth := 6 + ( halfNo - 1 ) * 6;
+    
+    for( monthNo := startMonth; monthNo <= endMonth; monthNo := monthNo + 1 ) {
+      value := value + MappingForecast::GetQuantityByMonth( productCodes, parent, yearNo, monthNo );
+    }
+    
+    return value;
+  *]
+}
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByMonth.qbl
similarity index 73%
copy from _Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl
copy to _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByMonth.qbl
index f289073..d3ae8c1 100644
--- a/_Main/BL/Type_MappingForecast/StaticMethod_GetByMonth.qbl
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByMonth.qbl
@@ -1,13 +1,12 @@
 Quintiq file version 2.0
 #parent: #root
-StaticMethod GetByMonth (
+StaticMethod GetQuantityByMonth (
   Strings productCodes,
   MacroPlan parent,
-  Number monthNo,
-  Number yearNo
+  Number yearNo,
+  Number monthNo
 ) as Real
 {
-  Description: 'todo changeParent'
   TextBody:
   [*
     // yypsybs Sep-19-2023 (created)
@@ -15,7 +14,7 @@
                   MappingForecast, 
                   item,
                   productCodes.Find( item.ProductID() ) > -1 and yearNo = item.StartDate().Year() and monthNo = item.StartDate().Month(), 
-                  item.Price() * item.Quantity() );
+                  item.Quantity() );
     return value;
   *]
 }
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityBySeason.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityBySeason.qbl
new file mode 100644
index 0000000..3b4ac41
--- /dev/null
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityBySeason.qbl
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetQuantityBySeason (
+  Strings productCodes,
+  MacroPlan parent,
+  Number yearNo,
+  Number seasonNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-19-2023 (created)
+    value := 0.0;
+    
+    startMonth := 1 + ( seasonNo - 1 ) * 3;
+    endMonth := 3 + ( seasonNo - 1 ) * 3;
+    
+    for( monthNo := startMonth; monthNo <= endMonth; monthNo := monthNo + 1 ) {
+      value := value + MappingForecast::GetQuantityByMonth( productCodes, parent, yearNo, monthNo );
+    }
+    
+    return value;
+  *]
+}
diff --git a/_Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByYear.qbl
similarity index 84%
copy from _Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl
copy to _Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByYear.qbl
index ddf0484..31db8aa 100644
--- a/_Main/BL/Type_MappingForecast/StaticMethod_GetByYear.qbl
+++ b/_Main/BL/Type_MappingForecast/StaticMethod_GetQuantityByYear.qbl
@@ -1,6 +1,6 @@
 Quintiq file version 2.0
 #parent: #root
-StaticMethod GetByYear (
+StaticMethod GetQuantityByYear (
   Strings productCodes,
   MacroPlan parent,
   Number yearNo
@@ -14,7 +14,7 @@
                   MappingForecast, 
                   item,
                   productCodes.Find( item.ProductID() ) > -1 and yearNo = item.StartDate().Year(), 
-                  item.Price() * item.Quantity() );
+                  item.Quantity() );
     return value;
   *]
 }
diff --git a/_Main/BL/Type_PRData/Method_PrintCall.qbl b/_Main/BL/Type_PRData/Method_PrintCall.qbl
new file mode 100644
index 0000000..f82b310
--- /dev/null
+++ b/_Main/BL/Type_PRData/Method_PrintCall.qbl
@@ -0,0 +1,47 @@
+Quintiq file version 2.0
+#parent: #root
+Method PrintCall (
+  GlobalOTDTable globalData,
+  String callBy
+) as String
+{
+  TextBody:
+  [*
+    // yypsybs Sep-11-2023 (created)
+    result := globalData.PRHistoryData( relnew );
+    
+    // 鐓ф惉閮ㄥ垎
+    result.AuthorizationStatus( this.AuthorizationStatus() );
+    result.BusinessType( this.BusinessType() );
+    result.DataID( this.DataID() );
+    result.DeliverToRequestorId( this.DeliverToRequestorId() );
+    result.DestinationOrganizationID( this.DestinationOrganizationID() );
+    result.DestinationTypeCode( this.DestinationTypeCode() );
+    result.HeaderDescription( this.HeaderDescription() );
+    result.LineAttribute1( this.LineAttribute1() );
+    result.LineAttribute6( this.LineAttribute6() );
+    result.LineType( this.LineType() );
+    result.LineTypeId( this.LineTypeId() );
+    result.MRPCalverNo( this.MRPCalverNo() );
+    result.OrganCode( this.OrganCode() );
+    result.OrgId( this.OrgId() );
+    result.PlannerCode( this.PlannerCode() );
+    result.PreparerId( this.PreparerId() );
+    result.ProduceRequiredDate( this.ProduceRequiredDate() );
+    result.ProductID( this.ProductID() );
+    result.ProductName( this.ProductName() );
+    result.ProviderCode( this.ProviderCode() );
+    result.ProviderName( this.ProviderName() );
+    result.Quantity( this.Quantity() );
+    result.RequisitionType( this.RequisitionType() );
+    result.StockingPointID( this.StockingPointID() );
+    result.UnitOfMeasure( this.UnitOfMeasure() );
+    result.UnitPrice( this.UnitPrice() );
+    
+    // 璇锋眰閮ㄥ垎
+    request := ERPRequestOfPR::Create( result );
+    retult := request.GetCallJSONString();
+    request.Delete();
+    return retult;
+  *]
+}
diff --git "a/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning\043662.qbl" "b/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning\043662.qbl"
index c86f3e2..2b88918 100644
--- "a/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning\043662.qbl"
+++ "b/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning\043662.qbl"
@@ -24,7 +24,7 @@
     erpData := "鏆傛棤";
     
     // 鏍规嵁pispip
-    result.MRPCalverNo( pispip.MRPCalverNo() );
+    result.MRPCalverNo( ifexpr( pispip.MRPCalverNo() = "", "鏆傛棤", pispip.MRPCalverNo() ) );
     result.Quantity( pispip.NewSupplyQuantity() );
     
     // 鏍规嵁product
@@ -40,15 +40,28 @@
                                      Date::Today(), (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() ) );
     
     // 鏍规嵁 鐗╂枡灞炴�ф爣绛捐瀹�&鐗╂枡璁″垝绛栫暐
-    result.IsPanelMaterial();
-    result.IsGenericMaterial( matAttrSetting.FlagGeneric() );
-    result.IsLongLeadItem( matAttrSetting.FlagLongTerm() );
-    result.MaterialMRPType( ifexpr( matAttrSetting.PlanningStrategyCustom() <> "", matAttrSetting.PlanningStrategyCustom(), matAttrSetting.PlanningStrategyAuto() ) );
+    result.IsPanelMaterial( "鏆傛棤" );
+    if( isnull( matAttrSetting ) ) {
+      result.IsGenericMaterial( "鏆傛棤" );
+      result.IsLongLeadItem( "鏆傛棤" );
+      result.MaterialMRPType( "鏆傛棤" );
+    } else {
+      result.IsGenericMaterial( matAttrSetting.FlagGeneric() );
+      result.IsLongLeadItem( matAttrSetting.FlagLongTerm() );
+      result.MaterialMRPType( ifexpr( matAttrSetting.PlanningStrategyCustom() <> "", matAttrSetting.PlanningStrategyCustom(), matAttrSetting.PlanningStrategyAuto() ) );
+    }
+    
     
     // 鏍规嵁product涓棿琛�
-    result.BusinessType( mappingProduct.BusinessType() );
-    result.OrganCode( mappingProduct.OrgCode() );
-    result.UnitOfMeasure( mappingProduct.UnitOfMeasureName() );
+    if( isnull( mappingProduct ) ) {
+      result.BusinessType( "鏆傛棤" );
+      result.OrganCode( "鏆傛棤" );
+      result.UnitOfMeasure( "鏆傛棤" );
+    } else {
+      result.BusinessType( mappingProduct.BusinessType() );
+      result.OrganCode( mappingProduct.OrgCode() );
+      result.UnitOfMeasure( mappingProduct.UnitOfMeasureName() );
+    }
     
     // 鏍规嵁渚涘簲鍟嗚兘鍔涗腑闂磋〃
     result.ProviderCode( mappingProviderCapacity );
diff --git a/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl b/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl
index 5b37c1c..f011f1d 100644
--- a/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl
+++ b/_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl
@@ -20,7 +20,7 @@
                              item.MRPCalverNo() = mrpCalverNo );
     if( isnull( oldRecords ) or oldRecords.Size() = 0 ) {
       pispips := ProductInStockingPointInPeriod::GetByMRPCalverNo( macroPlan, mrpCalverNo );
-      traverse( pispips, Elements, item ) {
+      traverse( pispips, Elements, item, item.NewSupplyQuantity() > 0 ) {
         PRData::FromSupplyPlanning( otdTable, macroPlan, mappingRoot, item );
       }
     }
diff --git a/_Main/BL/Type_PRHistoryData/Method_PrintCall.qbl b/_Main/BL/Type_PRHistoryData/Method_PrintCall.qbl
new file mode 100644
index 0000000..736d231
--- /dev/null
+++ b/_Main/BL/Type_PRHistoryData/Method_PrintCall.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Method PrintCall (
+  String callBy
+) as String
+{
+  TextBody:
+  [*
+    // yypsybs Sep-20-2023 (created)
+    result := this.GlobalOTDTable().PRHistoryData( relcopy, this );
+    
+    // 鏇存柊閮ㄥ垎
+    result.PRDataReleaseDate( Date::Today() );
+    result.ReleaseBy( callBy );
+    result.SendTime( DateTime::Now() );
+    
+    // 璇锋眰
+    request := ERPRequestOfPR::Create( result );
+    callString := request.GetCallJSONString();
+    request.Delete();
+    return callString;
+  *]
+}
diff --git a/_Main/BL/Type_ProductInStockingPointInPeriod/StaticMethod_GetByMRPCalverNo.qbl b/_Main/BL/Type_ProductInStockingPointInPeriod/StaticMethod_GetByMRPCalverNo.qbl
index 10c1f0c..482800c 100644
--- a/_Main/BL/Type_ProductInStockingPointInPeriod/StaticMethod_GetByMRPCalverNo.qbl
+++ b/_Main/BL/Type_ProductInStockingPointInPeriod/StaticMethod_GetByMRPCalverNo.qbl
@@ -9,9 +9,17 @@
   TextBody:
   [*
     // yypsybs Sep-12-2023 (created)
-    result := selectset( parent, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip,
+    result := construct( ProductInStockingPointInPeriods );
+    if( mrpCalverNo <> "" ) {
+      result := selectset( parent, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip,
                          pispip.ProductInStockingPoint_MP().Product_MP().ID().StartsWith( "E" )
-                         and pispip.MRPCalverNo() = mrpCalverNo );
+                         and pispip.MRPCalverNo() = mrpCalverNo 
+                           );
+    } else {
+      result := selectset( parent, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip,
+                         true
+                           );
+    }
     return &result;
   *]
 }
diff --git "a/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyByHalfYear\0431.qbl" "b/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyByHalfYear\0431.qbl"
new file mode 100644
index 0000000..d9e3137
--- /dev/null
+++ "b/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyByHalfYear\0431.qbl"
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetNewSupplyByHalfYear (
+  Strings productNo,
+  MacroPlan macroPlan,
+  Number yearNo,
+  Number halfNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    fromMonth := 1 + ( halfNo - 1 ) * 6;
+    toMonth := 6 + ( halfNo - 1 ) * 6;
+    result := 0.0;
+    for( i := fromMonth; i <= toMonth; i := i + 1 ) {
+      result := result + Product_MP::GetNewSupplyByMonth( productNo, macroPlan, yearNo, i );
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyBySeason.qbl b/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyBySeason.qbl
new file mode 100644
index 0000000..e98eabe
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/StaticMethod_GetNewSupplyBySeason.qbl
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetNewSupplyBySeason (
+  Strings productNo,
+  MacroPlan macroPlan,
+  Number yearNo,
+  Number seasonNo
+) as Real
+{
+  TextBody:
+  [*
+    // yypsybs Sep-18-2023 (created)
+    fromMonth := 1 + ( seasonNo - 1 ) * 3;
+    toMonth := 3 + ( seasonNo - 1 ) * 3;
+    result := 0.0;
+    for( i := fromMonth; i <= toMonth; i := i + 1 ) {
+      result := result + Product_MP::GetNewSupplyByMonth( productNo, macroPlan, yearNo, i );
+    }
+    return result;
+  *]
+}
diff --git a/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeChart.qbl b/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeChart.qbl
index 133fe60..43f414f 100644
--- a/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeChart.qbl
+++ b/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeChart.qbl
@@ -4,9 +4,9 @@
   MacroPlans macroPlans,
   Boolean isCapacity,
   String groupBy,
-  String byBusinessTypeOrByOrgCodde,
-  String businessType,
-  String orgCode,
+  String byBusinessTypeOrByOrgCode,
+  String businessTypeChosen,
+  String placeOfProductionOfArrayChosen,
   String year,
   MPSync mpSync,
   GlobalOTDTable otdTable,
@@ -17,13 +17,226 @@
   TextBody:
   [*
     // yypsybs Sep-19-2023 (created)
+    // true, false
+    info( isCapacity );
+    // 鏈�;瀛e害;鍗婂勾;骞�
+    info( groupBy );
+    // 闈㈡澘鍩哄湴;浜嬩笟閮�
+    info( byBusinessTypeOrByOrgCode );
+    info( businessTypeChosen );
+    info( placeOfProductionOfArrayChosen );
+    info( year );
+    
+    // ====娓呯悊鏃ф暟鎹�====
+    this.CapacityAndSaleBudgeChartRow( relflush );
     this.CapacityAndSaleBudgeChartElement( relflush );
     
-    info( isCapacity );
-    info( groupBy );
-    info( byBusinessTypeOrByOrgCodde );
-    info( businessType );
-    info( orgCode );
-    info( year );
+    // ====鎸夐潰鏉垮熀鍦板拰浜嬩笟閮ㄥ浜у搧杩涜绛涢�夊垎缁�====
+    historyData := selectset( otdTable, CapacityAndSaleBudge, item, true );
+    if( placeOfProductionOfArrayChosen <> "" ) {
+      historyData := selectset( historyData, Elements, item, item.PlaceOfProductionOfArray() = placeOfProductionOfArrayChosen );
+    }
+    if( businessTypeChosen <> "" ) {
+      historyData := selectset( historyData, Elements, item, item.BusinessType() = businessTypeChosen );
+    }
+    traverse( historyData, Elements, item ) {
+      row := CapacityAndSaleBudgeChartRow::CreateIfNotExist( this, item.BusinessType(), item.PlaceOfProductionOfArray() );
+      // 璁板綍姣忚鍖呭惈鍝簺product
+      CapacityAndSaleBudgeChartRowProduct::CreateIfNotExist( row, item.ProductCode() );
+    }
+    rows := selectset( this, CapacityAndSaleBudgeChartRow, item, true );
+    placeOfProductionOfArrayList := selectuniquevalues( historyData, Elements, item, item.PlaceOfProductionOfArray() );
+    businessTypeList := selectuniquevalues( historyData, Elements, item, item.BusinessType() );
+    // 鐢熸垚鍥捐〃鍏冪礌
+    if( byBusinessTypeOrByOrgCode = "闈㈡澘鍩哄湴" and groupBy = "骞�" ) {
+      // 鐩爣
+      traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
+        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
+        this.CapacityAndSaleBudgeChartElement( relnew, 
+                                               TimeStringAndScenarioName := [String]year + "骞�-鐩爣",
+                                               BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                               Quantity := ifexpr( isCapacity,
+                                                                   CapacityAndSaleBudge::GetSheetByYear( productCodeList, otdTable, [Number]year ),
+                                                                   MappingForecast::GetQuantityByYear( productCodeList, mappingParent, [Number]year ) )
+                                               );  
+          // S&OP
+        traverse( macroPlans, Elements, macroPlan ) {
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-" + macroPlan.ScenarioName(),
+                                                 BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, [Number]year ),
+                                                                     0.0 )
+                                                 ); 
+        }                    
+      }
+    } 
+    if ( byBusinessTypeOrByOrgCode = "闈㈡澘鍩哄湴" and groupBy = "鍗婂勾" ) {
+      for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
+        traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-" + ifexpr( halfNo = 1, "涓�", "涓�" ) + "鍗婂勾-鐩爣",
+                                                 BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, otdTable, [Number]year, halfNo ),
+                                                                     MappingForecast::GetQuantityByHalfYear( productCodeList, mappingParent, [Number]year, halfNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-" + ifexpr( halfNo = 1, "涓�", "涓�" ) + "鍗婂勾-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, [Number]year, halfNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
+    if ( byBusinessTypeOrByOrgCode = "闈㈡澘鍩哄湴" and groupBy = "瀛e害" ) {
+      for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
+        traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]seasonNo + "瀛e害-鐩爣",
+                                                 BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetBySeason( productCodeList, otdTable, [Number]year, seasonNo ),
+                                                                     MappingForecast::GetQuantityBySeason( productCodeList, mappingParent, [Number]year, seasonNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]seasonNo + "瀛e害-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, [Number]year, seasonNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
+    if ( byBusinessTypeOrByOrgCode = "闈㈡澘鍩哄湴" and groupBy = "鏈�" ) {
+      for( monthNo := 1; monthNo <= 12; monthNo := monthNo + 1 ) {
+        traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]monthNo + "鏈�-鐩爣",
+                                                 BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetByMonth( productCodeList, otdTable, [Number]year, monthNo ),
+                                                                     MappingForecast::GetQuantityByMonth( productCodeList, mappingParent, [Number]year, monthNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]monthNo + "鏈�-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := placeOfProductionOfArray, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, [Number]year, monthNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
+    if( byBusinessTypeOrByOrgCode = "浜嬩笟閮�" and groupBy = "骞�" ) {
+      // 鐩爣
+      traverse( businessTypeList, Elements, businessType ) {
+        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
+        this.CapacityAndSaleBudgeChartElement( relnew, 
+                                               TimeStringAndScenarioName := [String]year + "骞�-鐩爣",
+                                               BusinessTypeOrOrgCode := businessType, 
+                                               Quantity := ifexpr( isCapacity,
+                                                                   CapacityAndSaleBudge::GetSheetByYear( productCodeList, otdTable, [Number]year ),
+                                                                   MappingForecast::GetQuantityByYear( productCodeList, mappingParent, [Number]year ) )
+                                               );  
+          // S&OP
+        traverse( macroPlans, Elements, macroPlan ) {
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-" + macroPlan.ScenarioName(),
+                                                 BusinessTypeOrOrgCode := businessType, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, [Number]year ),
+                                                                     0.0 )
+                                                 ); 
+        }                    
+      }
+    } 
+    if ( byBusinessTypeOrByOrgCode = "浜嬩笟閮�" and groupBy = "鍗婂勾" ) {
+      for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
+        traverse( businessTypeList, Elements, businessType ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-" + ifexpr( halfNo = 1, "涓�", "涓�" ) + "鍗婂勾-鐩爣",
+                                                 BusinessTypeOrOrgCode := businessType, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetByHalfYear( productCodeList, otdTable, [Number]year, halfNo ),
+                                                                     MappingForecast::GetQuantityByHalfYear( productCodeList, mappingParent, [Number]year, halfNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-" + ifexpr( halfNo = 1, "涓�", "涓�" ) + "鍗婂勾-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := businessType, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, [Number]year, halfNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
+    if ( byBusinessTypeOrByOrgCode = "浜嬩笟閮�" and groupBy = "瀛e害" ) {
+      for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
+        traverse( businessTypeList, Elements, businessType ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]seasonNo + "瀛e害-鐩爣",
+                                                 BusinessTypeOrOrgCode := businessType, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetBySeason( productCodeList, otdTable, [Number]year, seasonNo ),
+                                                                     MappingForecast::GetQuantityBySeason( productCodeList, mappingParent, [Number]year, seasonNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]seasonNo + "瀛e害-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := businessType, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, [Number]year, seasonNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
+    if ( byBusinessTypeOrByOrgCode = "浜嬩笟閮�" and groupBy = "鏈�" ) {
+      for( monthNo := 1; monthNo <= 12; monthNo := monthNo + 1 ) {
+        traverse( businessTypeList, Elements, businessType ) {
+          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
+          this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                 TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]monthNo + "鏈�-鐩爣",
+                                                 BusinessTypeOrOrgCode := businessType, 
+                                                 Quantity := ifexpr( isCapacity,
+                                                                     CapacityAndSaleBudge::GetSheetByMonth( productCodeList, otdTable, [Number]year, monthNo ),
+                                                                     MappingForecast::GetQuantityByMonth( productCodeList, mappingParent, [Number]year, monthNo ) )
+                                                 );  
+            // S&OP
+          traverse( macroPlans, Elements, macroPlan ) {
+            this.CapacityAndSaleBudgeChartElement( relnew, 
+                                                   TimeStringAndScenarioName := [String]year + "骞�-绗�" + [String]monthNo + "鏈�-" + macroPlan.ScenarioName(),
+                                                   BusinessTypeOrOrgCode := businessType, 
+                                                   Quantity := ifexpr( isCapacity,
+                                                                       Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, [Number]year, monthNo ),
+                                                                       0.0 )
+                                                   ); 
+          }                    
+        }
+      }
+    }
   *]
 }
diff --git a/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeCompare.qbl b/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeCompare.qbl
index 7451626..a2a5dc7 100644
--- a/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeCompare.qbl
+++ b/_Main/BL/Type_ScenarioManager/Method_CapacityAndSaleBudgeCompare.qbl
@@ -72,7 +72,7 @@
       cell := columnOrgCode.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := row.OrgCode() );
       cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
     }
-    // 闈㈡澘鍒嗛厤閲� - 骞村害棰勭畻 
+    // 闈㈡澘鍒嗛厤閲� - 骞村害棰勭畻 (sheets)
     // 鏍煎紡锛� 闈㈡澘鍒嗛厤閲� - 骞� - 鏈堬紙1-12 & total锛� - 骞村害棰勭畻/scenarioName
     info( "dealing 闈㈡澘鍒嗛厤閲�" )
     if( CapacityAndSaleBudgeFilterItem::Contains( items, "闈㈡澘鍒嗛厤閲�" ) ) {
@@ -143,14 +143,14 @@
           traverse( months, Elements, month ) {
             columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-" + [String]month.MonthNo() + "鏈�-" + macroPlan.ScenarioName() );
             traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-              cellReal := MappingForecast::GetByMonth( row.GetProductCodes(), mappingParent, year.YearNo(), month.MonthNo() );
+              cellReal := MappingForecast::GetBalanceByMonth( row.GetProductCodes(), mappingParent, year.YearNo(), month.MonthNo() );
               cell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
               cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
             }
           }
           columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "瀵瑰閿�鍞-" + [String]year.YearNo() + "骞�-total-" + macroPlan.ScenarioName() );
           traverse( this, CapacityAndSaleBudgeCompareItemRow, row ) {
-            cellReal := MappingForecast::GetByYear( row.GetProductCodes(), mappingParent, year.YearNo() );
+            cellReal := MappingForecast::GetBalanceByYear( row.GetProductCodes(), mappingParent, year.YearNo() );
             cell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
             cell.CapacityAndSaleBudgeCompareItemRow( relset, row );
           }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_PanelPRDataButton.def b/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_PanelPRDataButton.def
index 97ad3ac..a803cba 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_PanelPRDataButton.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_PanelPRDataButton.def
@@ -13,7 +13,7 @@
       [
         Image: 'ARROW_RIGHT'
         Label: 'Send checked PRs'
-        Taborder: 0
+        Taborder: 1
       ]
     }
     Component ButtonExportPR
@@ -24,7 +24,18 @@
       [
         Image: 'EXPORT1'
         Label: '鏁版嵁瀵煎嚭'
-        Taborder: 1
+        Taborder: 2
+      ]
+    }
+    Component ButtonLoad
+    {
+      #keys: '[414384.0.859141085]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'THICK_ARROW_DOWN_BLUE'
+        Label: 'Clean & Load'
+        Taborder: 0
       ]
     }
   ]
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_listContextMenuPRData\0431.def" "b/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_listContextMenuPRData\0431.def"
index 204fe6d..b2ba89c 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_listContextMenuPRData\0431.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_Form633/Component_listContextMenuPRData\0431.def"
@@ -16,6 +16,17 @@
         Title: 'Send selected PRs'
       ]
     }
+    Component MenuPrintRequest
+    {
+      #keys: '[414384.0.859180964]'
+      BaseType: 'WebMenu'
+      Properties:
+      [
+        Image: 'MEDIA_PLAY_GREEN'
+        Taborder: 4
+        Title: 'Print request'
+      ]
+    }
   ]
   Properties:
   [
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_ListPRData_844_MenuPrintRequest_OnClick\043623.def" "b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_ListPRData_844_MenuPrintRequest_OnClick\043623.def"
new file mode 100644
index 0000000..ca3a5f2
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_ListPRData_844_MenuPrintRequest_OnClick\043623.def"
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: ListPRData_844
+Response OnClick (
+  PRData selection
+) id:Response_ListPRData_844_MenuPrintRequest_OnClick
+{
+  #keys: '[414384.0.859160768]'
+  CanBindMultiple: false
+  DefinitionID => /ListPRData_844/Responsedef_ListPRData_844_WebMenu_OnClick
+  Initiator: 'MenuPrintRequest'
+  Precondition:
+  [*
+    
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      info( selection.PrintCall( GlobalOTDTable, ApplicationMacroPlanner.GetUserName() ) )
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_OnCreated.def
index f626708..a2b42ff 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_OnCreated.def
@@ -10,13 +10,13 @@
   {
     Body:
     [*
-      if( not isnull( MacroPlan ) ) {
-        MacroPlan.PRData( relflush );
-        PRData::TestData( MacroPlan );
-      }
-      if( not isnull( GlobalOTDTable ) ) {
-        GlobalOTDTable.PRHistoryData( relflush );
-      }
+      //if( not isnull( MacroPlan ) ) {
+      //  MacroPlan.PRData( relflush );
+      //  PRData::TestData( MacroPlan );
+      //}
+      //if( not isnull( GlobalOTDTable ) ) {
+      //  GlobalOTDTable.PRHistoryData( relflush );
+      //}
     *]
   }
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_PanelPRDataButton_ButtonLoad_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_PanelPRDataButton_ButtonLoad_OnClick.def
new file mode 100644
index 0000000..5a0a69d
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Form633/Response_PanelPRDataButton_ButtonLoad_OnClick.def
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: PanelPRDataButton/ButtonLoad
+Response OnClick () id:Response_PanelPRDataButton_ButtonLoad_OnClick
+{
+  #keys: '[414384.0.859141084]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      MacroPlan.PRData( relflush );
+      PRData::FromSupplyPlanning( GlobalOTDTable, MacroPlan, MacroPlan, "" );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_ButtonCapacityAndSaleBudgeChartTest_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_ButtonCapacityAndSaleBudgeChartTest_OnClick.def
index 43d6bba..8011270 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_ButtonCapacityAndSaleBudgeChartTest_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_ButtonCapacityAndSaleBudgeChartTest_OnClick.def
@@ -17,7 +17,7 @@
                                                  DropDownTimeGroup.Text(),
                                                  DropDownByBusinessTypeOrByOrgCode.Text(),
                                                  DropDownBusinessTypes.Text(),
-                                                 DropDownOrgCodes.Text(),
+                                                 DropDownPlaceOfProductionOfArrays.Text(),
                                                  DropDownYears.Text(),
                                                  MPSync, 
                                                  GlobalOTDTable, 
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_OnCreated.def
index 0cf2128..ea33703 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_OnCreated.def
@@ -12,7 +12,7 @@
       CapacityAndSaleBudgeChartElement::TestData( ScenarioManager );
       
       DropDownBusinessTypes.Strings( GlobalOTDTable.CapacityAndSaleBudgeBusinessTypeString() );
-      DropDownOrgCodes.Strings( GlobalOTDTable.CapacityAndSaleBudgePlaceOfProductionOfArrayString() );
+      DropDownPlaceOfProductionOfArrays.Strings( GlobalOTDTable.CapacityAndSaleBudgePlaceOfProductionOfArrayString() );
       DropDownYears.Strings( GlobalOTDTable::CapacityAndSaleBudgeYearsString() );
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/_ROOT_Component_FormCapacityAndSaleBudgeChart.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/_ROOT_Component_FormCapacityAndSaleBudgeChart.def
index 26784de..456fb75 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/_ROOT_Component_FormCapacityAndSaleBudgeChart.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/_ROOT_Component_FormCapacityAndSaleBudgeChart.def
@@ -14,7 +14,7 @@
       BaseType: 'WebButton'
       Properties:
       [
-        Label: '娴嬭瘯鐢�'
+        Label: '鐢熸垚'
         Taborder: 6
       ]
     }
@@ -39,7 +39,7 @@
         Taborder: 3
       ]
     }
-    Component DropDownOrgCodes
+    Component DropDownPlaceOfProductionOfArrays
     {
       #keys: '[414384.0.857770736]'
       BaseType: 'WebDropDownStringList'
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Component_listContextMenuPRHistoryData\0431.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Component_listContextMenuPRHistoryData\0431.def"
index fd4d7de..f83c6e2 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Component_listContextMenuPRHistoryData\0431.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Component_listContextMenuPRHistoryData\0431.def"
@@ -16,6 +16,17 @@
         Title: 'Call'
       ]
     }
+    Component MenuPrintRequest
+    {
+      #keys: '[414384.0.860210718]'
+      BaseType: 'WebMenu'
+      Properties:
+      [
+        Image: 'MEDIA_PLAY_GREEN'
+        Taborder: 4
+        Title: 'Print request'
+      ]
+    }
   ]
   Properties:
   [
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Response_ListPRHistoryData_844_MenuPrintRequest_OnClick\043338.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Response_ListPRHistoryData_844_MenuPrintRequest_OnClick\043338.def"
new file mode 100644
index 0000000..58ad812
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Response_ListPRHistoryData_844_MenuPrintRequest_OnClick\043338.def"
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: ListPRHistoryData_844
+Response OnClick (
+  PRHistoryData selection
+) id:Response_ListPRHistoryData_844_MenuPrintRequest_OnClick
+{
+  #keys: '[414384.0.860210608]'
+  CanBindMultiple: false
+  DefinitionID => /ListPRHistoryData_844/Responsedef_ListPRHistoryData_844_WebMenu_OnClick
+  Initiator: 'MenuPrintRequest'
+  QuillAction
+  {
+    Body:
+    [*
+      info( selection.PrintCall( ApplicationMacroPlanner.GetUserName() ) )
+    *]
+    GroupServerCalls: false
+  }
+}

--
Gitblit v1.9.3