Browse Source

增加打印格式

master
duanluohua 7 years ago
parent
commit
1a36f1bb85
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationPrint.cs

+ 24
- 0
B3_DongFangWanQi.Web/Pages/B3_DongFangWanQi/Bills/ProductionNotification_/ProductionNotificationPrint.cs View File

@ -15,8 +15,11 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
protected override void AddParameters(IDictionary<string, object> dic)
{
dic.Add("$Details", Dmo.Details);
dic.Add("$OutDetails", Dmo.OutDetails);
dic.Add("$DetailType", typeof(ProductionNotification_Detail));
dic.Add("$OutDetailType", typeof(ProductionNotificationOutStore_Detail));
dic.Add("$相同产品并行显示", Get相同产品并行显示());
dic.Add("$其他出库相同产品并行显示", Get其他出库相同产品并行显示());
}
void AddSolidSType(StringBuilder str)
{
@ -50,5 +53,26 @@ namespace BWP.Web.Pages.B3_DongFangWanQi.Bills.ProductionNotification_
str.Append("</div>");
return str.ToString();
}
private string Get其他出库相同产品并行显示()
{
var str = new StringBuilder();
str.Append("<div id='binghang'>");
AddSolidSType(str);
str.Append(@"<table border='1' width='100%'>");
str.Append("<tr><td>其他出库单号</td><td>存货</td><td>规格</td><td>主单位</td><td>辅单位</td><td>批号</td><td>税率</td><td>单价</td><td>往来金额</td><td>数量</td><td>辅单位数量</td></tr>");
foreach (IGrouping<string, ProductionNotificationOutStore_Detail> grouping in Dmo.OutDetails.GroupBy(x => x.Goods_Name))
{
foreach (ProductionNotificationOutStore_Detail detail in grouping)
{
str.Append("<tr><td>" + detail.OtherOutStore_ID + "</td><td>" + detail.Goods_Name +"</td><td>" + detail.Goods_Spec + "</td><td>" + detail.Goods_MainUnit + "</td><td>" + detail.Goods_SecondUnit + "</td><td>" + detail.GoodsBatch_Name + "</td><td>" + detail.TaxRate + "</td><td>" + detail.Price + "</td><td>" + detail.AccountMoney + "</td><td>" + detail.Number + "</td><td>" + detail.SecondNumber + "</td></tr>");
}
str.Append("<tr><td colspan='8'>合计</td><td>" + (Money<>?)grouping.Sum(x => (x.AccountMoney ?? 0).Value) + "</td><td>" + (Money<>?)grouping.Sum(x => (x.Number ?? 0).Value) + "</td><td>" + (Money<>?)grouping.Sum(x => (x.SecondNumber ?? 0).Value) + "</td></tr>");
}
str.Append("</div>");
return str.ToString();
}
}
}

Loading…
Cancel
Save