diff --git a/NX.ERP.U8/Base/MaterielDAL.cs b/NX.ERP.U8/Base/MaterielDAL.cs index d7f4c6e..b8a8348 100644 --- a/NX.ERP.U8/Base/MaterielDAL.cs +++ b/NX.ERP.U8/Base/MaterielDAL.cs @@ -435,12 +435,13 @@ namespace NX.ERP.U8 strSQL = $@" SELECT (CASE WHEN convert(decimal(36,3),isnull(inum,0))=0 then 0 else iMoney / iNum END) AS iPrice from IA_Summary WHERE cWhCode='{whCode}' AND cInvCode='{cInvCode}' AND iMonth={DateTime.Today.Month - 1} and iyear ={DateTime.Today.Year}"; _cost = conn.ExecuteScalar(strSQL, null, null, 10, System.Data.CommandType.Text); + } switch (cType) { case "按计价方式取单价": - iInvCost = _cost; + iInvCost = Math.Max(0,_cost); break; case "计划单价":