|
|
|
@ -26,6 +26,8 @@ using BWP.B3Sale.Utils; |
|
|
|
using BWP.B3UnitedInfos; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using BWP.B3Frameworks.BO; |
|
|
|
|
|
|
|
namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
|
{ |
|
|
|
@ -128,12 +130,50 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
|
vPanel.Add(hPanel); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PriceBillTemp |
|
|
|
{ |
|
|
|
|
|
|
|
public long ID { get; set; } |
|
|
|
public long AccountingUnit_ID { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public static void Regiester(DQueryDom query) |
|
|
|
{ |
|
|
|
string[] field = { "ID" , "AccountingUnit_ID" }; |
|
|
|
query.RegisterQueryTable(typeof(PriceBillTemp), field, CreateQuery()); |
|
|
|
} |
|
|
|
|
|
|
|
private static DQueryDom CreateQuery() |
|
|
|
{ |
|
|
|
var main = new JoinAlias("__price_main", typeof(PriceBill)); |
|
|
|
var detail = new JoinAlias("__price_acc_detail", typeof(PriceBill_AccountingUnitDetail)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "PriceBill_ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID", main)); |
|
|
|
query.Columns.Add(DQSelectColumn.Min(detail, "AccountingUnit_ID")); |
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field(main, "ID")); |
|
|
|
return query; |
|
|
|
} |
|
|
|
|
|
|
|
public static void AddJoin(DQueryDom query, JoinAlias joinAlias) |
|
|
|
{ |
|
|
|
var root = query.From.RootSource.Alias; |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(joinAlias), DQCondition.And( |
|
|
|
DQCondition.EQ(joinAlias, "ID", root, "ID") |
|
|
|
)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private DQueryDom CreateQueryGridQuery() |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mainFields = new[] {"AccountingUnit_Name" }; |
|
|
|
var detailFields = new[] {"ID", "Goods_Name", "GoodsProperty_Name", "SourcePrice", "Price" }; |
|
|
|
|
|
|
|
|
|
|
|
@ -141,17 +181,21 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
|
var dom = mQueryContainer.Build(); |
|
|
|
var main = dom.From.RootSource.Alias; |
|
|
|
var detail = JoinAlias.Create("detail"); |
|
|
|
var priceTemp = new JoinAlias("priTemp", typeof(PriceBillTemp)); |
|
|
|
PriceBillTemp.Regiester(dom); |
|
|
|
PriceBillTemp.AddJoin(dom, priceTemp); |
|
|
|
var auu = new JoinAlias("auu", typeof(AccountingUnit)); |
|
|
|
dom.From.AddJoin(JoinType.Left, new DQDmoSource(auu), DQCondition.EQ(priceTemp, "AccountingUnit_ID", auu, "ID")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var field in mainFields) |
|
|
|
{ |
|
|
|
dom.Columns.Add(DQSelectColumn.Field(field, main)); |
|
|
|
} |
|
|
|
foreach (var field in detailFields) |
|
|
|
{ |
|
|
|
dom.Columns.Add(DQSelectColumn.Field(field, detail)); |
|
|
|
} |
|
|
|
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Snippet<string>("''"), "备注")); |
|
|
|
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(main, "ID"), "MainID")); |
|
|
|
dom.Columns.Add(DQSelectColumn.Create(DQExpression.Field(auu, "Name"), "会计单位")); |
|
|
|
QueryID = ViewStateUtil.Current.SaveToPersistenceMedium(dom.Where.Conditions); |
|
|
|
dom.Where.Conditions.Add(DQCondition.EQ(main, "BillState", 单据状态.未审核)); |
|
|
|
var billFlowCataID = new B3YunKenOnlineConfiguration().PriceAdjustBillFlowState.Value; |
|
|
|
@ -199,7 +243,7 @@ namespace BWP.Web.Pages.B3YunKen.Bill |
|
|
|
_grid.DFGridSetEnabled = false; |
|
|
|
_grid.MultiSelectionEnabled = true; |
|
|
|
_grid.Columns.EAdd(new DFBrowseGridColumn("Goods_Name")).HeaderText = "标准件"; |
|
|
|
_grid.Columns.Add(new DFBrowseGridColumn("AccountingUnit_Name")); |
|
|
|
_grid.Columns.EAdd(new DFBrowseGridColumn("会计单位")).HeaderText = "会计单位"; ; |
|
|
|
_grid.Columns.EAdd(new DFBrowseGridColumn( "GoodsProperty_Name")).HeaderText = "存货分类"; |
|
|
|
_grid.Columns.EAdd(new DFBrowseGridColumn("SourcePrice")).HeaderText = "原单价"; |
|
|
|
_grid.Columns.EAdd(new DFEditGridColumn<DFTextBox>("Price")).HeaderText = "调整单价"; |
|
|
|
|