haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
Quintiq file version 2.0
#parent: #root
Method OnUpdateValue (
  shadow[PlanningCell] cell,
  Real newvalue
) id:Method_FormSupplyPlanning_OnUpdateValue
{
  #keys: '[134266.2.80084384]'
  Body:
  [*
    // On update value
    
    pispip := cell.ProductInStockingPointInPeriodPlanning();
    units := null( Units, owning );
    
    if( cell.Process_MP().istype( Operation ) )
    {
      units := selectset( cell.Process_MP().astype( Operation ), RoutingForPlanningMatrix.RoutingStep.Operation.Unit, u, true, true );
    }
    else
    {
      units := construct( Units );
      units.Add( cell.Process_MP().astype( LaneLeg ).AsProcess_MP() );
    }
    
    // Update shadow object to reflect new keyed-in qty
    cell.Quantity( newvalue );
    MacroPlan.SetSupplyForProcess( pispip, cell.Process_MP(), newvalue );
    
    // *********** Comment out for now, and use same thin client behavior
    // Smart plan with user qty
    // MacroPlan.RunSmartPlanForPeriodTask( pispip, newvalue, units, ScenarioManager, cell.Process_MP() );
  *]
}