Quintiq file version 2.0
#parent: pl_Function_FCOV/btn_huanyuan_FCOV
Response OnClick (
  S_DT_CustomOrder selection
) id:Response_pl_Function_FCOV_btn_huanyuan_FCOV_OnClick
{
  #keys: '[414724.0.303365693]'
  CanBindMultiple: false
  DefinitionID => /pl_Function_FCOV/Responsedef_pl_Function_FCOV_btn_huanyuan_FCOV_OnClick
  Precondition:
  [*
    return not isnull( selection) and selection.ParentID()="";
  *]
  QuillAction
  {
    Body:
    [*
      Num:=WebMessageBox::Question(  "确认要还原拆分订单吗？
                                     
                                     注意：还原后已拆分结果将被清空",true);
      if(Num=0)
      {
        // 清理拆分记录表
        traverse( MacroPlan,S_DT_SpliteStruct,obj,obj.ID_S_DT_CustomOrder()=selection.ID())
        {
          obj.Delete();  
        }
        // 清理拆分订单
        traverse( MacroPlan,S_DT_CustomOrder,obj,obj.ParentID()=selection.ID())
        {
            obj.Delete();
        }
        // 清理订单
        selection.Delete();
        WebMessageBox::Information( "订单已经还原");
      }
    *]
    GroupServerCalls: false
  }
}
