修复bug
This commit is contained in:
@@ -87,6 +87,11 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// <returns></returns>
|
||||
public Result OutStock(int materialId, decimal qty)
|
||||
{
|
||||
if (this.Status == OutStockStatus.Already)
|
||||
return Result.ReFailure(ResultCodes.OutStockTaskAlready);
|
||||
if (this.Status == OutStockStatus.Repeal)
|
||||
return Result.ReFailure(ResultCodes.OutStockTaskRepeal);
|
||||
|
||||
var detail = this.Details.FirstOrDefault(f => f.MaterialId == materialId);
|
||||
if (detail == null) return Result.ReFailure(ResultCodes.OrderNoData);
|
||||
if ((detail.AccruedQty - detail.RealityQty) < qty)
|
||||
@@ -94,8 +99,9 @@ namespace WMS.Web.Domain.Entitys
|
||||
|
||||
if (detail.RealityQty <= 0)
|
||||
detail.OutStockBeginTime = DateTime.Now;
|
||||
|
||||
detail.OutStockEndTime = DateTime.Now;
|
||||
//全部出库完成
|
||||
if (detail.AccruedQty == (detail.RealityQty + qty))
|
||||
detail.OutStockEndTime = DateTime.Now;
|
||||
|
||||
detail.RealityQty = detail.RealityQty + qty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user