limj
2023-09-26 f144ca99e6b013ab135e72a50ceb19a351a79031
Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj
已重命名1个文件
已修改33个文件
已添加50个文件
已删除25个文件
2244 ■■■■■ 文件已修改
LibMacroPlanner/BL/Type_UnitPeriodTimeBase/Function_CalcTotalAvailableCapacity.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LibMacroPlannerOptimizer/BL/Type_CapacityPlanningSuboptimizer/Method_CapacityPlanningAlgorithmHandleFeasibleOperationDependentDemandInputG.qbl 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LibMacroPlannerOptimizer/BL/Type_SelectorFullPuzzle/Method_SetOptimizerInput.qbl 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/EDI/Broker_GlobalOTDTable_CustomerGrade.qbl 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/EDI/Broker_GlobalOTDTable_DOI_DSI.qbl 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_Global_MappingCustomerGrade_GlobalOTDTable_GlobalOTDTable_Global_Ma.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_Global_MappingDOI_DSI_GlobalOTDTable_GlobalOTDTable_Global_MappingD.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Relations/Relation_H_CustomOrder_MacroPlan_MacroPlan_H_CustomOrder.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResults/StaticMethod_CreateDate.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CustomerOrder/Attribute_OrderTag.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecuteFailure_GlobalOTDTable_CustomerGrade.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecuteFailure_GlobalOTDTable_DOI_DSI.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecute_GlobalOTDTable_CustomerGrade.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecute_GlobalOTDTable_DOI_DSI.qbl 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/StaticMethod_SynchronizationAllMappingBrokerAndAPI.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_BusinessType.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_Customer.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_CustomerGrade.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomerGrade/TypeIndex_Global_MappingCustomerGradeTypeIndex.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingCustomerGrade/_ROOT_Type_Global_MappingCustomerGrade.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_DOI.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_DSI.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_OrganCode.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_ProductID.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/TypeIndex_Global_MappingDOI_DSITypeIndex.qbl 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingDOI_DSI/_ROOT_Type_Global_MappingDOI_DSI.qbl 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFinishedGood.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_CustomOrder/_ROOT_Type_H_CustomOrder.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_NewStaticMethod.qbl 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo#1.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_MaterialReverse.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_UpdateOrderForecastRealQty.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_CustomCode.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_CustomID.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Department.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_ForecastQty.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Month.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_OrderCode.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_SKU.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_SKUName.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_StockingPointID.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Unit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_OrderForecastRealQty/Attribute_VCode.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/FunctionOverride_CalcStockLevelInDays.qbl 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Routing/Method_DoSanityCheckData.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Routing/Method_GetHasTianmaNonSupplierOperationWithNoInput.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_Unit/StaticMethod_CreateOrUpdate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditIssueWorkOrder/Response_pnlActions_btnOk_OnClick.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_ListSalesDemands.def 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_PanelAllSalesDemands.def 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_PanelSalesDemands.def 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/_ROOT_Component_FormCustomerOrders.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_ListSDIP.def 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_ListSalesDemands.def 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelAllSalesDemands.def 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelSDIP.def 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelSalesDemands.def 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuCopy_OnClick.def 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuCreate_OnClick#715.def 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuEdit_OnClick.def 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/_ROOT_Component_FormCustomerOrders226.def 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormIssueWorkOrder/Component_ListIssueWorkOrder.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormIssueWorkOrder/Response_ListIssueWorkOrder_MenuEdit_OnClick.def 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick#975.def 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel383.def 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel647.def 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel849.def 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_liH_Forecast.def 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_listActionBarPage963.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_listContextMenu687.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_list_ForecastView_FOF#670.def 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_OnCreated.def 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick#222.def 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Order_FOF449_OnClick#880.def 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_InitialData778_OnClick#971.def 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Query_FOF_OnClick.def 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel383_btn_Query_FOF_OnClick.def 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_Add_Material_FOF_OnClick.def 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_Add_Order_FOF_OnClick.def 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_InitialData_OnClick.def 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_list_ForecastView_FOF_OnDoubleClick.def 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_list_ForecastView_FOF_OnSelectionChanged.def 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/_ROOT_Component_FrmOrderForecast.def 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_ButtonERP订单_OnClick.def 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LibMacroPlanner/BL/Type_UnitPeriodTimeBase/Function_CalcTotalAvailableCapacity.qbl
@@ -16,7 +16,8 @@
                               
      if( not isnull( planningup ) )
      {
         value := planningup.BaseAvailableCapacity().HoursAsReal() * planningup.MaximumLoadPercentage() / 100;
         value := planningup.BaseAvailableCapacity().HoursAsReal() * planningup.MaximumLoadPercentage() / 100
                  * this.PlanningSystemRatio(); // Tianma fix 20230926
      }
    }
    else
LibMacroPlannerOptimizer/BL/Type_CapacityPlanningSuboptimizer/Method_CapacityPlanningAlgorithmHandleFeasibleOperationDependentDemandInputG.qbl
@@ -9,7 +9,6 @@
  Description: 'Assign the optimal quantity from optimizer for dependent demand in input group.'
  TextBody:
  [*
    // Tianma fix 20230727
    // Dependent demand of input group fulfillment
    ptperiod := periodtaskoperation.UnitPeriod().Period_MP();
    operation := periodtaskoperation.Operation();
@@ -19,6 +18,11 @@
              dd, 
              dd.HasRegularProductForOptimizer() or dd.OperationInput().GetIsProductInOptimizerRun( runcontext.IsPostProcessing() ) )
    {
      fulfilledqty := 0.0;
      if( operation.HasLeadTime() )     // Get the dependent demands that is located at different period from the period of period task.
      {
        // compute dependent demand periods
      pispipperiods := construct( Period_MPs, constcontent ); 
      if ( getfromperiodtask ) // in case we are able to get from period tasks, below method refinds periodtask for (operation, ptperiod) i.e. periodtaskoperation and then output dep.demand periods
      {
@@ -32,9 +36,6 @@
        CapacityPlanningSuboptimizer::GetOperationDependentDemandPeriods( ptperiod, operation, &pispipperiods, getfromperiodtask );
      }
      
      fulfilledqty := 0.0;
      if( operation.HasLeadTime() )     // Get the dependent demands that is located at different period from the period of period task.
      {
        fulfilledqty := sum( pispipperiods, Elements, pispipperiod,
                             this.GetOptimalValue( program.PartialOperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod, ptperiod ) ) );
        if ( runcontext.IsMetaIteration() and operation.IsBlending() ) // no filtering for numerical sensitive blending operation in meta optimizer
@@ -45,14 +46,14 @@
      }
      else
      {
        fulfilledqty := sum( pispipperiods, Elements, pispipperiod,
                             this.GetOptimalValue( program.OperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod ) ) );
        // note that in case there is no lead time then the set of dependent demand periods just equals the singleton set {ptperiod}
        fulfilledqty := this.GetOptimalValue( program.OperationDemandQtyVariables().Get( dd.OperationInput(), ptperiod ) );
        if( runcontext.IsMetaIteration() and operation.IsBlending() ) // no filtering for numerical sensitive blending operation in meta optimizer
        {
          fulfilledqty := sum( pispipperiods, Elements, pispipperiod,
                               this.GetOptimalValueUnfiltered( program.OperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod ) ) );
          fulfilledqty := this.GetOptimalValueUnfiltered( program.OperationDemandQtyVariables().Get( dd.OperationInput(), ptperiod ) );
        }
      }
      dd.OptimizerFulfilledQuantity( fulfilledqty );
    }
  *]
