yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
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
StaticMethod CanMoveQuantity (
  NewSupply sourcenewsupply,
  ProductInStockingPointInPeriod destinationPISPIP,
  output String feedback_o
) const remote as Boolean
{
  Description: 'check if moving new supply quantity is allowed. (Precondition in desginer)'
  TextBody:
  [*
    // huat heng Sep-17-2013 (created)
    feedback_o := '';
    
    sourcePISPIP := sourcenewsupply.ProductInStockingPointInPeriodPlanningLeaf();
    sourcePISP := sourcePISPIP.ProductInStockingPoint_MP();
    destinationPISP := destinationPISPIP.ProductInStockingPoint_MP();
    
    //same productinstockingpoint and different period
    if( sourcenewsupply.IsNewSupplyOfTrip() )
    {
      feedback_o := Translations::MP_PeriodTaskOperation_CanMoveQuantity_IsNewSupplyOfTrip();
    }
    else if( sourcePISP <> destinationPISP )
    {
      feedback_o := Translations::MP_PeriodTaskOperation_CanMoveQuantity_IsDifferentPISP( sourcePISP.Name(), destinationPISP.Name() );
    }
    else if( sourcePISPIP = destinationPISPIP )
    {
      feedback_o := Translations::MP_PeriodTaskOperation_CanMoveQuantity_IsSamePeriod();
    }
    return feedback_o = '';
  *]
}