Browse Source

采购订单,TB_PO_DETAIL里的price取TB_price里当前日期在有效开始和结束时间范围内的,UID最大的记录那条价格

master
yidi.wu 11 months ago
parent
commit
d103ab23a9
  1. 2
      Controller/SCP_PO_CONTROLLER.cs

2
Controller/SCP_PO_CONTROLLER.cs

@ -7212,7 +7212,7 @@ namespace CK.SCP.Controller
DateTime dateTime = DateTime.Now; DateTime dateTime = DateTime.Now;
if(_price2> dateTime|| _price2 ==dateTime) if(_price2> dateTime|| _price2 ==dateTime)
{ {
var _price3 = db.TB_PRICE.FirstOrDefault(t => t.PartCode == _detail.PartCode.ToUpper() && t.EndTime == _price2 && t.VendId == p_Po.VendId); var _price3 = db.TB_PRICE.Where(t => t.PartCode == _detail.PartCode.ToUpper() && t.EndTime == _price2 && t.VendId == p_Po.VendId).OrderByDescending(o => o.UID).FirstOrDefault(); //获取最新采购的价格
_detail.Price = _price3.Amt; _detail.Price = _price3.Amt;
} }
else else

Loading…
Cancel
Save