|
|
|
@ -21,6 +21,9 @@ using BWP.B3UnitedInfos; |
|
|
|
using Forks.Utils; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using BWP.B3Frameworks.BO.MoneyTemplate; |
|
|
|
using BWP.B3Frameworks.Utils; |
|
|
|
using BWP.B3UnitedInfos.BO; |
|
|
|
using BWP.B3SaleInterface.BO; |
|
|
|
|
|
|
|
namespace BWP.Web.Pages.B3YunKen.Reports |
|
|
|
{ |
|
|
|
@ -41,7 +44,7 @@ namespace BWP.Web.Pages.B3YunKen.Reports |
|
|
|
} |
|
|
|
|
|
|
|
CheckBoxListWithReverseSelect checkbox; |
|
|
|
DFChoiceBox _goods, _goodsPropertyCatalog, _brandItem, _productLine, _goodsBatch; |
|
|
|
DFChoiceBox _goods, _brandItem, _productLine, _goodsBatch; |
|
|
|
DFTextBox _saleout; |
|
|
|
DFNamedValueInput<运费承担方> freightBear; |
|
|
|
//
|
|
|
|
@ -129,7 +132,7 @@ B3FrameworksConsts.DataSources.授权会计单位全部), s => long.Parse(s)), " |
|
|
|
layout.Add("Goods_ID", new SimpleLabel("存货"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(_goods = QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], B3SaleDataSources.可销售存货), s => long.Parse(s)), "Goods_ID")); |
|
|
|
layout["Goods_ID"].NotAutoAddToContainer = true; |
|
|
|
|
|
|
|
layout.Add("GoodsPropertyCatalog_ID", new SimpleLabel("属性分类"), _goodsPropertyCatalog = new DFChoiceBox() { DataKind = B3UnitedInfosConsts.DataSources.存货属性分类, Width = Unit.Empty, EnableTopItem = true, EnableMultiSelection = true, EnableMultiSelectionViewer = true, EnableInputArgument = true }, false); |
|
|
|
layout.Add("GoodsPropertyCatalog_ID", new SimpleLabel("属性分类"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(_productLine = QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], B3UnitedInfosConsts.DataSources.存货属性分类), s => long.Parse(s)), "GoodsPropertyCatalog_ID")); |
|
|
|
layout["GoodsPropertyCatalog_ID"].NotAutoAddToContainer = true; |
|
|
|
|
|
|
|
layout.Add("ProductLine_ID", new SimpleLabel("产品线"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(_productLine = QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["ID"], B3UnitedInfosConsts.DataSources.产品线全部), s => long.Parse(s)), "ProductLine_ID")); |
|
|
|
@ -152,7 +155,10 @@ B3SaleDataSources.结账客户), s => long.Parse(s)), "AccountCustomer_ID")); |
|
|
|
layout.Add("Employee_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["Employee_ID"], B3FrameworksConsts.DataSources.授权员工全部), s => long.Parse(s)), "Employee_ID")); |
|
|
|
layout["Employee_ID"].NotAutoAddToContainer = true; |
|
|
|
|
|
|
|
layout.Add("CustomerSaleZone_ID", new SimpleLabel("销售地区"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["CustomerSaleZone_ID"], B3SaleDataSources.授权销售地区)), "CustomerSaleZone_ID")); |
|
|
|
//layout.Add("CustomerSaleZone_ID", new SimpleLabel("销售地区"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["CustomerSaleZone_ID"], B3SaleDataSources.授权销售地区)), "CustomerSaleZone_ID"));
|
|
|
|
//layout["CustomerSaleZone_ID"].NotAutoAddToContainer = true;
|
|
|
|
|
|
|
|
layout.Add("CustomerSaleZone_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["CustomerSaleZone_ID"], B3SaleDataSources.授权销售地区), s => long.Parse(s)), "CustomerSaleZone_ID")); |
|
|
|
layout["CustomerSaleZone_ID"].NotAutoAddToContainer = true; |
|
|
|
|
|
|
|
layout.Add("Store_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["Store_ID"], B3FrameworksConsts.DataSources.授权仓库), s => long.Parse(s)), "Store_ID")); |
|
|
|
@ -239,6 +245,13 @@ B3SaleDataSources.经销商), s => long.Parse(s)), "CustomerDealer_ID")); |
|
|
|
var packageData = new JoinAlias(typeof(PackageData)); |
|
|
|
var outStore = new JoinAlias(typeof(SaleOutStore)); |
|
|
|
var outDetail = new JoinAlias(typeof(SaleOutStore_Detail)); |
|
|
|
var catalog = new JoinAlias(typeof(GoodsPropertyCatalog)); |
|
|
|
var customer = new JoinAlias(typeof(Customer)); |
|
|
|
var salzone = new JoinAlias("zone",typeof(SaleZone)); |
|
|
|
var goodsProperty = new JoinAlias(typeof(GoodsProperty)); |
|
|
|
var customerCatalo = new JoinAlias(typeof(SaleCustomerCatalog)); |
|
|
|
|
|
|
|
//var salzone = JoinAlias.Create("_9");
|
|
|
|
//var cus = new JoinAlias(typeof(Customer));
|
|
|
|
|
|
|
|
dom.RegisterQueryTable(typeof(PackageData), new string[] { "Goods_ID", "Price", "AccountingUnit_ID" }, GetGoods_Package()); |
|
|
|
@ -249,9 +262,15 @@ B3SaleDataSources.经销商), s => long.Parse(s)), "CustomerDealer_ID")); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(outDetail), DQCondition.And(DQCondition.EQ(detail, "BillType", DmoTypeIDAttribute.GetID(typeof(SaleOutStore))), |
|
|
|
DQCondition.EQ(outDetail, "ID", detail, "SourceBillDetailID"))); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(packageData), |
|
|
|
DQCondition.And(DQCondition.EQ(packageData, "Goods_ID", detail, "SaleGoods_ID"), DQCondition.EQ(packageData, "AccountingUnit_ID", main, "AccountingUnit_ID"))); |
|
|
|
DQCondition.And(DQCondition.EQ(packageData, "Goods_ID", detail, "SaleGoods_ID"), DQCondition.EQ(packageData, "AccountingUnit_ID", main, "AccountingUnit_ID"))); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), |
|
|
|
DQCondition.EQ(goods, "ID", detail, "SaleGoods_ID")); |
|
|
|
DQCondition.EQ(goods, "ID", detail, "SaleGoods_ID")); |
|
|
|
|
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(customer), DQCondition.EQ(main, "Customer_ID", customer, "ID")); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(salzone), DQCondition.EQ(customer, "SaleZone_ID", salzone, "ID")); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goodsProperty, "ID", goods, "GoodsProperty_ID")); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(catalog), DQCondition.EQ(catalog, "ID", goodsProperty, "GoodsPropertyCatalog_ID")); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(customerCatalo), DQCondition.EQ(customerCatalo, "ID", customer, "CustomerCatalog_ID")); |
|
|
|
//dom.From.AddJoin(JoinType.Left, new DQDmoSource(cus), DQCondition.EQ(main, "", cus));
|
|
|
|
|
|
|
|
var freightMoney = DQExpression.Multiply(DQExpression.Field(main, "FreightPrice"), DQExpression.Divide(DQExpression.Field(detail, "AcceptNum"), DQExpression.NullIfZero(DQExpression.Field(main, "AcceptNumber")))); |
|
|
|
@ -407,9 +426,12 @@ B3SaleDataSources.经销商), s => long.Parse(s)), "CustomerDealer_ID")); |
|
|
|
if (!_brandItem.IsEmpty) { |
|
|
|
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "BrandItem_ID"), _brandItem.GetValues().Select(x => DQExpression.Value(x)).ToArray())); |
|
|
|
} |
|
|
|
if (!_goodsPropertyCatalog.IsEmpty) { |
|
|
|
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "GoodsPropertyCatalog_ID"), _goodsPropertyCatalog.GetValues().Select(x => DQExpression.Value(x)).ToArray())); |
|
|
|
} |
|
|
|
//if (!_goodsPropertyCatalog.IsEmpty) {
|
|
|
|
// dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(detail, "GoodsPropertyCatalog_ID"), _goodsPropertyCatalog.GetValues().Select(x => DQExpression.Value(x)).ToArray()));
|
|
|
|
//}
|
|
|
|
TreeUtil.AddTreeMultiSelectConditions<GoodsPropertyCatalog>(dom, mQueryContainer, "GoodsPropertyCatalog_ID", catalog); |
|
|
|
TreeUtil.AddTreeMultiSelectConditions<SaleZone>(dom, mQueryContainer, "CustomerSaleZone_ID", salzone); |
|
|
|
TreeUtil.AddTreeMultiSelectConditions<SaleCustomerCatalog>(dom, mQueryContainer, "Customer_CustomerCatalog_ID", customerCatalo); |
|
|
|
if (!_productLine.IsEmpty) { |
|
|
|
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field(goods, "ProductLine_ID"), _productLine.GetValues().Select(x => DQExpression.Value(x)).ToArray())); |
|
|
|
} |
|
|
|
|