fixed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-09-27 13:35:01 +07:00
parent ad2149cba1
commit d3f411d2e5
7 changed files with 199 additions and 184 deletions

View File

@@ -2109,28 +2109,38 @@ namespace rmutr_report.Controllers
int r1 = 1; int r1 = 1;
int r2 = 2; int r2 = 2;
var sum1 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.revenue_estimates);
var sum2 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.less_revenue_estimates);
var sum3 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.balance_revenue_estimates);
var sum4 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.less_accumulated_income);
var sum5 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.balance_before_allocating_according);
var sum6 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.contribution_utility_bills);
var sum7 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.contribution_central_budget);
var sum8 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.contribution_central_expenditure);
var sum9 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==3).Sum(d => d.expenditure_limit);
foreach (var detail in revenue_estimate.revenue_estimates_details) foreach (var detail in revenue_estimate.revenue_estimates_details)
{ {
if (detail.topic_type == 1) if (detail.topic_type == 1)
{ {
ws.Cell(row, 1).Value = detail.topic; ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.revenue_estimates; ws.Cell(row, 2).Value = sum1;//data1.Sum(d => d.revenue_estimates);
ws.Cell(row, 3).Value = "บาท"; ws.Cell(row, 3).Value = "บาท";
ws.Cell(row, 4).Value = detail.less_revenue_estimates; ws.Cell(row, 4).Value = sum2;//data1.Sum(d => d.less_revenue_estimates);
ws.Cell(row, 5).Value = "บาท"; ws.Cell(row, 5).Value = "บาท";
ws.Cell(row, 6).Value = detail.balance_revenue_estimates; ws.Cell(row, 6).Value = sum3;//data1.Sum(d => d.balance_revenue_estimates);
ws.Cell(row, 7).Value = "บาท"; ws.Cell(row, 7).Value = "บาท";
ws.Cell(row, 8).Value = detail.less_accumulated_income; ws.Cell(row, 8).Value = sum4;//data1.Sum(d => d.less_accumulated_income);
ws.Cell(row, 9).Value = "บาท"; ws.Cell(row, 9).Value = "บาท";
ws.Cell(row, 10).Value = detail.balance_before_allocating_according; ws.Cell(row, 10).Value = sum5;//data1.Sum(d => d.balance_before_allocating_according);
ws.Cell(row, 11).Value = "บาท"; ws.Cell(row, 11).Value = "บาท";
ws.Cell(row, 12).Value = detail.contribution_utility_bills; ws.Cell(row, 12).Value = sum6;//data1.Sum(d => d.contribution_utility_bills);
ws.Cell(row, 13).Value = "บาท"; ws.Cell(row, 13).Value = "บาท";
ws.Cell(row, 14).Value = detail.contribution_central_budget; ws.Cell(row, 14).Value = sum7;//data1.Sum(d => d.contribution_central_budget);
ws.Cell(row, 15).Value = "บาท"; ws.Cell(row, 15).Value = "บาท";
ws.Cell(row, 16).Value = detail.contribution_central_expenditure; ws.Cell(row, 16).Value = sum8;//data1.Sum(d => d.contribution_central_expenditure);
ws.Cell(row, 17).Value = "บาท"; ws.Cell(row, 17).Value = "บาท";
ws.Cell(row, 18).Value = detail.expenditure_limit; ws.Cell(row, 18).Value = sum9;//data1.Sum(d => d.expenditure_limit);
ws.Cell(row, 19).Value = "บาท"; ws.Cell(row, 19).Value = "บาท";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName = ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
@@ -2177,28 +2187,29 @@ namespace rmutr_report.Controllers
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
row++; row++;
} }
if (detail.topic_type == 2) if (detail.topic_type == 2)
{ {
ws.Cell(row, 1).Value = detail.topic; ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.revenue_estimates; ws.Cell(row, 2).Value = sum1;//data1.Sum(d => d.revenue_estimates);
ws.Cell(row, 3).Value = "บาท"; ws.Cell(row, 3).Value = "บาท";
ws.Cell(row, 4).Value = detail.less_revenue_estimates; ws.Cell(row, 4).Value = sum2;//data1.Sum(d => d.less_revenue_estimates);
ws.Cell(row, 5).Value = "บาท"; ws.Cell(row, 5).Value = "บาท";
ws.Cell(row, 6).Value = detail.balance_revenue_estimates; ws.Cell(row, 6).Value = sum3;//data1.Sum(d => d.balance_revenue_estimates);
ws.Cell(row, 7).Value = "บาท"; ws.Cell(row, 7).Value = "บาท";
ws.Cell(row, 8).Value = detail.less_accumulated_income; ws.Cell(row, 8).Value = sum4;//data1.Sum(d => d.less_accumulated_income);
ws.Cell(row, 9).Value = "บาท"; ws.Cell(row, 9).Value = "บาท";
ws.Cell(row, 10).Value = detail.balance_before_allocating_according; ws.Cell(row, 10).Value = sum5;//data1.Sum(d => d.balance_before_allocating_according);
ws.Cell(row, 11).Value = "บาท"; ws.Cell(row, 11).Value = "บาท";
ws.Cell(row, 12).Value = detail.contribution_utility_bills; ws.Cell(row, 12).Value = sum6;//data1.Sum(d => d.contribution_utility_bills);
ws.Cell(row, 13).Value = "บาท"; ws.Cell(row, 13).Value = "บาท";
ws.Cell(row, 14).Value = detail.contribution_central_budget; ws.Cell(row, 14).Value = sum7;//data1.Sum(d => d.contribution_central_budget);
ws.Cell(row, 15).Value = "บาท"; ws.Cell(row, 15).Value = "บาท";
ws.Cell(row, 16).Value = detail.contribution_central_expenditure; ws.Cell(row, 16).Value = sum8;//data1.Sum(d => d.contribution_central_expenditure);
ws.Cell(row, 17).Value = "บาท"; ws.Cell(row, 17).Value = "บาท";
ws.Cell(row, 18).Value = detail.expenditure_limit; ws.Cell(row, 18).Value = sum9;//data1.Sum(d => d.expenditure_limit);
ws.Cell(row, 19).Value = "บาท"; ws.Cell(row, 19).Value = "บาท";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName = ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
@@ -2243,6 +2254,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
row++; row++;
} }
if (detail.topic_type == 3) if (detail.topic_type == 3)
@@ -2311,26 +2323,28 @@ namespace rmutr_report.Controllers
row++; row++;
} }
// if (detail.topic_type == 4)
// {
if (detail.topic_type == 4) if (detail.topic_type == 4)
{ {
ws.Cell(row, 1).Value = "รวม"; ws.Cell(row, 1).Value = "รวม";
ws.Cell(row, 2).Value = detail.revenue_estimates; ws.Cell(row, 2).Value = sum1;//data1.Sum(d => d.revenue_estimates);
ws.Cell(row, 3).Value = "บาท"; ws.Cell(row, 3).Value = "บาท";
ws.Cell(row, 4).Value = detail.less_revenue_estimates; ws.Cell(row, 4).Value = sum2;//data1.Sum(d => d.less_revenue_estimates);
ws.Cell(row, 5).Value = "บาท"; ws.Cell(row, 5).Value = "บาท";
ws.Cell(row, 6).Value = detail.balance_revenue_estimates; ws.Cell(row, 6).Value = sum3;//data1.Sum(d => d.balance_revenue_estimates);
ws.Cell(row, 7).Value = "บาท"; ws.Cell(row, 7).Value = "บาท";
ws.Cell(row, 8).Value = detail.less_accumulated_income; ws.Cell(row, 8).Value = sum4;//data1.Sum(d => d.less_accumulated_income);
ws.Cell(row, 9).Value = "บาท"; ws.Cell(row, 9).Value = "บาท";
ws.Cell(row, 10).Value = detail.balance_before_allocating_according; ws.Cell(row, 10).Value = sum5;//data1.Sum(d => d.balance_before_allocating_according);
ws.Cell(row, 11).Value = "บาท"; ws.Cell(row, 11).Value = "บาท";
ws.Cell(row, 12).Value = detail.contribution_utility_bills; ws.Cell(row, 12).Value = sum6;//data1.Sum(d => d.contribution_utility_bills);
ws.Cell(row, 13).Value = "บาท"; ws.Cell(row, 13).Value = "บาท";
ws.Cell(row, 14).Value = detail.contribution_central_budget; ws.Cell(row, 14).Value = sum7;//data1.Sum(d => d.contribution_central_budget);
ws.Cell(row, 15).Value = "บาท"; ws.Cell(row, 15).Value = "บาท";
ws.Cell(row, 16).Value = detail.contribution_central_expenditure; ws.Cell(row, 16).Value = sum8;//data1.Sum(d => d.contribution_central_expenditure);
ws.Cell(row, 17).Value = "บาท"; ws.Cell(row, 17).Value = "บาท";
ws.Cell(row, 18).Value = detail.expenditure_limit; ws.Cell(row, 18).Value = sum9;//data1.Sum(d => d.expenditure_limit);
ws.Cell(row, 19).Value = "บาท"; ws.Cell(row, 19).Value = "บาท";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName = ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
@@ -2376,6 +2390,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
row++; row++;
//}
} }
if (detail.is_footer == true) if (detail.is_footer == true)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.