Quintiq file version 2.0
|
#parent: #root
|
Method OnOK () derived id:Method_DialogCreateEditForecast_OnOK #extension
|
{
|
BaseType => //DialogCreateEditSalesDemand/Method_DialogCreateEditSalesDemand_OnOK
|
Body:
|
[*
|
Form.ApplyChanges();
|
this.SetAttributeAfterApplyData();
|
|
data := DataHolderDialogData.Data();
|
selection := DataHolderSalesDemands.Data().Copy();
|
isbatchedit := selection.Size() >1;
|
|
|
if( isnull( data.WrappedInstance() ) )
|
{
|
data.ID( MacroPlan.IDHolder().GetSalesDemandID( "User_", "" ) );
|
forecast := Forecast::Create( data.ID(),
|
DropDownListProduct.Data(),
|
DropDownListStockingPoint.Data(),
|
data.StartDate(),
|
data.EndDate(),
|
data.Quantity(),
|
data.Price(),
|
data.Priority(),
|
data.SalesSegment_MP(),
|
data.Currency_MP(),
|
data.UnitOfMeasure_MP(),
|
false,
|
true,
|
data.DemandUncertaintyPercentage(),
|
data.IsExcludedFromFulfillmentKPI(),
|
false
|
);
|
forecast.Origin( DropDownStringListOrigin.Text() );
|
|
}
|
|
else
|
{
|
quantity := ApplicationMacroPlanner.FormatStringToReal( EditFieldQuantityUom.Text(), 0.0 );
|
forecasts := selectset( selection, Elements.astype( Forecast ), forecast, true );
|
Forecast::Update( forecasts,
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListProduct ),
|
DropDownListProduct.Data(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListStockingPoint ),
|
DropDownListStockingPoint.Data(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DateSelectorStart ),
|
data.StartDate(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DateSelectorEnd ),
|
data.EndDate(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldQuantityUom ),
|
quantity,
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldPrice ),
|
data.Price(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListPriority ) or ApplicationMacroPlanner.IsActionLinkEnabledEdit( CheckBoxIsExcludedFromFulfillmentKPI ),
|
data.Priority(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( EditFieldDemandUncertaintyPercentage ),
|
data.DemandUncertaintyPercentage(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListSalesSegment ),
|
data.SalesSegment_MP(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListCurrency ),
|
data.Currency_MP(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( DropDownListUnitOfMeasurement ),
|
data.UnitOfMeasure_MP(),
|
not isbatchedit or ApplicationMacroPlanner.IsActionLinkEnabledEdit( CheckBoxIsExcludedFromFulfillmentKPI ),
|
ifexpr( CheckBoxIsExcludedFromFulfillmentKPI.Enabled(),
|
CheckBoxIsExcludedFromFulfillmentKPI.Checked(),
|
data.IsExcludedFromFulfillmentKPIUser() ),
|
true );
|
traverse( forecasts,Elements,forecast ){
|
forecast.Origin( DropDownStringListOrigin.Text() );
|
}
|
|
}
|
Form.Close();
|
*]
|
}
|