| Quintiq file version 2.0 | 
| #parent: PanelOrderLockHeader_545/ButtonOrderLockHeaderLock | 
| Response OnClick () id:Response_PanelOrderLockHeader_545_ButtonOrderLockHeaderLock_OnClick | 
| { | 
|   #keys: '[412960.0.245380616]' | 
|   DefinitionID: 'Responsedef_WebButton_OnClick' | 
|   GroupServerCalls: true | 
|   Precondition: | 
|   [* | 
|     checkorders := DataHolderOrderLockCheckedOrder.Data(); | 
|     pispips := construct( ProductInStockingPointInPeriods ); | 
|     traverse( checkorders, Elements, order ){ | 
|       pispips.Add( selectset( order, ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip, true ) ); | 
|       } | 
|     return ProductInStockingPointInPeriod::CanLockUnlock( pispips, feedback ); | 
|   *] | 
|   QuillAction | 
|   { | 
|     Body: | 
|     [* | 
|       checkorders := DataHolderOrderLockCheckedOrder.Data(); | 
|       pispips := construct( ProductInStockingPointInPeriods ); | 
|       macroplan := MacroPlan; | 
|       traverse( checkorders, Elements, order ){ | 
|         pispips := pispips.Add( selectset( order, ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip, pispip.SupplyQuantity() > 0 ) ); | 
|         } | 
|        | 
|       pispipLeafs := selectset( pispips,  | 
|                                 Elements.astype( ProductInStockingPointInPeriodPlanningLeaf ),  | 
|                                 pispip,  | 
|                                 true ); | 
|        | 
|       CustomerOrder::LockUnlock( macroplan, checkorders, true ); | 
|       ProductInStockingPointInPeriod::LockUnlockPlanning( pispipLeafs, true, true ); | 
|     *] | 
|   } | 
| } |