出入库任务单在金蝶没查到任务单 就作废
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Npoi.Mapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
@@ -292,5 +293,21 @@ namespace WMS.Web.Domain.Entitys
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
/// <summary>
|
||||
/// erp删单 作废处理
|
||||
/// </summary>
|
||||
public void ErpDel(string sourceBillNo)
|
||||
{
|
||||
foreach (var d in this.Details)
|
||||
{
|
||||
d.ErpDetails.Where(w => w.SourceBillNo.Equals(sourceBillNo)).ForEach(f => f.AccruedQty = 0);
|
||||
|
||||
d.AccruedQty = d.ErpDetails.Sum(s => s.AccruedQty);
|
||||
if (d.AccruedQty <= 0) d.IsRepeal = true;
|
||||
}
|
||||
//明细都作废后 整个单据作废
|
||||
if (this.Details.Count() == this.Details.Where(w => w.IsRepeal == true).Count())
|
||||
this.Status = OutStockStatus.Repeal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user