| 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 ); | 
|     } | 
|   *] | 
| } |