修正领料申请入库的错误

This commit is contained in:
gongxh
2021-05-20 11:17:06 +08:00
parent 4550c925da
commit c06d2d80e7
3 changed files with 38 additions and 6 deletions

View File

@@ -111,8 +111,15 @@ namespace NX.ERP.Model.Response.Store
public string PesoSeq { get; set; }
[JsonIgnore]
public string DeptName { get; set; }
[JsonIgnore]
public string ProductNo { get; set; }
[JsonIgnore]
public decimal MoQuantity { get; set; }
[JsonIgnore]
public string DeptCode { get; set; }
}

View File

@@ -51,7 +51,7 @@ namespace NX.ERP.U8.Store
, b.iMPoIds AS MPoIds, b.comcode AS OmCode, b.iOMoDID AS OMoDId, b.cciqbookcode AS ciqBookCode, b.cmworkcentercode AS mWorkCenterCode
, b.cservicecode AS servicecode, b.isotype AS SoType, b.csocode AS SoCode, b.isodid AS SodId, b.isoseq AS SoSeq
, b.iordertype AS ordertype, b.iordercode AS OrderCode, b.iorderdid AS OrderdId, b.iorderseq AS OrderSeq, b.ipesotype AS PesoType
, b.cpesocode AS PesoCode, b.ipesodid AS PesodId, b.ipesoseq AS PesoSeq
, b.cpesocode AS PesoCode, b.ipesodid AS PesodId, b.ipesoseq AS PesoSeq,b.cdepCode as DeptCode,cdepName as DeptName,b.cinvcode as ProductNo,b.imquantity as MoQuantity
FROM MaterialAppVouch a
LEFT JOIN KCMATERIALAPPLIST b ON a.id = b.id";
if (!string.IsNullOrEmpty(strWhere))

View File

@@ -39,7 +39,12 @@ namespace NX.ERP.U8.Store
}
headXml.setAttribute("cbustype", "领料");
headXml.setAttribute("cbuscode", metailApp.Code);
string lastProductNo = null;
string lastProductNo = null;
decimal moqty = 0;
string DeptName = "";
string moCode = "";
string DeptCode = "";
IXMLDOMElement bodyXml;
for (var n = 0; n < storeOut.Details.Count(); n++)
{
@@ -49,6 +54,25 @@ namespace NX.ERP.U8.Store
{
throw new Exception("未知明细");
}
if (lastProductNo == null)
{
lastProductNo = materialAppDetail.ProductNo;
moqty = materialAppDetail.MoQuantity;
DeptName = materialAppDetail.DeptName;
DeptCode = materialAppDetail.DeptCode;
moCode = materialAppDetail.MoCode;
}
else if (lastProductNo != "" && lastProductNo != materialAppDetail.ProductNo)
{
lastProductNo = "";
moqty = 0;
}
bodyXml = domBody.createElement("z:row");
var metail = new NX.ERP.U8.MaterialDAL().GetInvPrice(detail.InvCode, 1, storeOut.Whcode, out var _cost);
bodyXml.setAttribute("iunitcost", _cost);
@@ -94,9 +118,10 @@ namespace NX.ERP.U8.Store
}
headXml.setAttribute("cpspcode", lastProductNo);
headXml.setAttribute("imquantity", moqty);
headXml.setAttribute("cdepname", DeptName);
headXml.setAttribute("cdepcode", DeptCode);
headXml.setAttribute("cmpocode", moCode);
}