|
|
|
@ -6,10 +6,12 @@ using System.Text; |
|
|
|
using System.Web.UI; |
|
|
|
using System.Web.UI.HtmlControls; |
|
|
|
using BWP.B3Frameworks; |
|
|
|
using BWP.B3Frameworks.BO.MoneyTemplate; |
|
|
|
using BWP.B3Sale.BO; |
|
|
|
using BWP.Web.Pages.B3Sale; |
|
|
|
using BWP.Web.Pages.B3Sale.Bills.CarLoading_; |
|
|
|
using Forks.Drawing; |
|
|
|
using Forks.EnterpriseServices; |
|
|
|
using Forks.EnterpriseServices.DataForm; |
|
|
|
using Forks.Utils; |
|
|
|
using TSingSoft.WebControls2.BillReports; |
|
|
|
@ -99,9 +101,104 @@ namespace BWP.Web.Pages.TypeIOCs |
|
|
|
dic.Add("$DetailInfo3", list); |
|
|
|
PageSize = 100; |
|
|
|
dic.Add("$DetailInfo2", new Func<object>(() => GetPrintStyle(Dmo))); |
|
|
|
dic.Add("$万福装车单明细", new Func<object>(() => Get万福装车单明细(Dmo))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private string Get万福装车单明细(CarLoading dmo) |
|
|
|
{ |
|
|
|
var sb=new StringBuilder(); |
|
|
|
sb.AppendLine("<table id='wanfuloadingtable' style='border-collapse:collapse;' width='100%' bordercolor='Black' border='1'>"); |
|
|
|
sb.AppendLine("<tr><td>客户</td><td>存货名称</td><td>规格</td><td>件数</td><td>主单位</td><td>计划数量</td><td>数量</td><td>发货标记</td><td>复称数量</td><td>备注</td></tr>"); |
|
|
|
|
|
|
|
var list = GetWanFuCarLoadingList(dmo); |
|
|
|
foreach (IGrouping<string, TempClassForCarLoadingWanFu> grouping in list.GroupBy(x=>x.Customer_Name)) |
|
|
|
{ |
|
|
|
AppendByGrouping(sb,grouping); |
|
|
|
} |
|
|
|
|
|
|
|
AppendSumRow(sb,list); |
|
|
|
|
|
|
|
sb.AppendLine("</table>"); |
|
|
|
|
|
|
|
return sb.ToString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void AppendSumRow(StringBuilder sb, List<TempClassForCarLoadingWanFu> list) |
|
|
|
{ |
|
|
|
var sumOrderSecondNumber = (Money<二位小数>?)list.Sum(x => (x.OrderSecondNumber ?? 0).Value); |
|
|
|
var sumOrderUnitNum = (Money<二位小数>?)list.Sum(x => (x.OrderUnitNum ?? 0).Value); |
|
|
|
var sumUnitNum = (Money<二位小数>?)list.Sum(x => (x.UnitNum ?? 0).Value); |
|
|
|
sb.AppendLine("<tr><td colspan='3'>合计</td><td>" + sumOrderSecondNumber + "</td><td></td><td>" + sumOrderUnitNum + "</td><td>" + sumUnitNum + "</td><td></td><td></td><td></td></tr>"); |
|
|
|
} |
|
|
|
|
|
|
|
private void AppendByGrouping(StringBuilder sb, IGrouping<string, TempClassForCarLoadingWanFu> grouping) |
|
|
|
{ |
|
|
|
var isfirst = true; |
|
|
|
var count = grouping.Count(); |
|
|
|
foreach (TempClassForCarLoadingWanFu wanFu in grouping) |
|
|
|
{ |
|
|
|
if (isfirst) |
|
|
|
{ |
|
|
|
isfirst = false; |
|
|
|
sb.AppendLine("<tr><td rowspan='"+ count + "'>"+ wanFu.Customer_Name+ "</td><td>"+wanFu.Goods_Name+"</td><td>"+wanFu.Goods_Spec+"</td><td>"+wanFu.OrderSecondNumber+"</td><td>"+wanFu.Goods_MainUnit+"</td><td>"+wanFu.OrderUnitNum+"</td><td>"+wanFu.UnitNum+"</td><td></td><td></td><td>"+wanFu.Remark+"</td></tr>"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
sb.AppendLine("<tr><td>" + wanFu.Goods_Name + "</td><td>" + wanFu.Goods_Spec + "</td><td>" + wanFu.OrderSecondNumber + "</td><td>" + wanFu.Goods_MainUnit + "</td><td>" + wanFu.OrderUnitNum + "</td><td>" + wanFu.UnitNum + "</td><td></td><td></td><td>" + wanFu.Remark + "</td></tr>"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private List<TempClassForCarLoadingWanFu> GetWanFuCarLoadingList(CarLoading dmo) |
|
|
|
{ |
|
|
|
|
|
|
|
var bill=new JoinAlias(typeof(CarLoading)); |
|
|
|
var detail=new JoinAlias(typeof(CarLoading_BillDetail)); |
|
|
|
var outstore= new JoinAlias(typeof(SaleOutStore)); |
|
|
|
var outstoreDetail= new JoinAlias(typeof(SaleOutStore_Detail)); |
|
|
|
var orderDetail= new JoinAlias(typeof(Order_Detail)); |
|
|
|
|
|
|
|
var query=new DQueryDom(bill); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(bill, "ID",detail, "CarLoading_ID")); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(outstore), DQCondition.EQ(detail, "BillID", outstore, "ID")); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(outstoreDetail), DQCondition.EQ(outstoreDetail, "SaleOutStore_ID", detail, "BillID")); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(orderDetail), DQCondition.EQ(outstoreDetail, "Order_DetailID", orderDetail, "ID")); |
|
|
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Field("Customer_Name", outstore)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_Name", outstoreDetail)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_Spec", outstoreDetail)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("SecondNumber", orderDetail, "OrderSecondNumber")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Goods_MainUnit", outstoreDetail)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("UnitNum", orderDetail, "OrderUnitNum")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("UnitNum", outstoreDetail, "UnitNum")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Remark", detail)); |
|
|
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.EQ(bill,"ID", dmo.ID)); |
|
|
|
var list = new List<TempClassForCarLoadingWanFu>(); |
|
|
|
using (var session=Dmo.NewSession()) |
|
|
|
{ |
|
|
|
using (var reader= session.ExecuteReader(query)) |
|
|
|
{ |
|
|
|
while (reader.Read()) |
|
|
|
{ |
|
|
|
var model=new TempClassForCarLoadingWanFu(); |
|
|
|
model.Customer_Name = (string) reader[0]; |
|
|
|
model.Goods_Name= (string)reader[1]; |
|
|
|
model.Goods_Spec = (string)reader[2]; |
|
|
|
model.OrderSecondNumber = (Money<decimal>?)reader[3]; |
|
|
|
model.Goods_MainUnit = (string)reader[4]; |
|
|
|
model.OrderUnitNum = (Money<decimal>?)reader[5]; |
|
|
|
model.UnitNum = (Money<decimal>?)reader[6]; |
|
|
|
model.Remark = (string)reader[7]; |
|
|
|
list.Add(model); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
readonly StringBuilder mHtml = new StringBuilder(); |
|
|
|
//readonly StringBuilder mHtml2 = new StringBuilder();
|
|
|
|
@ -169,7 +266,7 @@ namespace BWP.Web.Pages.TypeIOCs |
|
|
|
table.Rows.Add(row); |
|
|
|
if (first) |
|
|
|
{ |
|
|
|
row.EAdd("center", group.Count() + 1, 1, (string)dataRow["Customer_Name"]); |
|
|
|
row.EAdd("center", group.Count() , 1, (string)dataRow["Customer_Name"]); |
|
|
|
|
|
|
|
first = false; |
|
|
|
} |
|
|
|
@ -180,7 +277,7 @@ namespace BWP.Web.Pages.TypeIOCs |
|
|
|
main = (main ?? 0) + (mainNum ?? 0); |
|
|
|
sec = (sec ?? 0) + (secNum ?? 0); |
|
|
|
} |
|
|
|
table.EAddRow("center", 1, 1, "小计", "", sec.ToString(), "", main.ToString(),main.ToString(), "", "", ""); |
|
|
|
//table.EAddRow("center", 1, 1, "小计", "", sec.ToString(), "", main.ToString(),main.ToString(), "", "", "");
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -279,4 +376,34 @@ namespace BWP.Web.Pages.TypeIOCs |
|
|
|
|
|
|
|
public static int rowCount; |
|
|
|
} |
|
|
|
|
|
|
|
[DFClass,Serializable] |
|
|
|
class TempClassForCarLoadingWanFu |
|
|
|
{ |
|
|
|
[LogicName("客户")] |
|
|
|
public string Customer_Name { get; set; } |
|
|
|
|
|
|
|
[LogicName("存货")] |
|
|
|
public string Goods_Name { get; set; } |
|
|
|
|
|
|
|
[LogicName("规格")] |
|
|
|
public string Goods_Spec { get; set; } |
|
|
|
|
|
|
|
[LogicName("件数")] |
|
|
|
public Money<decimal>? OrderSecondNumber { get; set; } |
|
|
|
|
|
|
|
[LogicName("主单位")] |
|
|
|
public string Goods_MainUnit { get; set; } |
|
|
|
|
|
|
|
[LogicName("计划数量")] |
|
|
|
public Money<decimal>? OrderUnitNum { get; set; } |
|
|
|
|
|
|
|
[LogicName("数量")] |
|
|
|
public Money<decimal>? UnitNum { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
[LogicName("备注")] |
|
|
|
public string Remark { get; set; } |
|
|
|
|
|
|
|
} |
|
|
|
} |