入库容差
This commit is contained in:
@@ -1939,13 +1939,17 @@ namespace Tnb.ProductionMgr
|
||||
BasFactoryConfig config1 = await db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS);
|
||||
if (config1?.value == "1")
|
||||
{
|
||||
BasFactoryConfig? config2 = await db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS_PERCENTAGE);
|
||||
if (!string.IsNullOrEmpty(config2?.value))
|
||||
// BasFactoryConfig? config2 = await db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS_PERCENTAGE);
|
||||
// if (!string.IsNullOrEmpty(config2?.value))
|
||||
// {
|
||||
// if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty * (100 + Convert.ToDecimal(config2?.value ?? "1")) / 100)
|
||||
// {
|
||||
// throw Oops.Bah($"提报数量不能大于{100 + Convert.ToDecimal(config2?.value ?? "0")}%排产数量");
|
||||
// }
|
||||
// }
|
||||
if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty * (100 + basMaterial.intolerance) / 100)
|
||||
{
|
||||
if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty * (100 + Convert.ToDecimal(config2?.value ?? "1")) / 100)
|
||||
{
|
||||
throw Oops.Bah($"提报数量不能大于{100 + Convert.ToDecimal(config2?.value ?? "0")}%排产数量");
|
||||
}
|
||||
throw Oops.Bah($"提报数量不能大于{100 + basMaterial.intolerance}%排产数量");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1953,28 +1957,6 @@ namespace Tnb.ProductionMgr
|
||||
throw Oops.Bah("提报数量不能大于排产数量");
|
||||
}
|
||||
}
|
||||
|
||||
if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
|
||||
{
|
||||
BasFactoryConfig config1 = await db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS);
|
||||
if (config1?.value == "1")
|
||||
{
|
||||
BasFactoryConfig? config2 = await db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS_PERCENTAGE);
|
||||
if (!string.IsNullOrEmpty(config2?.value))
|
||||
{
|
||||
if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty * (100 + Convert.ToDecimal(config2?.value ?? "1")) / 100)
|
||||
{
|
||||
throw Oops.Bah($"提报数量不能大于{100 + Convert.ToDecimal(config2?.value ?? "0")}%排产数量");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Oops.Bah("提报数量不能大于排产数量");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty;
|
||||
// if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
|
||||
|
||||
Reference in New Issue
Block a user