xiaoding721
2023-11-13 e4edcfd0b987b239526f5375881b919789782dad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Quintiq file version 2.0
#parent: #root
Method EditSalesDemand (
  structured[Forecast] selection,
  internal[GUIComponent] parent
) id:Method_DialogCreateEditSalesDemand_EditSalesDemand
{
  #keys: '[11660.1.183230770]'
  Body:
  [*
    // Edit sales demands
    
    isbatchedit := selection.Size() > 1;
    Dialog.ShowHideComponentForBatchEdit( isbatchedit );
    salesdemand := selection.Element( 0 );
    data := shadow( salesdemand );
    Dialog.Data( data );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      quantity := ApplicationLibMacroPlanner.FormatStringToReal( EditorQuantity.Text(), 0.0 );
    
      SalesDemandBase::Update( selection,
                               not isbatchedit or CheckBoxBatchEditProduct.Checked(),
                               SelectionProduct.Data(),
                               not isbatchedit or CheckBoxBatchEditStockingPoint.Checked(),
                               SelectionStockingPoint.Data(),
                               not isbatchedit or CheckBoxBatchEditStart.Checked(),
                               data.StartDate(),
                               not isbatchedit or CheckBoxBatchEditEnd.Checked(),
                               data.EndDate(),
                               not isbatchedit or CheckBoxBatchEditQuantity.Checked(),
                               quantity,
                               not isbatchedit or CheckBoxBatchEditPrice.Checked(),
                               data.Price(),
                               not isbatchedit or CheckBoxBatchEditPriority.Checked() or CheckBoxBatchEditIsExcludedFromFulfillmentKPI.Checked(),
                               data.Priority(),
                               not isbatchedit or CheckBoxBatchEditDemandUncertaintyPercentage.Checked(),
                               data.DemandUncertaintyPercentage(),
                               not isbatchedit or CheckBoxBatchEditSalesSegment.Checked(),
                               data.SalesSegment_MP(),
                               not isbatchedit or CheckBoxBatchEditCurrency.Checked(),
                               data.Currency_MP(),
                               not isbatchedit or CheckBoxBatchEditUnitOfMeasure.Checked(),
                               data.UnitOfMeasure_MP(),
                               not isbatchedit or CheckBoxBatchEditIsExcludedFromFulfillmentKPI.Checked(),
                               ifexpr( CheckBoxIsExcludedFromFulfillmentKPI.Enabled(), 
                                       CheckBoxIsExcludedFromFulfillmentKPI.Checked(),
                                       data.IsExcludedFromFulfillmentKPIUser() ),
                               true );
    }
  *]
}