yanyuan
2023-11-10 143ef74e2eeee697ac8fda3d9032a790fbb4e146
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
Quintiq file version 2.0
#parent: #root
Method Update (
  Boolean hasuom,
  String unitofmeasurename,
  Boolean isnegativeinventoryallowed,
  Boolean isexcluded,
  Boolean isexcludedfrombalancing,
  Boolean issafetystockkept,
  Real inputlotsize,
  Boolean isexcludeshelflife,
  Boolean isfromdb
)
{
  Description: 'Update instance of PISP specification.'
  TextBody:
  [*
    // TYG2 Jul-21-2016 (created)
    
    this.HasUnitOfMeasure( hasuom );
    this.UnitOfMeasureName( unitofmeasurename );
    this.IsExcluded( isexcluded );
    this.IsExcludedFromBalancing( isexcludedfrombalancing ); 
    this.IsSafetyStockKept( issafetystockkept );
    this.InputLotSize( inputlotsize );
    
    isNegativeInventoryAllowedChanged := isnegativeinventoryallowed <> this.IsNegativeInventoryAllowed()
    this.IsNegativeInventoryAllowed( isnegativeinventoryallowed );
    // if the is allowed is updated
    if( isNegativeInventoryAllowedChanged
        and not isnull( this.ProductInStockingPoint_MP() ) )
    {
      // This relation will be null when this is called in MPSync::ImportProducts,
      // because PISP is generated by lanes, routings or sales demands, those are
      // imported after products.
      this.ProductInStockingPoint_MP().OnSettingIsNegativeAllowed();
    }
    
    this.IsExcludeShelfLifeAndMaturation( isexcludeshelflife );
    this.IsManuallyConfigured( not isfromdb )
  *]
}