|
|
|
@ -13,6 +13,7 @@ using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using Forks.Utils; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using BWP.B3ButcherManage.BO; |
|
|
|
using BWP.B3QingDaoWanFu.Utils; |
|
|
|
|
|
|
|
namespace BWP.B3QingDaoWanFu.TypeIOCs |
|
|
|
{ |
|
|
|
@ -26,15 +27,30 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs |
|
|
|
detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); |
|
|
|
} |
|
|
|
|
|
|
|
var query=new DmoQuery(typeof(SaleGoods_Accounting_Store)); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID",dmo.AccountingUnit_ID)); |
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"),dmo.Details.Select(x=>DQExpression.Value(x.SaleGoods_ID)).ToArray())); |
|
|
|
CheckStoreGoodsConsistent(context,dmo); |
|
|
|
} |
|
|
|
|
|
|
|
void CheckStoreGoodsConsistent(IDmoContext context, SaleOutStore dmo) |
|
|
|
{ |
|
|
|
var notchntrolstoreids= new WanFuOnlineConfig().SaleoutstoreSaveNotCheckStoreGoodsConsistent.Value.ToList(); |
|
|
|
if (notchntrolstoreids.Count == 0) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
if (notchntrolstoreids.Contains(Convert.ToInt32((dmo.Store_ID ?? 0)) )) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var query = new DmoQuery(typeof(SaleGoods_Accounting_Store)); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID", dmo.AccountingUnit_ID)); |
|
|
|
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"), dmo.Details.Select(x => DQExpression.Value(x.SaleGoods_ID)).ToArray())); |
|
|
|
var list = context.Session.ExecuteList(query).Cast<SaleGoods_Accounting_Store>().ToList(); |
|
|
|
foreach (SaleGoods_Accounting_Store storeset in list) |
|
|
|
{ |
|
|
|
if (storeset.Store_ID != dmo.Store_ID) |
|
|
|
{ |
|
|
|
throw new Exception(storeset.SaleGoods_Name+"配置的仓库:"+storeset.Store_Name+" 与单据上的仓库不一致,不允许保存"); |
|
|
|
throw new Exception(storeset.SaleGoods_Name + "配置的仓库:" + storeset.Store_Name + " 与单据上的仓库不一致,不允许保存"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|