出入库任务单在金蝶没查到任务单 就作废

This commit is contained in:
18942506660
2024-07-29 16:00:44 +08:00
parent bb3a28bcfd
commit 0fe5c20eff
14 changed files with 378 additions and 37 deletions

View File

@@ -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;
}
}
}