public void SetInoutLine(VAdvantage.Model.MInOutLine line) { int _CountDTD001 = Util.GetValueOfInt(DB.ExecuteScalar("SELECT COUNT(AD_MODULEINFO_ID) FROM AD_MODULEINFO WHERE PREFIX='DTD001_'")); if (_CountDTD001 > 0) { SetM_InOutLine_ID(line.GetM_InOut_ID()); SetDTD001_TotalQty(line.GetMovementQty()); SetM_Product_ID(line.GetM_Product_ID()); SetM_AttributeSetInstance_ID(line.GetM_AttributeSetInstance_ID()); decimal totalPackQty = Util.GetValueOfDecimal(DB.ExecuteScalar("SELECT SUM(Qty) FROM M_PackageLine WHERE M_InOutLine_ID=" + GetM_InOutLine_ID())); SetQty(line.GetMovementQty() - totalPackQty); SetDTD001_AlreadyPackQty(totalPackQty); SetConfirmedQty(line.GetMovementQty() - totalPackQty); SetDTD001_ConfirmDate(System.DateTime.Now); } }
/// <summary> /// Before Delete /// </summary> /// <returns>true if acct was deleted</returns> protected override bool BeforeDelete() { if (IsPosted()) { if (!MPeriod.IsOpen(GetCtx(), GetDateTrx(), MDocBaseType.DOCBASETYPE_MATCHPO)) { return(false); } SetPosted(false); return(true);// MFactAcct.Delete(Table_ID, Get_ID(), Get_Trx()) >= 0; } //JID_0162: System should allow to delete the Matched PO of PO and MR with complete status only. if (GetC_OrderLine_ID() != 0) { MOrderLine line = new MOrderLine(GetCtx(), GetC_OrderLine_ID(), Get_TrxName()); MOrder ord = new MOrder(GetCtx(), line.GetC_Order_ID(), Get_TrxName()); if (ord.GetDocStatus() != DocumentEngine.ACTION_COMPLETE) { log.SaveError("Error", Msg.GetMsg(GetCtx(), "Order/ShipmentNotCompleted")); return(false); } } if (GetM_InOutLine_ID() != 0) { MInOutLine line = new MInOutLine(GetCtx(), GetM_InOutLine_ID(), Get_TrxName()); MInOut ino = new MInOut(GetCtx(), line.GetM_InOut_ID(), Get_TrxName()); if (ino.GetDocStatus() != DocumentEngine.ACTION_COMPLETE) { log.SaveError("Error", Msg.GetMsg(GetCtx(), "Order/ShipmentNotCompleted")); return(false); } } return(true); }