LibMacroPlannerOptimizer/BL/Type_SelectorFullPuzzle/Method_SetOptimizerInput.qbl
@@ -175,10 +175,12 @@
      
      if ( ddperiodstotal.Size() > 0 ) 
      {
        minstart := min( ddperiodstotal, Elements, p, p.Start() );
        minstartperiods := min( periods, Elements, p, p.Start() );
        pispiptoadd := selectset( operation, 
                                  OperationInput.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning, 
                                  pispip,
                                  ddperiodstotal.Find( pispip.Period_MP() ) > 0
                                  pispip.Start() >= minstart and pispip.Start() < minstartperiods // must add the entire block. Don't want gaps in the pispip horizon
                                  and ( pispip.HasRegularProductForOptimizer() or pispip.GetProductIsIncludedInOptimizerRun( runcontext.IsPostProcessing() ) ) 
                                  and not scope.Contains( pispip.PISPIPInOptimizerRun() ) )
                                    
_Main/BL/EDI/Broker_GlobalOTDTable_CustomerGrade.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
Quintiq file version 2.0
#parent: #root
EDIBroker GlobalOTDTable_CustomerGrade
{
  MDSDefinition: GlobalOTDTable
  TimeZone: 'ACT'
  UseOSTimeZone: false
  EDIModelLink.Destination Destination16
  {
    EDIMLTable Global_MappingCustomerGrade
    {
      PrimaryKeyColumns: BusinessType
      PrimaryKeyColumns: Customer
      PrimaryKeyColumns: CustomerGrade
      TargetType: Global_MappingCustomerGrade
      TypeIndex: Global_MappingCustomerGradeTypeIndex
      EDIMLColumn BusinessType { Attribute: BusinessType ValueType: String }
      EDIMLColumn Customer { Attribute: Customer ValueType: String }
      EDIMLColumn CustomerGrade { Attribute: CustomerGrade ValueType: String }
    }
  }
  EDIODBCLink.Source Source15
  {
    DataIntegrityStrategy: 'Disabled'
    SettingsEngineLink: 'domainmodel.ediremotedatasourcedefinition.remotestorage.oracle'
    EDIODBCLinkTable MID_CUSTOMERGRADE
    {
      OthersMayCreateTable: true
      OthersMayDeleteRow: true
      OthersMayDropTable: true
      OthersMayFlushTable: true
      OthersMayInsertRow: true
      Parameters: '/owner="OTD"'
      PrimaryKeyColumns: CUSTOMER
      RecordModificationHintStrategy: 'None'
      EDIODBCLinkColumn BUSINESSTYPE
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
      EDIODBCLinkColumn CUSTOMER
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
      EDIODBCLinkColumn CUSTOMERGRADE
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
    }
  }
  EDITransformation.Transformation Transformation15
  {
    EDITableTransformation
    {
      InputTable: MID_CUSTOMERGRADE
      OutputTable: Global_MappingCustomerGrade
      EDIColumnMatch { InputColumn: BUSINESSTYPE OutputColumn: BusinessType }
      EDIColumnMatch { InputColumn: CUSTOMER OutputColumn: Customer }
      EDIColumnMatch { InputColumn: CUSTOMERGRADE OutputColumn: CustomerGrade }
    }
  }
}
_Main/BL/EDI/Broker_GlobalOTDTable_DOI_DSI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
Quintiq file version 2.0
#parent: #root
EDIBroker GlobalOTDTable_DOI_DSI
{
  MDSDefinition: GlobalOTDTable
  TimeZone: 'ACT'
  UseOSTimeZone: false
  EDIModelLink.Destination Destination15
  {
    EDIMLTable Global_MappingDOI_DSI
    {
      PrimaryKeyColumns: OrganCode
      PrimaryKeyColumns: ProductID
      TargetType: Global_MappingDOI_DSI
      TypeIndex: Global_MappingDOI_DSITypeIndex
      EDIMLColumn DOI { Attribute: DOI ValueType: String }
      EDIMLColumn DSI { Attribute: DSI ValueType: String }
      EDIMLColumn OrganCode { Attribute: OrganCode ValueType: String }
      EDIMLColumn ProductID { Attribute: ProductID ValueType: String }
    }
  }
  EDIODBCLink.Source Source14
  {
    DataIntegrityStrategy: 'Disabled'
    SettingsEngineLink: 'domainmodel.ediremotedatasourcedefinition.remotestorage.oracle'
    EDIODBCLinkTable MID_DOI_DSI
    {
      OthersMayCreateTable: true
      OthersMayDeleteRow: true
      OthersMayDropTable: true
      OthersMayFlushTable: true
      OthersMayInsertRow: true
      Parameters: '/owner="OTD"'
      PrimaryKeyColumns: ORGANCODE
      PrimaryKeyColumns: PRODUCTID
      RecordModificationHintStrategy: 'None'
      EDIODBCLinkColumn DOI
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
      EDIODBCLinkColumn DSI
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
      EDIODBCLinkColumn ORGANCODE
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
      EDIODBCLinkColumn PRODUCTID
      {
        OthersMayUpdateColumn: true
        ValueType: String
      }
    }
  }
  EDITransformation.Transformation Transformation14
  {
    EDITableTransformation
    {
      InputTable: MID_DOI_DSI
      OutputTable: Global_MappingDOI_DSI
      EDIColumnMatch { InputColumn: DOI OutputColumn: DOI }
      EDIColumnMatch { InputColumn: DSI OutputColumn: DSI }
      EDIColumnMatch { InputColumn: ORGANCODE OutputColumn: OrganCode }
      EDIColumnMatch { InputColumn: PRODUCTID OutputColumn: ProductID }
    }
  }
}
_Main/BL/Relations/Relation_Global_MappingCustomerGrade_GlobalOTDTable_GlobalOTDTable_Global_Ma.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation Global_MappingCustomerGrade_GlobalOTDTable_GlobalOTDTable_Global_MappingCustomerGrade
{
  #keys: '1[414702.0.445485678]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide GlobalOTDTable
  {
    #keys: '3[414702.0.445485680][414702.0.445485679][414702.0.445485681]'
    Cardinality: '0to1'
    ObjectDefinition: Global_MappingCustomerGrade
    OwningSide: 'Reference'
  }
  RelationSide.RightSide Global_MappingCustomerGrade
  {
    #keys: '3[414702.0.445485683][414702.0.445485682][414702.0.445485684]'
    Cardinality: '1toN'
    ObjectDefinition: GlobalOTDTable
    OwningSide: 'Owned'
  }
}
_Main/BL/Relations/Relation_Global_MappingDOI_DSI_GlobalOTDTable_GlobalOTDTable_Global_MappingD.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation Global_MappingDOI_DSI_GlobalOTDTable_GlobalOTDTable_Global_MappingDOI_DSI
{
  #keys: '1[414702.0.445364657]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide GlobalOTDTable
  {
    #keys: '3[414702.0.445364659][414702.0.445364658][414702.0.445364660]'
    Cardinality: '0to1'
    ObjectDefinition: Global_MappingDOI_DSI
    OwningSide: 'Reference'
  }
  RelationSide.RightSide Global_MappingDOI_DSI
  {
    #keys: '3[414702.0.445364662][414702.0.445364661][414702.0.445364663]'
    Cardinality: '1toN'
    ObjectDefinition: GlobalOTDTable
    OwningSide: 'Owned'
  }
}
_Main/BL/Relations/Relation_H_CustomOrder_MacroPlan_MacroPlan_H_CustomOrder.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
Quintiq file version 2.0
#parent: #root
Relation H_CustomOrder_MacroPlan_MacroPlan_H_CustomOrder
{
  #keys: '1[414724.0.177854649]'
  DefaultRelationStrategy
  {
  }
  RelationSide.LeftSide MacroPlan
  {
    #keys: '3[414724.0.177854651][414724.0.177854650][414724.0.177854652]'
    Cardinality: '0to1'
    ObjectDefinition: H_CustomOrder
    OwningSide: 'Reference'
  }
  RelationSide.RightSide H_CustomOrder
  {
    #keys: '3[414724.0.177854654][414724.0.177854653][414724.0.177854655]'
    Cardinality: '1toN'
    ObjectDefinition: MacroPlan
    OwningSide: 'Owned'
  }
}
_Main/BL/Type_CapacityAllocationResults/StaticMethod_CreateDate.qbl
@@ -19,7 +19,7 @@
    
    traverse ( finaleProductInStockingPoint_MPs, Elements, fpispmp ) {
      capacityAllocationResultsRuleConfigurations := selectset( globalOTDTable, CapacityAllocationResultsRuleConfiguration, tempCARRC, tempCARRC.ModuleMaterialCode() = fpispmp.ProductID() and tempCARRC.StockingPointID() = fpispmp.StockingPointID() );
      info( "生产的产品:", fpispmp.ProductID(), "------产品在库存点-------:", fpispmp.StockingPointID() );
    //  info( "生产的产品:", fpispmp.ProductID(), "------产品在库存点-------:", fpispmp.StockingPointID() );
      traverse ( period_MPS, Elements, pmp ) {     
        // CapacityAllocationResults::IterativeGeneration( globalOTDTable, pisp, 1, null( NewSupply ), -1.0, pmp.StartDate() ); è€ç‰ˆ
        CapacityAllocationResults::IterativeGeneration2( globalOTDTable, fpispmp, pmp.StartDate(), capacityAllocationResultsRuleConfigurations, 0, null( NewSupply ), 0.0 );
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -13,7 +13,7 @@
  TextBody:
  [*
    numberOfLayers++;
    info( "目标时间:", targetDate.Format( "Y-M2-D2" ) );
    //info( "目标时间:", targetDate.Format( "Y-M2-D2" ) );
    info( pisp.Name() );
    traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, pispippl.Start().Date() = targetDate ) {
      traverse ( pispippl, NewSupply, ns, ns.Quantity() > 0 ) {
@@ -23,14 +23,17 @@
        
        ontype( ns.PeriodTask_MP() ) {
          PeriodTaskOperation as pto : {
            info( "Operation周期任务..." );
    //        info( "Operation周期任务..." );
            traverse ( ns, PeriodTask_MP.astype( PeriodTaskOperation ).DependentDemand, dd ) {
              if ( numberOfLayers = 1 ) {
                currentLayerDependentDemandQuantity := ns.Quantity();
              }
              currentLayerDependentDemandQuantity := currentLayerDependentDemandQuantity                     * 
                                                     ns.ProcessOutput().astype( OperationOutput ).Quantity() *
                                                     dd.ProcessInput().astype( OperationInput ).Quantity();
              info( "层数:", numberOfLayers, "    å½“前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    æ€»ä¾›åº”值:", ns.Quantity(), "    éœ€è¦ä¾›åº”值:", currentLayerDependentDemandQuantity,
                    "    å½“前需求pisp:", dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    éœ€æ±‚值:", currentLayerDependentDemandQuantity );
              info( "-----------------------------------------------------------------------------------------------------------------" );
    //          info( "层数:", numberOfLayers, "    å½“前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    æ€»ä¾›åº”值:", ns.Quantity(), "    éœ€è¦ä¾›åº”值:", currentLayerDependentDemandQuantity,
    //                "    å½“前需求pisp:", dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    éœ€æ±‚值:", currentLayerDependentDemandQuantity );
    //          info( "-----------------------------------------------------------------------------------------------------------------" );
              CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
                                                               dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
                                                               targetDate,
@@ -42,7 +45,7 @@
            }
            carrc := select( carrcs, Elements, carrc, carrc.PanelMaterialCode() = ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() );
            if ( not isnull( carrc ) ) {
              info( "找到面板物料..." );
    //          info( "找到面板物料..." );
              globalOTDTable.CapacityAllocationResults( relnew,
                                                        PanelBase             := pto.Operation().UnitID(),
                                                        PanelMaterialCode     := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
@@ -58,7 +61,7 @@
                                                        Description           := "",
                                                        ID                    := OS::GenerateGUIDAsString(),
                                                        ProductID             := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                        StockingPointID       := "",
                                                        StockingPointID       := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().StockingPointID(),
                                                        UserQuantity          := currentLayerDependentDemandQuantity,
                                                        ManufacturedDate      := Date::MinDate()
                                                       );
@@ -70,9 +73,9 @@
          PeriodTaskLaneLeg as ptll : {
            targetDependentDemand := select( ptll, DependentDemand, dd, dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() = ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() );
            currentLayerDependentDemandQuantity := ifexpr( numberOfLayers = 1, targetDependentDemand.Quantity(), currentLayerDependentDemandQuantity );
            info( "层数:", numberOfLayers,"    å½“前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    æ€»ä¾›åº”值:", ns.Quantity(), "    éœ€è¦ä¾›åº”值:", currentLayerDependentDemandQuantity,
                  "    å½“前需求pisp:", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    éœ€æ±‚值:", currentLayerDependentDemandQuantity );
            info( "LaneLeg周期任务..." );
    //        info( "层数:", numberOfLayers,"    å½“前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    æ€»ä¾›åº”值:", ns.Quantity(), "    éœ€è¦ä¾›åº”值:", currentLayerDependentDemandQuantity,
    //              "    å½“前需求pisp:", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    éœ€æ±‚值:", currentLayerDependentDemandQuantity );
    //        info( "LaneLeg周期任务..." );
            info( "-----------------------------------------------------------------------------------------------------------------" );
            CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
                                                             targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
_Main/BL/Type_CustomerOrder/Attribute_OrderTag.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute OrderTag
{
  #keys: '3[414724.0.177854629][414724.0.177854628][414724.0.177854630]'
  Description: '订单状态,冲减后赋值,纯预测,有预测,无预测,反签,授权'
  ValueType: String
}
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecuteFailure_GlobalOTDTable_CustomerGrade.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: #root
Method OnAsyncExecuteFailure_GlobalOTDTable_CustomerGrade (
  Number errorNo,
  String errorMessage
)
{
  TextBody:
  [*
    this.Global_BrokerExecuteLog( relnew,
                                  BrokerName    := "GlobalOTDTable_CustomerGrade",
                                  ElementTotal  := 0,
                                  ErrorMessage  := errorMessage,
                                  IsSuccess     := false,
                                  Name          := "客户等级数据",
                                  ErrorNo       := errorNo,
                                  ErrorDateTime := DateTime::ActualTime().Format( "Y-M-D H2:m:s" )
                                 );
  *]
}
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecuteFailure_GlobalOTDTable_DOI_DSI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: #root
Method OnAsyncExecuteFailure_GlobalOTDTable_DOI_DSI (
  Number errorNo,
  String errorMessage
)
{
  TextBody:
  [*
    this.Global_BrokerExecuteLog( relnew,
                                  BrokerName    := "GlobalOTDTable_DOI_DSI",
                                  ElementTotal  := 0,
                                  ErrorMessage  := errorMessage,
                                  IsSuccess     := false,
                                  Name          := "DOI_DSI数据",
                                  ErrorNo       := errorNo,
                                  ErrorDateTime := DateTime::ActualTime().Format( "Y-M-D H2:m:s" )
                                 );
  *]
}
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecute_GlobalOTDTable_CustomerGrade.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method OnAsyncExecute_GlobalOTDTable_CustomerGrade
{
  TextBody:
  [*
    this.Global_BrokerExecuteLog( relnew,
                                  BrokerName      := "GlobalOTDTable_CustomerGrade",
                                  ElementTotal    := this.Global_MappingCustomerGrade( relsize ),
                                  ErrorMessage    := "",
                                  IsSuccess       := true,
                                  Name            := "客户等级数据",
                                  SuccessDateTime := DateTime::ActualTime().Format( "Y-M-D H2:m:s" ),
                                  ErrorNo         := 0
                                 );
  *]
}
_Main/BL/Type_GlobalDTOTable/Method_OnAsyncExecute_GlobalOTDTable_DOI_DSI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
Quintiq file version 2.0
#parent: #root
Method OnAsyncExecute_GlobalOTDTable_DOI_DSI
{
  TextBody:
  [*
    this.Global_BrokerExecuteLog( relnew,
                                  BrokerName      := "GlobalOTDTable_DOI_DSI",
                                  ElementTotal    := this.Global_MappingDOI_DSI( relsize ),
                                  ErrorMessage    := "",
                                  IsSuccess       := true,
                                  Name            := "DOI_DSI数据",
                                  SuccessDateTime := DateTime::ActualTime().Format( "Y-M-D H2:m:s" ),
                                  ErrorNo         := 0
                                 );
  *]
}
_Main/BL/Type_GlobalDTOTable/Method_SetIsLinkedWithFinishedGoodAttributes.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes
{
  Description: 'Method to traverse the supply chain to determine if there are any products that are not used to produce finished goods.'
  TextBody:
  [*
    // Reset IsLinkedWithFinishedGood
    traverse( this, Global_MappingProduct_MP, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
    }
    traverse( this, Global_MappingOperation, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
    }
    traverse( this, Global_MappingOperationBOM, instance )
    {
      instance.IsLinkedWithFinishedGood( false );
    }
    productspool := selectset( this, Global_MappingProduct_MP, product,
                               product.ProductMajorType() <> "成品" );
    operationspool := this.Global_MappingOperation( relget );
    operationbomspool := this.Global_MappingOperationBOM( relget );
    // Traverse each finished good and search for linked products/operations/lanes
    traverse( this, Global_MappingProduct_MP, product,
              product.ProductMajorType() = "成品" )
    {
      product.SetIsLinkedWithFinishedGoodAttributes_Recursive( 0, // depth
                                                               100, // maxdepth
                                                               productspool,
                                                               operationspool,
                                                               operationbomspool );
    }
  *]
}
_Main/BL/Type_GlobalDTOTable/StaticMethod_SynchronizationAllMappingBrokerAndAPI.qbl
@@ -25,6 +25,8 @@
    globalOTDTable.Global_MappingOperationCost( relflush );
    globalOTDTable.Global_MappingForecast( relflush );
    globalOTDTable.Global_MappingCustomOrder( relflush );
    globalOTDTable.Global_MappingDOI_DSI( relflush );
    globalOTDTable.Global_MappingCustomerGrade( relflush );
    
    globalOTDTable.GlobalOTDTable_UnitOfMeasure_MP().AsyncExecute();
    globalOTDTable.GlobalOTDTable_SalesSegment_MP().AsyncExecute();
@@ -44,5 +46,7 @@
    globalOTDTable.GlobalOTDTable_OperationCost().AsyncExecute();
    globalOTDTable.GlobalOTDTable_Forecast().AsyncExecute();
    globalOTDTable.GlobalOTDTable_CustomOrder().AsyncExecute();
    globalOTDTable.GlobalOTDTable_DOI_DSI().AsyncExecute();
    globalOTDTable.GlobalOTDTable_CustomerGrade().AsyncExecute();
  *]
}
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_BusinessType.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Attribute BusinessType
{
  #keys: '3[414702.0.445738362][414702.0.445738361][414702.0.445738363]'
  Description: '事业部'
  IsReadOnly: true
  ValueType: String
}
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_Customer.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Attribute Customer
{
  #keys: '3[414702.0.445738352][414702.0.445738351][414702.0.445738353]'
  Description: '客户名称'
  IsReadOnly: true
  ValueType: String
}
_Main/BL/Type_Global_MappingCustomerGrade/Attribute_CustomerGrade.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Attribute CustomerGrade
{
  #keys: '3[414702.0.445738372][414702.0.445738371][414702.0.445738373]'
  Description: '客户等级'
  IsReadOnly: true
  ValueType: String
}
_Main/BL/Type_Global_MappingCustomerGrade/TypeIndex_Global_MappingCustomerGradeTypeIndex.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: #root
TypeIndex Global_MappingCustomerGradeTypeIndex
{
  Attributes:
  [
    TypeIndexAttribute
    {
      ModelElement: BusinessType
    }
    TypeIndexAttribute
    {
      ModelElement: Customer
    }
    TypeIndexAttribute
    {
      ModelElement: CustomerGrade
    }
  ]
}
_Main/BL/Type_Global_MappingCustomerGrade/_ROOT_Type_Global_MappingCustomerGrade.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
Type Global_MappingCustomerGrade
{
  #keys: '5[414702.0.445485672][414702.0.445485670][0.0.0][414702.0.445485671][414702.0.445485673]'
  BaseType: Object
  StructuredName: 'Global_MappingCustomerGrades'
}
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_DOI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute DOI
{
  #keys: '3[414702.0.445364709][414702.0.445364708][414702.0.445364710]'
  Description: '库存周转天数'
  ValueType: String
}
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_DSI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute DSI
{
  #keys: '3[414702.0.445364719][414702.0.445364718][414702.0.445364720]'
  Description: '库存可售天数'
  ValueType: String
}
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_OrganCode.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Attribute OrganCode
{
  #keys: '3[414702.0.445364699][414702.0.445364698][414702.0.445364700]'
  Description: '组织编码'
  IsReadOnly: true
  ValueType: String
}
_Main/BL/Type_Global_MappingDOI_DSI/Attribute_ProductID.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#parent: #root
Attribute ProductID
{
  #keys: '3[414702.0.445364677][414702.0.445364676][414702.0.445364678]'
  Description: '物料编码'
  IsReadOnly: true
  ValueType: String
}
_Main/BL/Type_Global_MappingDOI_DSI/TypeIndex_Global_MappingDOI_DSITypeIndex.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
Quintiq file version 2.0
#parent: #root
TypeIndex Global_MappingDOI_DSITypeIndex
{
  Attributes:
  [
    TypeIndexAttribute
    {
      ModelElement: ProductID
    }
    TypeIndexAttribute
    {
      ModelElement: OrganCode
    }
  ]
}
_Main/BL/Type_Global_MappingDOI_DSI/_ROOT_Type_Global_MappingDOI_DSI.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
Type Global_MappingDOI_DSI
{
  #keys: '5[414702.0.445364654][414702.0.445364652][0.0.0][414702.0.445364653][414702.0.445364655]'
  BaseType: Object
  StructuredName: 'Global_MappingDOI_DSIs'
}
_Main/BL/Type_Global_MappingOperation/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180207][157968.0.1145180206][157968.0.1145180208]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingOperationBOM/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180190][157968.0.1145180189][157968.0.1145180191]'
  Description: 'Updated procedurally for checking whether this object is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Attribute_IsLinkedWithFinishedGood.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute IsLinkedWithFinishedGood
{
  #keys: '3[157968.0.1145180168][157968.0.1145180167][157968.0.1145180169]'
  Description: 'Updated procedurally for checking whether this product is used to produce a finished good.'
  ValueType: Boolean
}
_Main/BL/Type_Global_MappingProduct_MP/Method_SetIsLinkedWithFinishedGoodAttributes_Recursive.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
Quintiq file version 2.0
#parent: #root
Method SetIsLinkedWithFinishedGoodAttributes_Recursive (
  Number depth,
  Number maxdepth,
  Global_MappingProduct_MPs productspool,
  Global_MappingOperations operationspool,
  Global_MappingOperationBOMs operationbomspool
)
{
  Description: 'Method to traverse the supply chain recursively to determine if there are any products that are not used to produce finished goods.'
  TextBody:
  [*
    if( not this.IsLinkedWithFinishedGood() )
    {
      depth := depth + 1;
      this.IsLinkedWithFinishedGood( true );
      if( depth <= maxdepth )
      {
        operations := selectset( operationspool, Elements, operation,
                                 not operation.IsLinkedWithFinishedGood()
                                 and operation.BusinessType() = this.BusinessType()
                                 and operation.ProductID() = this.ID() );
        operationspool.Remove( operations );
        traverse( operations, Elements, operation )
        {
          operation.IsLinkedWithFinishedGood( true );
          operationboms := selectset( operationbomspool, Elements, operationbom,
                                      not operationbom.IsLinkedWithFinishedGood()
                                      and operationbom.BusinessType() = operation.BusinessType()
                                      and operationbom.OrganCode() = operation.OrganCode()
                                      and operationbom.ProcessSection() = operation.ProcessSection()
                                      and operationbom.ProductCode() = operation.ProductID() );
          operationbomspool.Remove( operationboms );
          traverse( operationboms, Elements, operationbom )
          {
            operationbom.IsLinkedWithFinishedGood( true );
            componentproduct := Global_MappingProduct_MP::FindTypeIndexIDAndBusinessType( operationbom.ComponentCode(),
                                                                                          operationbom.BusinessType() );
            if( guard( not componentproduct.IsLinkedWithFinishedGood(), false ) )
            {
              productspool.Remove( componentproduct );
              componentproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive( depth,
                                                                                maxdepth,
                                                                                productspool,
                                                                                operationspool,
                                                                                operationbomspool );
            }
            if( operationbom.AlternativeMaterialCode() <> ""
                and operationbom.AlternativeMaterialCode() <> operationbom.ComponentCode() )
            {
              alternativeproduct := Global_MappingProduct_MP::FindTypeIndexIDAndBusinessType( operationbom.AlternativeMaterialCode(),
                                                                                              operationbom.BusinessType() );
              if( guard( not alternativeproduct.IsLinkedWithFinishedGood(), false ) )
              {
                productspool.Remove( alternativeproduct );
                alternativeproduct.SetIsLinkedWithFinishedGoodAttributes_Recursive( depth,
                                                                                    maxdepth,
                                                                                    productspool,
                                                                                    operationspool,
                                                                                    operationbomspool );
              }
            }
          }
        }
      }
      else
      {
        debuginfo( "Product:", this.ID(),
                   "| BusinessType:", this.BusinessType(),
                   "| Max depth reached, stop searching... (", depth, ")" );
      }
    }
  *]
}
_Main/BL/Type_H_CustomOrder/_ROOT_Type_H_CustomOrder.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
Type H_CustomOrder
{
  #keys: '5[414724.0.177854646][414724.0.177854644][0.0.0][414724.0.177854645][414724.0.177854647]'
  BaseType: Object
  Description: '重建后的订单'
  StructuredName: 'H_CustomOrders'
}
_Main/BL/Type_H_FunctionClass/StaticMethod_NewStaticMethod.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl
@@ -1,17 +1,17 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SM_GetBOMBySKU (
  MacroPlan Owner,
  GlobalOTDTable GlobData,
  String SKU
) as MappingBOM
) as Global_MappingOperationBOM
{
  Description: '根据SKU获取BOM'
  TextBody:
  [*
    Obj :=null( MappingBOM,constcontent );
    if( not isnull( Owner) and SKU.Length()>0)
    Obj :=null( Global_MappingOperationBOM,constcontent );
    if( not isnull( GlobData) and SKU.Length()>0)
    {
      Obj := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU);
      Obj := select( GlobData,Global_MappingOperationBOM,ObjM,ObjM.ProductCode()=SKU);
    }
    return Obj;
  *]
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -6,7 +6,8 @@
  Number ProductQty,
  String ForecastId,
  String VCode,
  Date NDate
  Date NDate,
  GlobalOTDTable GlobData
) as owning JSON
{
  Description: '获取物料信息'
@@ -26,15 +27,15 @@
      if( Owner.MappingBOM(relsize )>0)
      {
        // å¾—到下一级数据
        AllData:= selectset( Owner, MappingBOM,object,object.ComponentCode()=ParentSKU);
        ObjProduct := null( MappingProduct,constcontent );
        AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ComponentCode()=ParentSKU);
        ObjProduct := null( Product_MP,constcontent );
        ObjUnit := null( Unit,constcontent );
        MaterialType:="";
        MaterialName:="-";
        StockPoint := "";
        NRate:=1.0;
        NComponentsUsed :=0.0;
        ObjBOM := H_FunctionClass::SM_GetBOMBySKU( Owner,ParentSKU);
        ObjBOM := H_FunctionClass::SM_GetBOMBySKU(GlobData,ParentSKU);
        if(not isnull( ObjBOM))
        {
          NRate := ObjBOM.ComponentOutputRate();
@@ -59,7 +60,7 @@
              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner, Obj.ProductCode());
              if( not isnull( ObjProduct))
              {
                MaterialType:= ObjProduct.ProductMajorType();
                MaterialType:= ObjProduct.ParentID();
                MaterialName:=ObjProduct.Name();
              }
              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode());
@@ -87,6 +88,10 @@
                                    ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := "原材料",NeedDate := NDate
                                    ,NeedQty := [Number](ProductQty*0.8).Round( 0),Unit := "PCS"
                                    ,StockPoint :="测试",MaterialName := "测试数据" );
        Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := "SKU_M"+ (nCount+1).AsQUILL() ,ForecastID := ForecastId,OrgCode := "ORG_000",VCode := VCode
                                    ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := "半成品",NeedDate := NDate
                                    ,NeedQty := [Number](ProductQty*0.8).Round( 0),Unit := "PCS"
                                    ,StockPoint :="测试",MaterialName := "测试数据" );
      }
      bStatus := true;
      strMsg :="";
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo#1.qbl
@@ -3,16 +3,17 @@
StaticMethod SM_GetProductInfo (
  MacroPlan Owner,
  String SKU
) as MappingProduct
) as Product_MP
{
  Description: '根据SKU获取物料信息'
  TextBody:
  [*
    // æ ¹æ®SKU获取物料信息
    Obj := null( MappingProduct,constcontent );
    // æ³¨æ„ï¼šç‰©æ–™ç±»åž‹å– ParentID
    Obj := null( Product_MP,constcontent );
    if( not isnull( Owner) and SKU.Length()>0)
    {
      Obj:= select( Owner,MappingProduct,ObjMP,ObjMP.ID()=SKU);
      Obj:= select( Owner,Product_MP,ObjMP,ObjMP.ID()=SKU);
    }
    return Obj;
  *]
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl
@@ -2,7 +2,8 @@
#parent: #root
StaticMethod SM_InitialForcastDataEx (
  MacroPlan Owner,
  Boolean IsNew
  Boolean IsNew,
  String VersionCode
) as owning JSON
{
  Description: '初始化订单预测信息'
@@ -11,36 +12,46 @@
    /**********************************初始化订单预测信息***************************************
    *注:未确定上游预测订单更新逻辑和数据有效性,这里进行二次处理,新生成一个列表,避免上游信息变动严重
    *    å½±å“åŠŸèƒ½
    *
    *参数:IsNew æ˜¯å¦æ—¶å…¨æ–°æ•°æ®ï¼Œå…¨æ–°æ•°æ®ä¼šå°†æ—§çš„æ•°æ®æ¸…除,然后重新填充,不是全新数据,将累计和更新
    *****************************************************************************************/
    // åˆå§‹åŒ–结果
    bStatus := false;
    strMsg :="";
    
    try{
      // æ¸…除旧数据,重新拉取
      if(Owner.H_Forecast(relget ).Size()>0)
      // 20230925 ä¼˜åŒ–的业务逻辑,如果时新数据,则预测数据全部干掉,然后重新生成
      if( IsNew)
      {
        traverse( Owner,H_Forecast,Obj,not isnull( Obj))
        if( Owner.H_OrderForecastRealQty(relsize )>0)
        {
          Owner.H_Forecast(reldelete, Obj);
          traverse( Owner,H_OrderForecastRealQty,Obj,not isnull( Obj))
          {
            Owner.H_OrderForecastRealQty(reldelete, Obj);
          }
        }
      }
      
      // èŽ·å–é¢„æµ‹è®¢å•ï¼šå½“æœˆå’Œä¹‹åŽçš„3个月预测数据 ä¸”预测数量>0的
      AllData:= selectset( Owner, Product_MP.SalesDemand.astype( Forecast ),object,object.EndDate().DateTime().Date() >= Date::ActualDate().StartOfMonth()
                           and object.EndDate().DateTime().Date() <= Date::ActualDate().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth()
      AllData:= selectset( Owner, Product_MP.SalesDemand.astype( Forecast ),object,
                           object.EndDate().DateTime().Date() >= Date::ActualDate().StartOfMonth()
                           // éœ€æ±‚给未来4个月的数据,但可能并不准确,暂时注释掉,四个月限制
                           //and object.EndDate().DateTime().Date() <= Date::ActualDate().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth()
                           and object.Quantity()>0 );
      
      CustomName:="";
      DepartMent:="";
      idx:=0;
      strOrderCode:="";
      RQty:=0;
      ObjOrderRealQty:=null( H_OrderForecastRealQty,constcontent );
    //  ObjPruduct :=null( MappingProduct,constcontent );
      SKU:="";
      SKUName := "";
      traverse( AllData,Elements,Obj,not isnull(Obj))
      {
        // æ²¡æœ‰å®¢æˆ·ä¿¡æ¯å’Œéƒ¨é—¨ä¿¡æ¯ï¼ŒSalesSegmentName=事业部+“-”+客户名称
        CustomName := Obj.SalesSegmentName();
        DepartMent := Obj.SalesSegmentName();
        SKU :=Obj.ProductID();
        // è¿™é‡Œç”¨æŸ¥æ‰¾åŽæˆªå–,因为不确定有几个横线,以第一个为准
        idx:=Obj.SalesSegmentName().FindString( "-",0);
        if(idx>0)
@@ -48,61 +59,40 @@
          DepartMent:=Obj.SalesSegmentName().SubString( 0,idx);
          CustomName := Obj.SalesSegmentName().SubString( idx+1, Obj.SalesSegmentName().Length() - (idx+1));
        }
        else
        // èŽ·å–ç‰©æ–™ä¿¡æ¯
        ObjMaterial := H_FunctionClass::SM_GetProductInfo( Owner,Obj.ProductID());
        if(not isnull( ObjMaterial))
        {
          CustomName :=Obj.SalesSegmentName();
          DepartMent := "部门数据获取失败!"
          SKUName := ObjMaterial.Name();
        }
    //    // ä»Žç‰©æ–™è¡¨èŽ·å–ç‰©æ–™ä¿¡æ¯
    //    ObjPruduct := H_FunctionClass::SM_GetProductInfo( Owner,Obj.ProductID());
    //    if( not isnull( ObjPruduct))
    //    {
    //
    //    }
         // å†™å…¥é¢„测订单信息表
         strOrderCode:=H_FunctionClass::SM_GenerateID( "OF");
         Owner.H_Forecast(relnew,OrderCode := strOrderCode,
                                SKU := Obj.ProductID(),
                               CustomCode := CustomName,
                               CustomName := CustomName,
                               Util:=Obj.UnitOfMeasureName(),
                               NeedTime:=Obj.EndDate(),
                               ForecastQty:=[Number]Obj.Quantity().Round( 0),
                               StockingPointID := Obj.StockingPointID(),
                               Department:=DepartMent);
         // å†™å…¥é¢„测实时信息
         ObjOrderRealQty := select( Owner,H_OrderForecastRealQty,ObjO,ObjO.CustomID()=CustomName and ObjO.SKU()=Obj.ProductID()
         // æ›´æ–°é¢„测信息,非新数据更新信息。
         ObjOrderRealQty := select( Owner,H_OrderForecastRealQty,ObjO,ObjO.CustomCode()=CustomName and ObjO.SKU()=Obj.ProductID()
                                    and ObjO.Month().StartOfMonth() = Obj.EndDate().StartOfMonth() )
         if( isnull( ObjOrderRealQty))
         if( IsNew or isnull( ObjOrderRealQty))
         {
             Owner.H_OrderForecastRealQty(relnew,CustomID := CustomName,CustomName := CustomName,ForecatsQty := [Number]Obj.Quantity().Round( 0)
           Owner.H_OrderForecastRealQty(relnew,CustomCode := CustomName,CustomName := CustomName,ForecastQty := [Number]Obj.Quantity().Round( 0)
                                           ,ForecatsRealQty := [Number]Obj.Quantity().Round( 0),ID := H_FunctionClass::SM_GenerateID( "OR")
                                           ,Month := Obj.EndDate(),OrderCode := strOrderCode,SKU := Obj.ProductID(),Unit := Obj.UnitOfMeasureName());
                                         ,Month := Obj.EndDate(),SKU := Obj.ProductID(),Unit := Obj.UnitOfMeasureName()
                                         ,Department := DepartMent,VCode := VersionCode,SKUName := SKUName);
         }
         else
         {
           if( IsNew)
           // æ›´æ–°äº†é¢„测数据,则计算实时数据增减
            if( [Number]Obj.Quantity().Round( 0)<> ObjOrderRealQty.ForecastQty())
           {
              ObjOrderRealQty.ForecatsQty([Number]Obj.Quantity().Round( 0));
              ObjOrderRealQty.ForecatsRealQty([Number]Obj.Quantity().Round( 0));
           }
           else
           {
              if( [Number]Obj.Quantity().Round( 0)<> ObjOrderRealQty.ForecatsQty())
              {
                    RQty := [Number]Obj.Quantity().Round( 0) - ObjOrderRealQty.ForecatsQty();
                  RQty := [Number]Obj.Quantity().Round( 0) - ObjOrderRealQty.ForecastQty();
                    RQty := ObjOrderRealQty.ForecatsRealQty() + RQty;
                    if( RQty<0)
                    {
                        RQty :=0;
                    }
                    ObjOrderRealQty.ForecatsQty([Number]Obj.Quantity().Round( 0));
                  ObjOrderRealQty.ForecastQty([Number]Obj.Quantity().Round( 0));
                    ObjOrderRealQty.ForecatsRealQty(RQty);
              }
           }
         }
      }
      
      bStatus := true;
      strMsg :="订单预测初始化成功!";
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_MaterialReverse.qbl
@@ -39,7 +39,7 @@
        nNoHaveForecastQty:=0;//五预测数量
        // èŽ·å–é¢„æµ‹æ•°é‡ï¼ˆå®¢æˆ·+SKU+月份 ç†è®ºæ˜¯æ²¡æœ‰ç‰©æ–™é¢„测)
        OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = SKU 
                                              and Obj.CustomID() = CustomerCode
                                              and Obj.CustomCode() = CustomerCode
                                              and Obj.Month().Format( "YM2") = Date::ActualDate().Format( "YM2"));                                   
        if ( not isnull(OrderForecast))
        {
@@ -195,10 +195,9 @@
          {
            Owner.H_OrderForecastRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "OF"),SKU := SKU,
                                                                                            Month := Date::ActualDate(),
                                                                                            CustomID := CustomerCode,
                                                                                            CustomCode := CustomerCode,
                                                                                            CustomName := "客户表获取",
                                                                                            OrderCode := "-",
                                                                                            ForecatsQty :=0,
                                                                                            ForecastQty := 0,
                                                                                            ForecatsRealQty :=nForecastQtyNew,
                                                                                            Unit := "SKU åˆ°ç‰©æ–™è¡¨èŽ·å–");
          } 
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
@@ -26,10 +26,27 @@
      if( not isnull( Owner))
      {
        // åˆå§‹åŒ–预测信息
        JResult := H_FunctionClass::SM_InitialForcastDataEx( Owner,IsNew);
        JResult := H_FunctionClass::SM_InitialForcastDataEx( Owner,IsNew,"--");
        // é¢„测初始化完成
        if( JResult.Get( "Status").GetBoolean())
        {
          traverse( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,not isnull( ObjOrder))
          nForecastQtyOld := 0; //原预测数量
          nReverseQtyOld :=0;   //原反签数量
          nAuthorizeQtyOld :=0; //原授权数量
          nForecastQtyNew :=0;  //计算后的预测数量
          nReverseQtyNew :=0;   //计算后的反签数量
          nAuthorizeQtyNew :=0; //计算后的授权数量
          nHaveForecastQty :=0; //有预测数量
          nNoHaveForecastQty:=0;//五预测数量
          OrderQuantity := 0;   //剩余订单数量
          traverse( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder)
          {
            // ç›´æŽ¥åˆ é™¤æœ¬æœˆä¹‹å‰çš„订单
            if( ObjOrder.EndDate()<Date::ActualDate().StartOfMonth())
            {
               ObjOrder.Delete();
            }
            else
          {
            //----------------------------------------以下后去预测 åç­¾ æŽˆæƒæ•°æ®ä¿¡æ¯----------------
            nForecastQtyOld := 0; //原预测数量
@@ -41,17 +58,15 @@
            nHaveForecastQty :=0; //有预测数量
            nNoHaveForecastQty:=0;//五预测数量
            OrderQuantity := 0;   //剩余订单数量
            // èŽ·å–é¢„æµ‹æ•°é‡ï¼ˆå®¢æˆ·+SKU+月份 ç†è®ºæ˜¯æ²¡æœ‰ç‰©æ–™é¢„测)
            OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
                                                  and Obj.CustomID() = ObjOrder.CustomerName()
                                                    and Obj.CustomCode() = ObjOrder.CustomerName()
                                                  and Obj.Month().Format( "YM2") =ObjOrder.EndDate().Format( "YM2"));
            if ( not isnull(OrderForecast))
            {
                nForecastQtyOld := OrderForecast.ForecatsRealQty();
                nForecastQtyNew := nForecastQtyOld;
            }
            // èŽ·å–åç­¾æ•°é‡ï¼ˆåªåˆ¤æ–­SKU)
            ObjReverse := select(Owner, H_ReverseRealQty , Obj, Obj.SKU() = ObjOrder.ProductID());
            if ( not isnull(ObjReverse))
@@ -59,7 +74,6 @@
                nReverseQtyOld := ObjReverse.ReverseRealQty();
                nReverseQtyNew := nReverseQtyOld;
            }
            // èŽ·å–æŽˆæƒæ•°é‡ï¼ˆå®¢æˆ·ID+SKU)
            ObjAuthorize := select(Owner, H_AuthorizeRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
                                                                    and Obj.CustomID() = ObjOrder.CustomerName());
@@ -96,7 +110,7 @@
               }
            }
            // 3 æœ€åŽå†²é¢„测
            if( OrderQuantity>0 and nForecastQtyOld>0)
              if( OrderQuantity>0)
            { 
               //默认订单数量>预测数量
               OrderQuantity := OrderQuantity-nForecastQtyOld;
@@ -133,6 +147,28 @@
                                   Unit := ObjOrder.UnitOfMeasureName(),
                                   OperateQty := [Number]ObjOrder.Quantity().Round( 0),
                                   OperateTime := DateTime::ActualTime());
              // çº¯é¢„测订单
              if( nForecastQtyNew>0)
              {
                FOrder := ObjOrder.Copy();
                FOrder.OrderTag("纯预测");
                FOrder.Quantity(nForecastQtyNew);
              }
              // æœ‰é¢„测订单
              if(nHaveForecastQty>0)
              {
                HFOrder := ObjOrder.Copy();
                HFOrder.OrderTag("有预测");
                HFOrder.Quantity(nHaveForecastQty);
              }
              // æ— é¢„测
              if(nNoHaveForecastQty>0)
              {
                NHFOrder := ObjOrder.Copy();
                NHFOrder.OrderTag("无预测");
                NHFOrder.Quantity(nNoHaveForecastQty);
              }
              // ERP反签授权订单-接口未提供
                                   
            // æ›´æ–°å½“前反签数量
            if( not isnull( ObjReverse))
@@ -168,13 +204,14 @@
            {
              Owner.H_OrderForecastRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "OF"),SKU := ObjOrder.ProductID(),
                                                                                              Month := ObjOrder.EndDate(),
                                                                                              CustomID := ObjOrder.CustomerName(),
                                                                                                CustomCode := ObjOrder.CustomerName(),
                                                                                              CustomName := ObjOrder.CustomerName(),
                                                                                              OrderCode := "-",
                                                                                              ForecatsQty :=0,
                                                                                                ForecastQty := 0,
                                                                                              ForecatsRealQty :=nForecastQtyNew,
                                                                                              Unit := ObjOrder.UnitOfMeasureName());
            } 
              ObjOrder.Delete();
            }
          }
        }
        else
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl
@@ -42,7 +42,7 @@
        nNoHaveForecastQty:=0;//五预测数量
        // èŽ·å–é¢„æµ‹æ•°é‡ï¼ˆå®¢æˆ·+SKU+月份 ç†è®ºæ˜¯æ²¡æœ‰ç‰©æ–™é¢„测)
        OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = SKU 
                                              and Obj.CustomID() = CustomerCode
                                              and Obj.CustomCode() = CustomerCode
                                              and Obj.Month().Format( "YM2") = Date::ActualDate().Format( "YM2"));
        if ( not isnull(OrderForecast))
        {
@@ -189,10 +189,9 @@
          {
            Owner.H_OrderForecastRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "OF"),SKU := SKU,
                                                                                            Month := Date::ActualDate(),
                                                                                            CustomID := CustomerCode,
                                                                                            CustomCode := CustomerCode,
                                                                                            CustomName := CustomName,
                                                                                            OrderCode := "-",
                                                                                            ForecatsQty :=0,
                                                                                            ForecastQty := 0,
                                                                                            ForecatsRealQty :=nForecastQtyNew,
                                                                                            Unit := Unit);
          } 
