chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
Quintiq file version 2.0
#parent: ListEntityTreeInPanel
Response OnClick (
  structured[Entity] selection
) id:Response_ListEntityTreeInPanel_MenuSmartPlanStockingPoint_OnClick
{
  #keys: '[127710.1.1015004041]'
  Body:
  [*
    // Smart plan for PISPIPs in stocking points
    dlg := construct( DialogSmartPlan );
    isviableonestepupstream := false;
    sps := selectset( selection, Elements.astype( StockingPoint_MP ), sp, true, true );
    dlg.SmartPlan( sps, this, isviableonestepupstream );
  *]
  CanBindMultiple: false
  DefinitionID => //ListUnitTree/Responsedef_ListUnitTree_Menu_OnClick
  Initiator: 'MenuSmartPlanStockingPoint'
  Precondition:
  [*
    // returns false when all the selected records are units.
    feedback := Translations::MP_Designer_ListEntity_CanSmartPlan();
    return not forall( selection, Elements, e, true, e.istype( Unit ) ) 
           and MacroPlan.CanPlan( feedback )
           and ScenarioManager::CanStartSmartPlan( ScenarioManager, SelectionScenario.Data(), true, feedback );
  *]
}