This commit is contained in:
@@ -2111,7 +2111,8 @@ namespace rmutr_report.Controllers
|
||||
|
||||
int r1 = 1;
|
||||
int r2 = 2;
|
||||
|
||||
var result = new List<revenue_estimates>();
|
||||
var res = result.SelectMany(j => j.revenue_estimates_details).Where(t=>t.topic_type==2).ToList();
|
||||
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);
|
||||
@@ -2121,28 +2122,38 @@ namespace rmutr_report.Controllers
|
||||
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);
|
||||
|
||||
var _sum1 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.revenue_estimates);
|
||||
var _sum2 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.less_revenue_estimates);
|
||||
var _sum3 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.balance_revenue_estimates);
|
||||
var _sum4 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.less_accumulated_income);
|
||||
var _sum5 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.balance_before_allocating_according);
|
||||
var _sum6 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.contribution_utility_bills);
|
||||
var _sum7 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.contribution_central_budget);
|
||||
var _sum8 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.contribution_central_expenditure);
|
||||
var _sum9 = revenue_estimate.revenue_estimates_details.Where(j=>j.topic_type==2).Sum(d => d.expenditure_limit);
|
||||
foreach (var detail in revenue_estimate.revenue_estimates_details)
|
||||
{
|
||||
if (detail.topic_type == 1)
|
||||
{
|
||||
ws.Cell(row, 1).Value = detail.topic;
|
||||
ws.Cell(row, 2).Value = sum1;//detail.revenue_estimates;
|
||||
ws.Cell(row, 2).Value = _sum1;//detail.revenue_estimates;
|
||||
ws.Cell(row, 3).Value = "บาท";
|
||||
ws.Cell(row, 4).Value = sum2;//detail.less_revenue_estimates;
|
||||
ws.Cell(row, 4).Value = _sum2;//detail.less_revenue_estimates;
|
||||
ws.Cell(row, 5).Value = "บาท";
|
||||
ws.Cell(row, 6).Value = sum3;//detail.balance_revenue_estimates;
|
||||
ws.Cell(row, 6).Value = _sum3;//detail.balance_revenue_estimates;
|
||||
ws.Cell(row, 7).Value = "บาท";
|
||||
ws.Cell(row, 8).Value = sum4;//detail.less_accumulated_income;
|
||||
ws.Cell(row, 8).Value = _sum4;//detail.less_accumulated_income;
|
||||
ws.Cell(row, 9).Value = "บาท";
|
||||
ws.Cell(row, 10).Value = sum5;//detail.balance_before_allocating_according;
|
||||
ws.Cell(row, 10).Value = _sum5;//detail.balance_before_allocating_according;
|
||||
ws.Cell(row, 11).Value = "บาท";
|
||||
ws.Cell(row, 12).Value = sum6;//detail.contribution_utility_bills;
|
||||
ws.Cell(row, 12).Value = _sum6;//detail.contribution_utility_bills;
|
||||
ws.Cell(row, 13).Value = "บาท";
|
||||
ws.Cell(row, 14).Value = sum7;//detail.contribution_central_budget;
|
||||
ws.Cell(row, 14).Value = _sum7;//detail.contribution_central_budget;
|
||||
ws.Cell(row, 15).Value = "บาท";
|
||||
ws.Cell(row, 16).Value = sum8;//detail.contribution_central_expenditure;
|
||||
ws.Cell(row, 16).Value = _sum8;//detail.contribution_central_expenditure;
|
||||
ws.Cell(row, 17).Value = "บาท";
|
||||
ws.Cell(row, 18).Value = sum9;//detail.expenditure_limit;
|
||||
ws.Cell(row, 18).Value = _sum9;//detail.expenditure_limit;
|
||||
ws.Cell(row, 19).Value = "บาท";
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||
@@ -2346,23 +2357,23 @@ namespace rmutr_report.Controllers
|
||||
if (detail.topic_type == 4)
|
||||
{
|
||||
ws.Cell(row, 1).Value = "รวม";
|
||||
ws.Cell(row, 2).Value = sum1;//detail.revenue_estimates;
|
||||
ws.Cell(row, 2).Value = _sum1;//detail.revenue_estimates;
|
||||
ws.Cell(row, 3).Value = "บาท";
|
||||
ws.Cell(row, 4).Value = sum2;//detail.less_revenue_estimates;
|
||||
ws.Cell(row, 4).Value = _sum2;//detail.less_revenue_estimates;
|
||||
ws.Cell(row, 5).Value = "บาท";
|
||||
ws.Cell(row, 6).Value = sum3;//detail.balance_revenue_estimates;
|
||||
ws.Cell(row, 6).Value = _sum3;//detail.balance_revenue_estimates;
|
||||
ws.Cell(row, 7).Value = "บาท";
|
||||
ws.Cell(row, 8).Value = sum4;//detail.less_accumulated_income;
|
||||
ws.Cell(row, 8).Value = _sum4;//detail.less_accumulated_income;
|
||||
ws.Cell(row, 9).Value = "บาท";
|
||||
ws.Cell(row, 10).Value = sum5;//detail.balance_before_allocating_according;
|
||||
ws.Cell(row, 10).Value = _sum5;//detail.balance_before_allocating_according;
|
||||
ws.Cell(row, 11).Value = "บาท";
|
||||
ws.Cell(row, 12).Value = sum6;//detail.contribution_utility_bills;
|
||||
ws.Cell(row, 12).Value = _sum6;//detail.contribution_utility_bills;
|
||||
ws.Cell(row, 13).Value = "บาท";
|
||||
ws.Cell(row, 14).Value = sum7;//detail.contribution_central_budget;
|
||||
ws.Cell(row, 14).Value = _sum7;//detail.contribution_central_budget;
|
||||
ws.Cell(row, 15).Value = "บาท";
|
||||
ws.Cell(row, 16).Value = sum8;//detail.contribution_central_expenditure;
|
||||
ws.Cell(row, 16).Value = _sum8;//detail.contribution_central_expenditure;
|
||||
ws.Cell(row, 17).Value = "บาท";
|
||||
ws.Cell(row, 18).Value = sum9;//detail.expenditure_limit;
|
||||
ws.Cell(row, 18).Value = _sum9;//detail.expenditure_limit;
|
||||
ws.Cell(row, 19).Value = "บาท";
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
var workbook = new XLWorkbook();
|
||||
var ws = workbook.Worksheets.Add("ค่าเช่าบ้าน");
|
||||
ws.Cell("F1").Value = "แบบ ง.1";
|
||||
ws.Cell("F1").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("F1").Style.Font.FontSize = 16;
|
||||
ws.Cell("F1").Style.Font.Bold = true;
|
||||
ws.Cell("F1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("F1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("G1").Value = "แบบ ง.1";
|
||||
ws.Cell("G1").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("G1").Style.Font.FontSize = 16;
|
||||
ws.Cell("G1").Style.Font.Bold = true;
|
||||
ws.Cell("G1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("G1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("A2:F2").Merge().Value = "รายละเอียดประกอบการเสนอของบประมาณรายการ ค่าเช่าบ้าน ปีงบประมาณ" + _house_for_rent.budget_year;
|
||||
ws.Range("A2:F2").Style.Alignment.WrapText = true;
|
||||
ws.Range("A2:F2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
@@ -101,7 +101,14 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell("F5").Style.Font.FontSize = 16;
|
||||
ws.Cell("F5").Style.Font.Bold = true;
|
||||
ws.Cell("F5").Style.Alignment.WrapText = true;
|
||||
ws.Range("A4:F5").Style.Fill.BackgroundColor = XLColor.SeaShell;
|
||||
ws.Range("G4:G5").Merge().Value = "เบิกจ่ายจริง";
|
||||
ws.Range("G4:G5").Style.Alignment.WrapText = true;
|
||||
ws.Range("G4:G5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Range("G4:G5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("G4").Style.Font.SetBold().Font.FontName = "TH SarabunPSK";
|
||||
ws.Range("G4").Style.Font.FontSize = 16;
|
||||
ws.Range("A3:F3").Style.Font.Bold = true;
|
||||
ws.Range("A4:G5").Style.Fill.BackgroundColor = XLColor.SeaShell;
|
||||
ws.Range("A4:F5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Range("A4:F5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("A4:F5").Style.Border.OutsideBorder =
|
||||
@@ -116,12 +123,17 @@ namespace rmutr_report.Controllers
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("E4:E5").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("G4:G5").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("G4:G5").Style.Border.TopBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Column(1).Width = 10;
|
||||
ws.Column(2).Width = 40;
|
||||
ws.Column(3).Width = 25;
|
||||
ws.Column(4).Width = 15;
|
||||
ws.Column(5).Width = 15;
|
||||
ws.Column(6).Width = 15;
|
||||
ws.Column(7).Width = 15;
|
||||
|
||||
int row = 6;
|
||||
//int row2 = 9;
|
||||
@@ -136,17 +148,18 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 4).Value = house.salary_rate;
|
||||
ws.Cell(row, 5).Value = house.per_month;
|
||||
ws.Cell(row, 6).Value = house.per_year;
|
||||
ws.Cell(row, 7).Value = house.actual_disbursement;
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Font.FontName =
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Font.FontSize = 16;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical =
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Font.FontSize = 16;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder =
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.RightBorder =
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
@@ -154,9 +167,10 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
|
||||
ws.Range(ws.Cell(row, 4), ws.Cell(row, 6)).SetDataType(XLDataType.Number);
|
||||
ws.Range(ws.Cell(row, 4), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#");
|
||||
ws.Range(ws.Cell(row, 4), ws.Cell(row, 7)).SetDataType(XLDataType.Number);
|
||||
ws.Range(ws.Cell(row, 4), ws.Cell(row, 7)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,5 +18,6 @@ namespace rmutr_report.Models
|
||||
|
||||
public decimal? per_month { get; set; }
|
||||
public decimal? per_year { get; set; }
|
||||
public decimal? actual_disbursement { get; set; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user