yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
StaticMethod CanUpdateInMatrix (
  output String feedback_o,
  String attr,
  ProductInStockingPointInPeriod pispip
) declarative remote as Boolean
{
  Description: 'Returns true if pispip and attribute selected can be directly typed in the matrix. Used in web designer.'
  TextBody:
  [*
    feedback_o := '';
    
    if( attr = attribute( ProductInStockingPointInPeriod, PlannedInventoryLevelEnd ).Name() )
    {
      feedback_o := Translations::MP_WebDesigner_PlannedInventoryNotEditable();
    }
    else if( pispip.ProductInStockingPoint_MP().Product_MP().HasShelfLifeOrMaturation()
             and pispip.ActualProductInStockingPointInPeriod( relsize ) = 0 )
    {
      feedback_o := Translations::MP_WebDesigner_ProductHasShelfLife();
    }
    else if( pispip.ProductInStockingPoint_MP().Product_MP().HasShelfLifeOrMaturation()
             and pispip.ActualProductInStockingPointInPeriod( relsize ) > 1 )
    {
      feedback_o := Translations::MP_WebDesigner_MultiManufacturedDate();
    }
    else if( not pispip.Period_MP().IsHistorical() )
    {
      feedback_o := Translations::MP_ActualProductInStockingPointInPeriod_ValidateInput_IsValidDate( pispip.MacroPlan().StartOfPlanning().Date() );
    }
    
    return feedback_o = '';
  *]
}