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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Quintiq file version 2.0
#parent: #root
StaticMethod Update (
  InventorySpecifications inventoryspecifications,
  Product_MP product,
  StockingPoint_MP stockingpoint,
  Date start,
  Boolean isbatchedittarget,
  Boolean hastargetindays,
  Real targetindays,
  Real targetinquantity,
  Boolean isbatcheditminlevel,
  Boolean hasminlevelindays,
  Real minlevelindays,
  Real minlevelinquantity,
  Boolean isbatcheditmaxlevel,
  Boolean hasmaxlevel,
  Boolean hasmaxlevelindays,
  Real maxlevelindays,
  Real maxlevelinquantity,
  Boolean iscalculated
)
{
  Description: 'Batch edit inventory specifications, data get from UI.'
  TextBody:
  [*
    // soh yee May-1-2013 (created)
    
    traverse( inventoryspecifications, Elements, inventoryspecification )
    {
      // Case related to batch edit.
      if( inventoryspecifications.Size() > 1 )
      {
        // Primary keys are disabled during batch editing
        product := inventoryspecification.Product_MP();
        stockingpoint := inventoryspecification.StockingPoint_MP();
        start := inventoryspecification.Start();
    
        // Get back the inventory specification's value if the batch edit check boxes are not checked, instead of from UI.
        if( not isbatchedittarget )
        {
          hastargetindays := inventoryspecification.HasTargetInDays_DELETED_Nov19();
          targetindays := inventoryspecification.TargetInDays_DELETED_Nov19();
          targetinquantity := inventoryspecification.TargetInQuantity_DELETED_Nov19();
        }
    
        if( not isbatcheditminlevel )
        {
          hasminlevelindays := inventoryspecification.HasMinLevelInDays();
          minlevelindays := inventoryspecification.MinLevelInDays();
          minlevelinquantity := inventoryspecification.MinLevelInQuantity();
        }
    
        if( not isbatcheditmaxlevel )
        {
          hasmaxlevel := inventoryspecification.HasMaxLevel();
          hasmaxlevelindays := inventoryspecification.HasMaxLevelInDays();
          maxlevelindays := inventoryspecification.MaxLevelInDays();
          maxlevelinquantity := inventoryspecification.MaxLevelInQuantity();
        }
      }
    
      inventoryspecification.Update( product,
                                     stockingpoint,
                                     start,
                                     hastargetindays,
                                     targetindays,
                                     targetinquantity,
                                     hasminlevelindays,
                                     minlevelindays,
                                     minlevelinquantity,
                                     hasmaxlevel,
                                     hasmaxlevelindays,
                                     maxlevelindays,
                                     maxlevelinquantity, 
                                     iscalculated,
                                     false );
    }
  *]
}