Browse Source

要货看板零件号已经作废不能发货

master
lvzb 1 year ago
parent
commit
dbbee893b6
  1. 24
      Controller/SCP_ASN_CONTROLLER.cs

24
Controller/SCP_ASN_CONTROLLER.cs

@ -3108,18 +3108,22 @@ namespace CK.SCP.Controller
} }
p_entitys.ForEach(itm => p_entitys.ForEach(itm =>
{ {
var askdeail = db.TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.State != -1 && p.IsDeleted == false);//判断是否作废
var _sum = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode if (askdeail == null)
&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.AskQty).Sum();//要货单要货数量 {
var _currSum = db.V_TB_ASN_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode _ret.MessageList.Add(string.Format("要货看板{1}零件号{0}已经作废不能发货,请联系采购员确认!", itm.PartCode, itm.AskBillNum));
&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum();//当前存在发货单数量 }
var _curr = db.V_TB_ASN_DETAIL.Where(p => p.AsnBillNum == p_asn.AsnBillNum && p.PartCode == itm.PartCode //var _sum = db.V_TB_ASK_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode
&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum(); // && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.AskQty).Sum();//要货单要货数量
var _rejct = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == p_asn.AskBillNum && p.PartCode == itm.PartCode //var _currSum = db.V_TB_ASN_DETAIL.Where(p => p.AskBillNum == p_asn.AskBillNum && p.PartCode == itm.PartCode
&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false&&p.BillType==3).Select(p => p.Qty).ToList().Sum(); // && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum();//当前存在发货单数量
//var _curr = db.V_TB_ASN_DETAIL.Where(p => p.AsnBillNum == p_asn.AsnBillNum && p.PartCode == itm.PartCode
// && p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false).Select(p => p.Qty).Sum();
// var _rejct = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == p_asn.AskBillNum && p.PartCode == itm.PartCode
//&& p.PoBillNum == p_asn.PoBillNum && p.PoLine == itm.PoLine && p.IsDeleted == false&&p.BillType==3).Select(p => p.Qty).ToList().Sum();
//if (_currSum - _curr + itm.Qty- Math.Abs(_rejct) <= _sum) //if (_currSum - _curr + itm.Qty- Math.Abs(_rejct) <= _sum)
//{ //{
TB_ASN_DETAIL _detail = new TB_ASN_DETAIL(); TB_ASN_DETAIL _detail = new TB_ASN_DETAIL();
_detail.UID = itm.UID; _detail.UID = itm.UID;
_detail.UnConv = itm.UnConv; _detail.UnConv = itm.UnConv;
_detail.AsnBillNum = itm.AsnBillNum; _detail.AsnBillNum = itm.AsnBillNum;

Loading…
Cancel
Save