Browse Source

master
luanhui 7 years ago
parent
commit
85e98cfeb3
2 changed files with 34 additions and 4 deletions
  1. +20
    -4
      B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs
  2. +14
    -0
      B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs

+ 20
- 4
B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs View File

@ -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 + " 与单据上的仓库不一致,不允许保存");
}
}
}


+ 14
- 0
B3QingDaoWanFu/Utils/WanFuOnlineConfig.cs View File

@ -18,6 +18,20 @@ namespace BWP.B3QingDaoWanFu.Utils
ConfigurationUtil.Fill(this);
}
private IntListConfigRef _saleoutstoreSaveNotCheckStoreGoodsConsistent = new IntListConfigRef();
[LogicName("销售出库保存不受存货仓库设置控制的仓库ID")]
[ConfigurationItemGroup("青岛万福")]
[ConfigurationItemDescription("销售出库保存不是存货仓库设置控制的仓库ID")]
[DomainConfigurationItem]
public IntListConfigRef SaleoutstoreSaveNotCheckStoreGoodsConsistent
{
get { return _saleoutstoreSaveNotCheckStoreGoodsConsistent; }
set { _saleoutstoreSaveNotCheckStoreGoodsConsistent = value; }
}
private IntConfigRef _receiptTypeID = new IntConfigRef(0);


Loading…
Cancel
Save