lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
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
56
57
58
59
60
61
62
63
Quintiq file version 2.0
#parent: #root
Method EditCustomerOrder (
  structured[CustomerOrder] selection,
  internal[GUIComponent] parent
) id:Method_DialogCreateEditCustomerOrder_EditCustomerOrder
{
  #keys: '[142576.0.84643255]'
  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 );
           
      CustomerOrder::Update( selection,
                             not isbatchedit or CheckBoxBatchEditProduct.Checked(),
                             SelectionProduct.Data(),                         
                             not isbatchedit or CheckBoxBatchEditStockingPoint.Checked(),
                             SelectionStockingPoint.Data(),                         
                             not isbatchedit or CheckBoxBatchEditOrderDate.Checked(),
                             data.StartDate(),                         
                             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 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() ),
                             not isbatchedit or CheckBoxBatchEditCustomerName.Checked(),
                             data.CustomerName(),                         
                             not isbatchedit or CheckBoxBatchEditCustomerID.Checked(),
                             data.CustomerID(),                         
                             not isbatchedit or CheckBoxBatchEditOrderID.Checked(),
                             data.OrderID(),                         
                             not isbatchedit or CheckBoxBatchEditOrderLineID.Checked(),
                             data.OrderLineID(),                         
                             not isbatchedit or CheckBoxBatchEditIsEligibleForNetting.Checked(),
                             data.IsEligibleForNetting(),                         
                             not isbatchedit or CheckBoxBatchEditIsFirmed.Checked(),
                             data.IsFirmed(),                         
                             true );
    }
  *]
}