/// <summary> /// Create Confirmation or return existing one /// </summary> /// <param name="move">movement</param> /// <param name="checkExisting">if false, new confirmation is created</param> /// <returns>Confirmation</returns> public static MMovementConfirm Create(MMovement move, Boolean checkExisting) { if (checkExisting) { MMovementConfirm[] confirmations = move.GetConfirmations(false); for (int i = 0; i < confirmations.Length; i++) { MMovementConfirm confirm1 = confirmations[i]; if (confirm1 != null) { return(confirm1); } } } MMovementConfirm confirm = new MMovementConfirm(move); confirm.Save(move.Get_TrxName()); MMovementLine[] moveLines = move.GetLines(false); for (int i = 0; i < moveLines.Length; i++) { MMovementLine mLine = moveLines[i]; MMovementLineConfirm cLine = new MMovementLineConfirm(confirm); cLine.SetMovementLine(mLine); // setting QtyEntered in Target Qty on Confirmation Line cLine.SetTargetQty(mLine.GetQtyEntered()); cLine.SetConfirmedQty(mLine.GetQtyEntered()); cLine.Save(move.Get_TrxName()); } // Change By Arpit Rai on 24th August,2017 To Check if VA Material Quality Control Module exists or not if (Util.GetValueOfInt(DB.ExecuteScalar("SELECT COUNT(*) FROM AD_ModuleInfo WHERE Prefix='VA010_'", null, null)) > 0) { CreateConfirmParameters(move, confirm.GetM_MovementConfirm_ID(), confirm.GetCtx()); } return(confirm); }
/// <summary> /// Parent constructor /// </summary> /// <param name="parent">parent</param> public MMovementLineConfirm(MMovementConfirm parent) : this(parent.GetCtx(), 0, parent.Get_TrxName()) { SetClientOrg(parent); SetM_MovementConfirm_ID(parent.GetM_MovementConfirm_ID()); }