_Main/BL/Type_H_FunctionClass/StaticMethod_UpdateOrderForecastRealQty.qbl
@@ -24,7 +24,7 @@
        for ( x := 1; x <= 10; x := x + 1 )
        {
            Owner.H_OrderForecastRealQty(relnew,ID := "AAAAA_"+ x.AsQUILL(),SKU := "OTN-01-ACC-00"+ x.AsQUILL() , Month := Date::ActualDate(),CustomName := "小米",
                                          CustomID := "XM0001",OrderCode:="OD0001",ForecatsQty:=1000,ForecatsRealQty:=1000, Unit := "PCS");
                                          CustomCode := "XM0001",ForecastQty := 1000,ForecatsRealQty:=1000, Unit := "PCS");
        }
      }
      //H_FunctionClass := Owner.H_FunctionClass(relnew,VCode_Material := VCode,UpdateTime_Material := Date::ActualDate());
_Main/BL/Type_H_OrderForecastRealQty/Attribute_CustomCode.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute CustomCode
{
  #keys: '3[414724.0.174571651][414724.0.174571650][414724.0.174571652]'
  Description: '客户ID,唯一建之一'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_CustomID.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Department.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute Department
{
  #keys: '3[414724.0.174571661][414724.0.174571660][414724.0.174571662]'
  Description: '部门,没有价值,显示使用'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_ForecastQty.qbl
ÎļþÃû´Ó _Main/BL/Type_H_OrderForecastRealQty/Attribute_ForecatsQty.qbl ÐÞ¸Ä
@@ -1,6 +1,6 @@
Quintiq file version 2.0
#parent: #root
Attribute ForecatsQty
Attribute ForecastQty
{
  #keys: '3[414724.0.46380358][414724.0.46380357][414724.0.46380359]'
  Description: '预测数量'
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Month.qbl
@@ -3,6 +3,6 @@
Attribute Month
{
  #keys: '3[414724.0.46380308][414724.0.46380307][414724.0.46380309]'
  Description: '月份'
  Description: '月份,唯一键之一'
  ValueType: Date
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_OrderCode.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_H_OrderForecastRealQty/Attribute_SKU.qbl
@@ -3,6 +3,6 @@
Attribute SKU
{
  #keys: '3[414724.0.46380348][414724.0.46380347][414724.0.46380349]'
  Description: 'SKU编码'
  Description: 'SKU编码,唯一键之一'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_SKUName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute SKUName
{
  #keys: '3[414724.0.174572228][414724.0.174572227][414724.0.174572229]'
  Description: 'SKU名称'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_StockingPointID.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute StockingPointID
{
  #keys: '3[414724.0.174571671][414724.0.174571670][414724.0.174571672]'
  Description: '库存点,没有价值,显示使用'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_Unit.qbl
@@ -3,6 +3,6 @@
Attribute Unit
{
  #keys: '3[414724.0.46380378][414724.0.46380377][414724.0.46380379]'
  Description: '单位'
  Description: '单位,没有价值,显示使用'
  ValueType: String
}
_Main/BL/Type_H_OrderForecastRealQty/Attribute_VCode.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute VCode
{
  #keys: '3[414724.0.174571641][414724.0.174571640][414724.0.174571642]'
  Description: '版本号,暂时不适用,默认-'
  ValueType: String
}
_Main/BL/Type_MacroPlan/Method_MappingUnitData.qbl
@@ -42,12 +42,13 @@
                          infinite, 
                          unitofmeasurename );
    
    Unit::CreateOrUpdate( this,
    supplyunit := Unit::CreateOrUpdate( this,
                          "供应商", 
                          "供应商", 
                          "天马集团", 
                          infinite, 
                          unitofmeasurename );
    supplyunit.IsSupplier(true);
    
    Unit::CreateOrUpdate( this, 
                          "整车运输", 
_Main/BL/Type_Operation/Method_GetHasValidOperationInputOutput.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/FunctionOverride_CalcStockLevelInDays.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
Quintiq file version 2.0
#parent: #root
FunctionOverride CalcStockLevelInDays #extension
{
  TextBody:
  [*
    totalDays := 0.0;
    if( not this.Period_MP().MacroPlan().IsMetaOptimizerRunning() )
    {
      balanceInv := this.InventoryLevelEnd();
      if( balanceInv > 0 )
      {
        // Calculate stock level in days
        futureperiods := selectsortedset( this, ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), p,
                                          p.Start() >= this.End(), p.Start() );
        product := this.ProductInStockingPoint_MP().Product_MP();
        shelflife := this.ShelfLife();
        hasshelflife := product.HasShelfLife() and not isnull( shelflife );
        agevector := RealVector::Construct();
        quantityvector := RealVector::Construct();
        // Modified logic to consider shelf-life for stock level in days
        if( hasshelflife )
        {
          // Get the age and quantity vector of remaining product stock at the end of period
          agevector := RealVector::Construct( shelflife.ShelfLifeEndAgeVectorAsBinaryValue() );
          quantityvector := RealVector::Construct( shelflife.ShelfLifeEndQuantityVectorAsBinaryValue() );
        }
        /*
          Track if consecutive future periods has 0 demand (although we have balance supply, but if remaining future periods has 0 demand not consider as coverable).
          Accumulate the coverable days and only add to total days if manage to find a subsequent period with demand.
        */
        traverse( futureperiods, Elements, pispip,
                  // Terminate calculation once remaining supply is 0
                  balanceInv > 0 )
        {
          if( balanceInv > 0 )
          {
            demandQty := pispip.DependentDemandAndSalesDemandQuantity();
            // Include expired quantity as demand to determine stock level in days
            if( hasshelflife )
            {
              isexpiredinperiodvector := BooleanVector::Construct();
              traverse( agevector.AsValues(), Elements, age )
              {
                isexpiredinperiod := not product.GetIsUsableInTargetPeriod( [Real] age, pispip.Start(), pispip.Period_MP() );
                isexpiredinperiodvector.Append( isexpiredinperiod );
                agevector.Add( pispip.Period_MP().GetDurationInDaysForShelfLife(), false );
              }
              // Sum of all elements in the quantity vector that corresponds to element = true in the boolean vector
              expiredinventoryqty := quantityvector.GetSelection( isexpiredinperiodvector ).Sum();
              demandQty := demandQty + expiredinventoryqty; // Reduce inventory as expired
            }
            if( balanceInv > demandQty ) // Remaining supply can cover demand in period
            {
              totalDays := totalDays + pispip.Period_MP().DurationInDays();
              balanceInv := balanceInv - demandQty;
            }
            else // Remaining supply partially cover the demand in period
            {
              // Main calc logic
              totalDays := totalDays + ( balanceInv / demandQty * pispip.Period_MP().DurationInDays() );
              balanceInv := 0.0;
            }
          }
        }
      }
    }
    this.StockLevelInDays( totalDays );
  *]
}
_Main/BL/Type_ProductInStockingPointInPeriodPlanningLeaf/_ROOT_Type_ProductInStockingPointInPeriodPlanningLeaf.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
TypeSpecialization ProductInStockingPointInPeriodPlanningLeaf #extension
{
}
_Main/BL/Type_Routing/Method_DoSanityCheckData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: #root
Method DoSanityCheckData (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote #extension
{
  TextBody:
  [*
    // Adhi Feb-10-2016 (created)
    isvalid := true;
    isvalid := this.GetHasValidInput( feedback_o, sanitycheckfeedback_o ) and isvalid;
    isvalid := this.GetHasTianmaNonSupplierOperationWithNoInput( feedback_o, sanitycheckfeedback_o ) and isvalid;
    return isvalid;
  *]
}
_Main/BL/Type_Routing/Method_GetHasTianmaNonSupplierOperationWithNoInput.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
Quintiq file version 2.0
#parent: #root
Method GetHasTianmaNonSupplierOperationWithNoInput (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  TextBody:
  [*
    // Tianma change 20230925: If the unit is not a supplier, raise a data issue if there's no input
    value := forall( this, RoutingStep.Operation, operation,
                     guard( operation.Unit().IsSupplier(), false )
                     or operation.OperationInput( relsize ) > 0 );
    if( not value )
    {
      // Add instance text
      routingname := MacroPlan::GetSubstituteName( this.Name() );
      instance := Translations::MP_Routing_Instance( routingname );
      feedback := SanityCheckMessage::GetFormattedMessage( instance,
                                                           "非供应商操作没有投入料。" );
      feedback_o.Add( feedback );
      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() );
    }
    return value;
  *]
}
_Main/BL/Type_Unit/StaticMethod_CreateOrUpdate.qbl
@@ -7,7 +7,7 @@
  String parentunitid,
  String capacitytype,
  String unitofmeasurename
)
) as Unit
{
  TextBody:
  [*
@@ -21,7 +21,7 @@
    unit := Unit::FindById( owner, id );
    
    if( id="天马集团" and isnull( unit ) ){
      owner.Unit( relnew,
      unit := owner.Unit( relnew,
                 ID := id, 
                 Name := name, 
                 UnitOfMeasureName := unitofmeasurename, 
@@ -31,7 +31,7 @@
                 CapacityType := capacitytype );
      }else{
      if( isnull( unit ) ){
        owner.Unit( relnew, ID := id,
        unit := owner.Unit( relnew, ID := id,
                   Name := name, 
                   ParentUnitID := parentunitid, 
                   CapacityType := capacitytype, 
@@ -46,5 +46,7 @@
          unit.UnitOfMeasureName( unitofmeasurename );
          }
        }
    return unit;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditIssueWorkOrder/Response_pnlActions_btnOk_OnClick.def
@@ -4,6 +4,16 @@
{
  #keys: '[414702.0.223820978]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    flag := guard( [Real]efPlannedQuantity.Text() > 0.0, false ) or DataHolderDialogDatas.Data().Size() > 1;
    if ( not flag ) {
      feedback := "请输入一个大于0的数字";
    }
    return flag;
  *]
  QuillAction
  {
    Body:
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_ListSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
Quintiq file version 2.0
Component ListSalesDemands #extension
{
  Children:
  [
    Component DataSetLevelSalesDemands #extension
    {
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPoint_MP.ID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPoint_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegment_MP.Name","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegment_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"Customer name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerID","title":"Customer ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderID","title":"Order ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderLineID","title":"Order line ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderLineID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Order date","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product_MP.ID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Product_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasure_MP.Name","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"UnitOfMeasure_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Quantity","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Quantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantity","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue( object.Quantity() - object.FulfilledQuantity(), 0.0).Round( 2)"}},{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfilled demand","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round( 2)"}}]}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsFirmed","title":"Is firmed","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsFirmed"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsEligibleForNetting","title":"Is eligible for netting","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsEligibleForNetting"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Price","title":"Price","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Price"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PriceUoM","title":"PriceUoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"PriceUoM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderTag","title":"订单标签","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderTag"}}]'
      ]
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_PanelAllSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
Component PanelAllSalesDemands #extension
{
  Children:
  [
    #child: ListSalesDemands
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/Component_PanelSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
Component PanelSalesDemands #extension
{
  Children:
  [
    #child: PanelAllSalesDemands
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders/_ROOT_Component_FormCustomerOrders.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
Quintiq file version 2.0
#root
#parent: LibMacroPlannerWebUI
OrphanComponent FormCustomerOrders #extension
{
  Children:
  [
    #child: PanelSalesDemands
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_ListSDIP.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
Component ListSDIP
{
  #keys: '[134266.1.1970512356]'
  BaseType: 'ListSDIP'
  IsDerived: true
  Children:
  [
    Component DataSetLevelSDIP
    {
      #keys: '[134266.1.1970512358]'
      BaseType: 'DataSetLevelSDIP'
      IsDerived: true
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ImgIsRestricted","title":"ImgIsRestricted","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ImgIsRestricted"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegmentName","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegmentName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProductID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPointID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPointID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Start","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"End","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MasterSalesDemand.UnitOfMeasureName","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MasterSalesDemand.UnitOfMeasureName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"QuantityInSalesDemandUOM","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"QuantityInSalesDemandUOM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantityInSalesDemandUOM","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantityInSalesDemandUOM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfilled demand","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round( 2)"}},{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue( object.Quantity()-object.FulfilledQuantity(),0.0)"}}]}}]'
      ]
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_ListSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
Quintiq file version 2.0
Component ListSalesDemands
{
  #keys: '[134266.1.1970507083]'
  BaseType: 'ListSalesDemands'
  IsDerived: true
  Children:
  [
    Component DataExtractorSalesDemands
    {
      #keys: '[134266.1.1970507084]'
      BaseType: 'DataExtractorSalesDemands'
      IsDerived: true
      Properties:
      [
        Transformation: 'Elements.astype(CustomerOrder)'
      ]
    }
    Component DataSetLevelSalesDemands
    {
      #keys: '[134266.1.1970507085]'
      BaseType: 'DataSetLevelSalesDemands'
      IsDerived: true
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPoint_MP.ID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPoint_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegment_MP.Name","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegment_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"Customer name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerID","title":"Customer ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderID","title":"Order ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderLineID","title":"Order line ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderLineID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Order date","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product_MP.ID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Product_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasure_MP.Name","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"UnitOfMeasure_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Quantity","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Quantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantity","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue( object.Quantity() - object.FulfilledQuantity(), 0.0).Round( 2)"}},{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfilled demand","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round( 2)"}}]}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsFirmed","title":"Is firmed","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsFirmed"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsEligibleForNetting","title":"Is eligible for netting","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsEligibleForNetting"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Price","title":"Price","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Price"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PriceUoM","title":"PriceUoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"PriceUoM"}}]'
      ]
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelAllSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
Quintiq file version 2.0
Component PanelAllSalesDemands
{
  #keys: '[134266.1.1970497658]'
  BaseType: 'PanelAllSalesDemands'
  IsDerived: true
  Children:
  [
    #child: ListSalesDemands
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelSDIP.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
Quintiq file version 2.0
Component PanelSDIP
{
  #keys: '[134266.1.1970511019]'
  BaseType: 'PanelSDIP'
  IsDerived: true
  Children:
  [
    #child: ListSDIP
  ]
  Properties:
  [
    Title: 'Customer orders at planning level'
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Component_PanelSalesDemands.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
Quintiq file version 2.0
Component PanelSalesDemands
{
  #keys: '[134266.1.1970506995]'
  BaseType: 'PanelSalesDemands'
  IsDerived: true
  Children:
  [
    #child: PanelSDIP
    #child: PanelAllSalesDemands
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuCopy_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
Quintiq file version 2.0
#parent: ListSalesDemands
Response OnClick () inherited id:Response_ListSalesDemands_MenuCopy_OnClick
{
  #keys: '[136682.1.799924425]'
  BaseType: 'Response_ListSalesDemands_MenuCopy_OnClick'
  DefinitionID: 'Responsedef_ListSalesDemands_WebMenu_OnClick'
  Initiator: 'MenuCopy'
  QuillAction
  {
    Body:
    [*
      // Copy sales demand
      data := selectset( selection, Elements.astype( CustomerOrder ), co, true, true );
      CustomerOrder::Copy( data );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuCreate_OnClick#715.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
Quintiq file version 2.0
#parent: ListSalesDemands
Response OnClick () inherited id:Response_ListSalesDemands_MenuCreate_OnClick_715
{
  #keys: '[136682.1.803262814]'
  BaseType: 'Response_ListSalesDemands_MenuCreate_OnClick_715'
  DefinitionID: 'Responsedef_ListSalesDemands_WebMenu_OnClick'
  Initiator: 'MenuCreate'
  QuillAction
  {
    Body:
    [*
      //Create new sales demand
      dlg := construct( DialogCreateEditCustomerOrder );
      dlg.New();
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/Response_ListSalesDemands_MenuEdit_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
Quintiq file version 2.0
#parent: ListSalesDemands
Response OnClick () inherited id:Response_ListSalesDemands_MenuEdit_OnClick
{
  #keys: '[136682.1.803135245]'
  BaseType: 'Response_ListSalesDemands_MenuEdit_OnClick'
  DefinitionID: 'Responsedef_ListSalesDemands_WebMenu_OnClick'
  Initiator: 'MenuEdit'
  QuillAction
  {
    Body:
    [*
      //Edit sales demand
      dlg := construct( DialogCreateEditCustomerOrder );
      data := selectset( selection, Elements.astype( CustomerOrder ), f, true, true );
      dlg.Edit( data );
    *]
  }
}
_Main/UI/MacroPlannerWebApp/Component_FormCustomerOrders226/_ROOT_Component_FormCustomerOrders226.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#root
#parent: MacroPlannerWebApp
OrphanComponent FormCustomerOrders226
{
  #keys: '[414724.0.179160850]'
  Accessibility: 'Extensible'
  BaseType: 'FormSalesDemands'
  Children:
  [
    #child: PanelSalesDemands
  ]
  Properties:
  [
    Image: 'SALES_QUOTATION'
    Title: 'Customer orders'
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormIssueWorkOrder/Component_ListIssueWorkOrder.def
@@ -28,7 +28,7 @@
      ]
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductionWorkOrderNumber","title":"ProductionWorkOrderNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductionWorkOrderNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductModel","title":"ProductModel","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaterialDescription","title":"MaterialDescription","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaterialDescription"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PlannedQuantity","title":"PlannedQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PlannedQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WorkOrderType","title":"WorkOrderType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WorkOrderType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WorkOrderStatus","title":"WorkOrderStatus","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WorkOrderStatus"}}]'
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductionWorkOrderNumber","title":"ProductionWorkOrderNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductionWorkOrderNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductModel","title":"Product ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaterialDescription","title":"MaterialDescription","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaterialDescription"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"StartDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PlannedQuantity","title":"PlannedQuantity","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"PlannedQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WorkOrderType","title":"WorkOrderType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WorkOrderType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WorkOrderStatus","title":"WorkOrderStatus","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WorkOrderStatus"}}]'
        ContextMenu: 'MenuIssueEdit'
        Taborder: 2
      ]
_Main/UI/MacroPlannerWebApp/Component_FormIssueWorkOrder/Response_ListIssueWorkOrder_MenuEdit_OnClick.def
@@ -8,13 +8,23 @@
  CanBindMultiple: false
  DefinitionID => /ListIssueWorkOrder/Responsedef_ListIssueWorkOrder_WebMenu_OnClick
  Initiator: 'MenuEdit'
  Precondition:
  [*
    flag := DataHolderCheckedMasterPlanReleaseWorkOrderTabulation.Data().Size() > 0;
    if ( not flag ) {
     feedback := "未选择数据";
    }
    return flag;
  *]
  QuillAction
  {
    Body:
    [*
      dlg := construct( DialogCreateEditIssueWorkOrder );
      
      dlg.Edit( selection );
      dlg.Edit( DataHolderCheckedMasterPlanReleaseWorkOrderTabulation.Data() );
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def
@@ -21,9 +21,12 @@
        {
          JInfo := JSON::Parse( SelectItem.ValueJsonString());
          lb_SUK_FAACM.Text(JInfo.Get( "ParentSKU").GetString());
          lb_SKUName_FAACM.Text(JInfo.Get( "ParentSKUName").GetString());
          lb_MaterialCode_FAACM.Text(JInfo.Get( "SKU").GetString());
          lb_MaterialName.Text(JInfo.Get( "MaterialName").GetString());
          lb_Unit_FAACM.Text(JInfo.Get( "Unit").GetString());
          lb_Operator_FAACM.Text(ApplicationMacroPlanner.GetUserName());
          lb_MaterialType_FAACM.Text(JInfo.Get( "MaterialType").GetString());
          txt_CustomID_FAACM.Text(JInfo.Get( "CustomCode").GetString());
          txt_CustomName_FAACM.Text(JInfo.Get( "CustomName").GetString());
        }
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def
@@ -13,19 +13,33 @@
    [*
      if( not isnull( selection))
      {
        // é¢„测订单基本信息
        CustomCode:="";
        CustomName:="";
        SKUName:="";
        SValueJsonString:="";
        // èŽ·å–å®¢æˆ·åç§°å’Œå®¢æˆ·ID
        if(txtSaveForecastData_FM.Text().Length()>0)
        {
           jForecast := JSON::Parse( txtSaveForecastData_FM.Text());
           CustomCode := jForecast.Get( "CustomCode").GetString();
           CustomName := jForecast.Get( "CustomName").GetString();
           SKUName := jForecast.Get( "SKUName").GetString();
        }
        if(selection.MaterialType()="半成品")
        {
          OrderCode:="";
          ForecastID:="";
          if( txtSaveForecastData_FM.Text().Length()>0)
          {
            JForecast := JSON::Parse( txtSaveForecastData_FM.Text());
            OrderCode := JForecast.Get( "OrderCode").GetString();
            ForecastID := JForecast.Get( "ForecastID").GetString();
          }
         jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), OrderCode,"-",selection.NeedDate());
         jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), ForecastID,"-",selection.NeedDate(),GlobalOTDTable);
          if(jResult.Get( "Status").GetBoolean())
          {
                de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " +  selection.SKU().AsQUILL()
                                                + " and object.ForecastID() = " + OrderCode.AsQUILL()
                                                + " and object.ForecastID() = " + ForecastID.AsQUILL()
                                                );
          }
          else
@@ -35,7 +49,28 @@
        }
        else
        {
            // å¼¹å‡ºç‰©æ–™åç­¾æŽˆæƒ
          SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect");
          if(not isnull(selection))
          {
            SValueJsonString:= JSON::Object().Add( "SKU",selection.SKU())
                        .Add( "MaterialName",selection.MaterialName())
                        .Add( "MaterialType",selection.MaterialType())
                        .Add( "OrgCode",selection.OrgCode())
                        .Add( "Unit",selection.Unit())
                        .Add( "CustomCode",CustomCode)
                        .Add( "ParentSKU",lb_SUK_FM.Text())
                        .Add( "ParentSKUName",SKUName)
                        .Add( "CustomName",CustomName).Build().AsString();
          }
          if(isnull( SelectItem))
          {
            MacroPlan.H_MessagePassing(relnew,FKey := "FrmMaterial",ItemKey := "ListSelect", ValueJsonString:=SValueJsonString);
          }
          else
          {
            SelectItem.ValueJsonString( SValueJsonString);
          }
          Application.OpenForm( "FrmAuthorizeAndCountersign_Material","modal");
        }
      }
    *]
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def
@@ -21,7 +21,7 @@
          JSelect := JSON::Parse( SelectItem.ValueJsonString());
          lb_SUK_FM.Text(JSelect.Get( "SKU").GetString());
          de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " + JSelect.Get( "SKU").GetString().AsQUILL()
                                          + " and object.ForecastID() = " + JSelect.Get( "OrderCode").GetString().AsQUILL()
                                          + " and object.ForecastID() = " + JSelect.Get( "ForecastID").GetString().AsQUILL()
                                          );
        }
      }
_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick#975.def
@@ -20,12 +20,14 @@
      CustomName:="";
      SValue:="";
      SValueJsonString:="";
      SKUName:="";
      // èŽ·å–å®¢æˆ·åç§°å’Œå®¢æˆ·ID
      if(txtSaveForecastData_FM.Text().Length()>0)
      {
         jForecast := JSON::Parse( txtSaveForecastData_FM.Text());
         CustomCode := jForecast.Get( "CustomCode").GetString();
         CustomName := jForecast.Get( "CustomName").GetString();
         SKUName := jForecast.Get( "SKUName").GetString();
      }
      if(not isnull(selection))
      {
@@ -36,6 +38,7 @@
                    .Add( "Unit",selection.Unit())
                    .Add( "CustomCode",CustomCode)
                    .Add( "ParentSKU",lb_SUK_FM.Text())
                    .Add( "ParentSKUName",SKUName)
                    .Add( "CustomName",CustomName).Build().AsString();
      }
      if( isnull( SelectItem))
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def
@@ -11,9 +11,10 @@
      BaseType: 'WebButton'
      Properties:
      [
        ButtonSize: 'compact'
        Description: '订单新增反签/授权'
        Label: '订单新增反签/授权'
        Taborder: 1
        Taborder: 0
      ]
      ResponseDefinitions:
      [
@@ -39,9 +40,10 @@
      BaseType: 'WebButton'
      Properties:
      [
        ButtonSize: 'compact'
        Description: '原料新增反签/授权'
        Label: '原料新增反签/授权'
        Taborder: 2
        Taborder: 1
      ]
      ResponseDefinitions:
      [
@@ -61,30 +63,42 @@
        }
      ]
    }
    Component btn_InitialData778
    {
      #keys: '[414724.0.115504406]'
      BaseType: 'WebButton'
      Properties:
      [
        Description: '加载数据(假的,后续需要对接数据)'
        Label: '加载预测订单数据'
        Taborder: 0
        Visible: false
      ]
    }
    Component btn_OrderH_FOF
    {
      #keys: '[414724.0.165490408]'
      BaseType: 'WebButton'
      Properties:
      [
        ButtonSize: 'compact'
        Description: 'ERO订单冲减'
        Image: 'AMMUNITION_BOX_CLOSED'
        Label: 'ERP订单冲减'
        Taborder: 2
      ]
    }
    Component txt_QueryContent_FOF
    {
      #keys: '[414724.0.172390935]'
      BaseType: 'WebEditField'
      Properties:
      [
        PlaceHolder: '模糊搜索'
        Taborder: 3
      ]
    }
    Component btn_Query_FOF
    {
      #keys: '[414724.0.172390951]'
      BaseType: 'WebButton'
      Properties:
      [
        ButtonSize: 'compact'
        Description: '查询'
        Image: 'VIEW'
        Label: '查询'
        Taborder: 4
      ]
    }
  ]
  Properties:
  [
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel383.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel647.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel849.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_liH_Forecast.def
@@ -11,8 +11,8 @@
      BaseType: 'WebDataExtractor'
      Properties:
      [
        DataType: 'structured[H_Forecast]'
        Source: 'dh_FOF_H_Forecast'
        DataType: 'structured[H_OrderForecastRealQty]'
        Source: 'dh_FOF_H_OrderForecastRealQty'
        Taborder: 0
        Transformation: 'Elements'
      ]
@@ -28,7 +28,7 @@
      ]
      Properties:
      [
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderCode","title":"订单编号","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU编码","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastQty","title":"预测数量","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"NeedTime","title":"需求时间","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"NeedTime"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Util","title":"单位","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Util"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomName","title":"客户名称","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Department","title":"销售部门","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Department"}}]'
        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Month","title":"月份","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Month"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomName","title":"客户名称","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU编号","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecatsQty","title":"预测数量","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecatsQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecatsRealQty","title":"纯预测数量","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecatsRealQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"单位","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Department","title":"部门","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Department"}}]'
        ContextMenu: 'listContextMenu367'
        Taborder: 2
      ]
@@ -36,6 +36,6 @@
  ]
  Properties:
  [
    Taborder: 7
    Taborder: 3
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_listActionBarPage963.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_listContextMenu687.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_list_ForecastView_FOF#670.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_OnCreated.def
@@ -9,14 +9,16 @@
  {
    Body:
    [*
      // åˆå§‹åŒ–查询参数月份
      ds_Month_FOF.Date(Date::ActualDate());
      // åˆå§‹åŒ–预测数据
      JResult := H_FunctionClass::SM_InitialForcastData( MacroPlan);
      JResult := H_FunctionClass::SM_InitialForcastDataEx( MacroPlan,true,"-");
      if(not JResult.Get( "Status").GetBoolean())
      {
          WebMessageBox::Warning( JResult.Get( "Msg").GetString());
      }
      else
      {
        WebMessageBox::Information( JResult.Get( "Msg").GetString());
      }
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick#222.def
@@ -1,7 +1,7 @@
Quintiq file version 2.0
#parent: Panel351/btn_Add_Material_FOF503
Response OnClick (
  H_Forecast selection
  H_OrderForecastRealQty selection
) id:Response_Panel351_btn_Add_Material_FOF503_OnClick_222
{
  #keys: '[414724.0.145178766]'
@@ -17,28 +17,28 @@
        if( isnull( SelectItem))
        {
           MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect",
                                       Value := selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName(),
                                       ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                         .Add( "Util",selection.Util())
                                                                       .Add( "SKUName",selection.SKUName())
                                                                       .Add( "Util",selection.Unit())
                                                                         .Add( "CustomCode",selection.CustomCode())
                                                                         .Add( "CustomName",selection.CustomName())
                                                                         .Add( "ForecastQty",selection.ForecastQty())
                                                                         .Add( "NeedTime",selection.NeedTime().AsQUILL())
                                                                         .Add( "OrderCode",selection.OrderCode()).Build().AsString());
                                                                       .Add( "ForecastID",selection.ID())
                                                                       .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
        }
        else
        {
          SelectItem.Value(selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName());
          SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                   .Add( "Util",selection.Util())
                                                   .Add( "SKUName",selection.SKUName())
                                                   .Add( "Util",selection.Unit())
                                   .Add( "CustomCode",selection.CustomCode())
                                   .Add( "CustomName",selection.CustomName())
                                   .Add( "ForecastQty",selection.ForecastQty())
                                   .Add( "NeedTime",selection.NeedTime().AsQUILL())
                                   .Add( "OrderCode",selection.OrderCode()).Build().AsString());
                                                   .Add( "ForecastID",selection.ID())
                                                   .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
        }
        
        jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.OrderCode(),"-",selection.NeedTime());
        jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month(),GlobalOTDTable);
        if(jResult.Get( "Status").GetBoolean())
        {
            Application.OpenForm( "FrmMaterial","popout");
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Order_FOF449_OnClick#880.def
@@ -1,7 +1,7 @@
Quintiq file version 2.0
#parent: Panel351/btn_Add_Order_FOF449
Response OnClick (
  H_Forecast selection
  H_OrderForecastRealQty selection
) id:Response_Panel351_btn_Add_Order_FOF449_OnClick_880
{
  #keys: '[414724.0.141244111]'
@@ -16,19 +16,20 @@
        SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmOrderForecast" and Obj.ItemKey()="ListSelect");
        if( isnull( SelectItem))
        {
           MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect",
                                       Value := selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName(),
                                       ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                         .Add( "Util",selection.Util())
                                                                       .Add( "Util",selection.Unit())
                                                                         .Add( "CustomCode",selection.CustomCode())
                                                                       .Add( "SKUName",selection.SKUName())
                                                                         .Add( "CustomName",selection.CustomName()).Build().AsString());
        }
        else
        {
          SelectItem.Value(selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName());
          SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                   .Add( "Util",selection.Util())
                                                   .Add( "Util",selection.Unit())
                                   .Add( "CustomCode",selection.CustomCode())
                                                   .Add( "SKUName",selection.SKUName())
                                   .Add( "CustomName",selection.CustomName()).Build().AsString());
        }
        Application.OpenForm( "FrmAuthorizeAndCountersign_Order","modal");  
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_InitialData778_OnClick#971.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Query_FOF_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
Quintiq file version 2.0
#parent: Panel351/btn_Query_FOF
Response OnClick () id:Response_Panel351_btn_Query_FOF_OnClick
{
  #keys: '[414724.0.172390950]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  QuillAction
  {
    Body:
    [*
      de_dh_FOF_H_Foecast.FixedFilter( "object.SKU().LikeUserLocale( " + txt_QueryContent_FOF.Text().AsQUILL() + " )"
                                                   + " or " + "object.CustomName().LikeUserLocale( " + txt_QueryContent_FOF.Text().AsQUILL() + " )"
                                                   + " or " + "object.Unit().LikeUserLocale( " + txt_QueryContent_FOF.Text().AsQUILL() + " )"
                                                   + " or " + "object.Department().LikeUserLocale( " + txt_QueryContent_FOF.Text().AsQUILL() + " )"
                                                   + " or " + "object.StockingPointID().LikeUserLocale( " + txt_QueryContent_FOF.Text().AsQUILL() + " )"
                                      );
    *]
    GroupServerCalls: false
  }
}
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel383_btn_Query_FOF_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_Add_Material_FOF_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_Add_Order_FOF_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel647_btn_InitialData_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def
@@ -1,7 +1,7 @@
Quintiq file version 2.0
#parent: liH_Forecast
Response OnDoubleClick (
  H_Forecast selection
  H_OrderForecastRealQty selection
) id:Response_liH_Forecast_OnDoubleClick
{
  #keys: '[414724.0.111761136]'
@@ -15,28 +15,28 @@
      if( isnull( SelectItem))
      {
         MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect",
                                     Value := selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName(),
                                     ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                       .Add( "Util",selection.Util())
                                                                       .Add( "SKUName",selection.SKUName())
                                                                       .Add( "Util",selection.Unit())
                                                                       .Add( "CustomCode",selection.CustomCode())
                                                                       .Add( "CustomName",selection.CustomName())
                                                                       .Add( "ForecastQty",selection.ForecastQty())
                                                                       .Add( "NeedTime",selection.NeedTime().AsQUILL())
                                                                       .Add( "OrderCode",selection.OrderCode()).Build().AsString());
                                                                       .Add( "ForecastID",selection.ID())
                                                                       .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
      }
      else
      {
        SelectItem.Value(selection.SKU()+";"+selection.Util()+";"+selection.CustomCode()+";"+selection.CustomName());
        SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                 .Add( "Util",selection.Util())
                                                 .Add( "SKUName",selection.SKUName())
                                                 .Add( "Util",selection.Unit())
                                 .Add( "CustomCode",selection.CustomCode())
                                 .Add( "CustomName",selection.CustomName())
                                 .Add( "ForecastQty",selection.ForecastQty())
                                 .Add( "NeedTime",selection.NeedTime().AsQUILL())
                                 .Add( "OrderCode",selection.OrderCode()).Build().AsString());
                                                 .Add( "ForecastID",selection.ID())
                                                 .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString());
      }
      
      jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.OrderCode(),"-",selection.NeedTime());
      jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month(),GlobalOTDTable );
      if(jResult.Get( "Status").GetBoolean())
      {
        Application.OpenForm( "FrmMaterial","popout");
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_list_ForecastView_FOF_OnDoubleClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_list_ForecastView_FOF_OnSelectionChanged.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/_ROOT_Component_FrmOrderForecast.def
@@ -7,100 +7,12 @@
  BaseType: 'WebForm'
  Children:
  [
    #child: Panel849
    #child: list_ForecastView_FOF
    Component dh_FOF_Data
    {
      #keys: '[414724.0.86151860]'
      BaseType: 'WebDataHolder'
      Databinding: 'structured[SalesDemandBase]*'
      Children:
      [
        Component de_dh_FOF_Data
        {
          #keys: '[414724.0.86151875]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'structured[SalesDemandBase]'
            Source: 'dh_FOF_ChildrenData'
            Taborder: 0
            Transformation: 'Elements'
          ]
        }
        Component DataExtractor819
        {
          #keys: '[414724.0.107645127]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'MacroPlan'
            Source: 'MacroPlan'
            Taborder: 1
            Transformation: 'SalesDemand'
          ]
        }
      ]
      Properties:
      [
        Taborder: 4
      ]
    }
    #child: Panel961
    Component dh_FOF_ChildrenData
    {
      #keys: '[414724.0.106541535]'
      BaseType: 'WebDataHolder'
      Databinding: 'structured[SalesDemandBase]*'
      Children:
      [
        Component de_FOF_ChildrenData_0
        {
          #keys: '[414724.0.106541577]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'structured[Product_MP]'
            Source: 'ApplicationMacroPlanner.DataHolderProduct'
            Taborder: 0
            Transformation: 'Elements.SalesDemand'
          ]
        }
        Component de_FOF_ChildrenData_1
        {
          #keys: '[414724.0.106541594]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'structured[StockingPoint_MP]'
            Source: 'ApplicationMacroPlanner.DataHolderStockingPoint'
            Taborder: 1
            Transformation: 'Elements.SalesDemand'
          ]
        }
        Component de_FOF_ChildrenData_2
        {
          #keys: '[414724.0.106541611]'
          BaseType: 'WebDataExtractor'
          Properties:
          [
            DataType: 'structured[SalesSegment_MP]'
            Source: 'ApplicationMacroPlanner.DataHolderSalesSegment'
            Taborder: 2
            Transformation: 'Elements.SalesDemand'
          ]
        }
      ]
      Properties:
      [
        Taborder: 3
      ]
    }
    Component dh_FOF_H_Forecast
    Component dh_FOF_H_OrderForecastRealQty
    {
      #keys: '[414724.0.109053093]'
      BaseType: 'WebDataHolder'
      Databinding: 'structured[H_Forecast]*'
      Databinding: 'structured[H_OrderForecastRealQty]*'
      Children:
      [
        Component de_dh_FOF_H_Foecast
@@ -112,13 +24,13 @@
            DataType: 'MacroPlan'
            Source: 'MacroPlan'
            Taborder: 0
            Transformation: 'H_Forecast'
            Transformation: 'H_OrderForecastRealQty'
          ]
        }
      ]
      Properties:
      [
        Taborder: 6
        Taborder: 2
      ]
    }
    #child: liH_Forecast
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_ButtonERP¶©µ¥_OnClick.def
ÎļþÒÑɾ³ý
_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def
ÎļþÒÑɾ³ý