|
|
@ -207,13 +207,13 @@ namespace CK.SCP.GrupUniApi.Controller |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" + |
|
|
|
"FROM (SELECT SUM(a.Qty) AS RecQty, a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum,a.batch\n" + |
|
|
|
" FROM V_TB_RECEIVE_DETAIL AS a INNER JOIN\n" + |
|
|
|
" V_TB_ASN_DETAIL AS B ON a.AsnBillNum = B.AsnBillNum AND a.PoLine = B.PoLine AND\n" + |
|
|
|
" a.PartCode = B.PartCode AND a.PoBillNum = B.PoBillNum and a.Batch=b.Batch\n" + |
|
|
|
" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" + |
|
|
|
"WHERE (AsnBillNum = '{0}')"; |
|
|
|
//string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batch\n" +
|
|
|
|
//"FROM (SELECT SUM(a.Qty) AS RecQty, a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum,a.batch\n" +
|
|
|
|
//" FROM V_TB_RECEIVE_DETAIL AS a INNER JOIN\n" +
|
|
|
|
//" V_TB_ASN_DETAIL AS B ON a.AsnBillNum = B.AsnBillNum AND a.PoLine = B.PoLine AND\n" +
|
|
|
|
//" a.PartCode = B.PartCode AND a.PoBillNum = B.PoBillNum and a.Batch=b.Batch\n" +
|
|
|
|
//" GROUP BY a.AsnBillNum, a.PoLine, a.PartCode, a.PoBillNum) AS d\n" +
|
|
|
|
//"WHERE (AsnBillNum = '{0}')";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -279,10 +279,10 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc |
|
|
|
BillType = billtype |
|
|
|
}; |
|
|
|
scpRcvList.Add(scpRcv); |
|
|
|
if (!string.IsNullOrEmpty(scpRcv.AsnBillNum)) |
|
|
|
{ |
|
|
|
_lsQty = wdb.Database.SqlQuery<TB_RECEIVE_QTY>(_recvQty, scpRcv.RecvBillNum).ToList(); |
|
|
|
} |
|
|
|
//if (!string.IsNullOrEmpty(scpRcv.AsnBillNum))
|
|
|
|
//{
|
|
|
|
// _lsQty = wdb.Database.SqlQuery<TB_RECEIVE_QTY>(_recvQty, scpRcv.RecvBillNum).ToList();
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -361,23 +361,23 @@ string _recvQty = "SELECT RecQty, AsnBillNum, PoLine, PartCode, PoBillNum,Batc |
|
|
|
BillType = billtype |
|
|
|
}; |
|
|
|
scpRcveDetailList.Add(scpRcvDetail); |
|
|
|
var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum |
|
|
|
&& p.PartCode== qadData.xxwms_rc_part |
|
|
|
&& p.Batch==qadData.xxwms_rc_lot |
|
|
|
&& p.PoBillNum==qadData.xxwms_rc_po_nbr |
|
|
|
&& p.PoLine==qadData.xxwms_rc_po_line |
|
|
|
); |
|
|
|
var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum |
|
|
|
&& p.PartCode == qadData.xxwms_rc_part |
|
|
|
&& p.Batch == qadData.xxwms_rc_lot |
|
|
|
&& p.PoBillNum == qadData.xxwms_rc_po_nbr |
|
|
|
&& p.PoLine == qadData.xxwms_rc_po_line); |
|
|
|
|
|
|
|
if (_first != null && _fs!=null) |
|
|
|
{ |
|
|
|
_first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString(); |
|
|
|
wdb.TB_ASN_DETAIL.AddOrUpdate(_first); |
|
|
|
} |
|
|
|
//var _first= wdb.TB_ASN_DETAIL.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum
|
|
|
|
//&& p.PartCode== qadData.xxwms_rc_part
|
|
|
|
//&& p.Batch==qadData.xxwms_rc_lot
|
|
|
|
//&& p.PoBillNum==qadData.xxwms_rc_po_nbr
|
|
|
|
//&& p.PoLine==qadData.xxwms_rc_po_line
|
|
|
|
//);
|
|
|
|
//var _fs=_lsQty.FirstOrDefault(p => p.AsnBillNum == scpRcv.AsnBillNum
|
|
|
|
// && p.PartCode == qadData.xxwms_rc_part
|
|
|
|
// && p.Batch == qadData.xxwms_rc_lot
|
|
|
|
// && p.PoBillNum == qadData.xxwms_rc_po_nbr
|
|
|
|
// && p.PoLine == qadData.xxwms_rc_po_line);
|
|
|
|
|
|
|
|
//if (_first != null && _fs!=null)
|
|
|
|
//{
|
|
|
|
// _first.Extend1 = (_fs.RecQty!=null?_fs.RecQty.Value:0 + qadData.xxwms_rc_qty_total).ToString();
|
|
|
|
// wdb.TB_ASN_DETAIL.AddOrUpdate(_first);
|
|
|
|
//}
|
|
|
|
} |
|
|
|
//var scpPoDetail =
|
|
|
|
// wdb.TB_PO_DETAIL.FirstOrDefault(
|
|
|
|