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

This commit is contained in:
kamonwan taengsuk
2023-08-11 12:31:56 +07:00
parent 71f93ff704
commit 0967dd97da
2 changed files with 613 additions and 7 deletions

View File

@@ -9483,13 +9483,13 @@ namespace rmutr_report.Controllers
}
}
[HttpPost, Route("reports/budget_proposal_details/{type}")]
[HttpPost, Route("reports/budget_expenditure_proposal/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonDetailReport([FromRoute] string type,
[FromBody] set_personnel_budget_permanent personnel)
[FromBody] budget_expenditure_proposal personnel)
{
var workbook = new XLWorkbook();
var ws = workbook.Worksheets.Add("รายละเอียด");
var ws = workbook.Worksheets.Add("Sheet1");
ws.Range("A1:AA1").Merge().Value = "รายละเอียดข้อเสนอวงเงินงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ. " +
personnel.academic_year_name_th;
ws.Range("A1:AA1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
@@ -9516,7 +9516,7 @@ namespace rmutr_report.Controllers
ws.Cell("A4").Style.Font.FontSize = 16;
ws.Cell("A4").Style.Font.Bold = true;
ws.Cell("A5").Value =
"ประเภทหน่วยงาน ..............(ส่วนราชการ/ส่วนราชการไม่สังกัดสำนักนายกรัฐมนตรี/รัฐวิสาหกิจ/องค์การมหาชน/หน่วยงานอิสระ/หน่วยงานศาล/หน่วยงานรัฐสภา/หน่วยงานอื่นของรัฐ)";
"ประเภทหน่วยงาน " + personnel.agency_type;
ws.Cell("A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell("A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("A5").Style.Font.FontName = "TH SarabunPSK";
@@ -9527,6 +9527,10 @@ namespace rmutr_report.Controllers
ws.Cell("AA5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("AA5").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("AA5").Style.Font.FontSize = 16;
ws.Column(1).Width = 50;
ws.Column(2).Width = 15;
ws.Column(3).Width = 15;
ws.Column(4).Width = 15;
ws.Column(5).Width = 15;
ws.Column(6).Width = 15;
ws.Column(7).Width = 15;
@@ -9539,10 +9543,20 @@ namespace rmutr_report.Controllers
ws.Column(14).Width = 15;
ws.Column(15).Width = 15;
ws.Column(16).Width = 15;
ws.Column(17).Width = 30;
ws.Column(17).Width = 15;
ws.Column(18).Width = 15;
ws.Column(19).Width = 15;
ws.Column(20).Width = 15;
ws.Column(21).Width = 15;
ws.Column(22).Width = 15;
ws.Column(23).Width = 15;
ws.Column(24).Width = 15;
ws.Column(25).Width = 15;
ws.Column(26).Width = 15;
ws.Column(27).Width = 25;
int row = 12;
//int no = 1;
if (personnel != null)
{
ws.Range("A6:A11").Merge().Value = "รายการ";
@@ -9756,6 +9770,542 @@ namespace rmutr_report.Controllers
ws.Range("B11:Z11").Style.Border.RightBorder = XLBorderStyleValues.Thin;
ws.Range("B11:Z11").Style.Border.LeftBorder = XLBorderStyleValues.Thin;
ws.Range("B7:Z11").Style.Alignment.WrapText = true;
foreach (var detail in personnel.budget_expenditure_proposal_details)
{
if (detail.topic_type == 1&&detail.topic == "รวมทั้งสิ้น" )
{
ws.Cell(row, 1).Value = "รวมทั้งสิ้น";
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(255, 242, 204);
row++;
}
if (detail.topic_type == 1 && detail.topic != "รวมทั้งสิ้น")
{
ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(255, 242, 204);
row++;
}
if (detail.topic_type == 2)
{
ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(198, 224, 180);
row++;
}
if (detail.topic_type == 3)
{
ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(217, 225, 242);
row++;
}
if (detail.topic_type == 4)
{
ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(252, 228, 214);
row++;
}
if (detail.topic_type == 5)
{
ws.Cell(row, 1).Value = detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor =
XLColor.FromArgb(226, 239, 218);
row++;
}
if (detail.topic_type == 6)
{
ws.Cell(row, 1).Value = " " + detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
//ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor = XLColor.FromArgb(252, 228, 214);
row++;
}
if (detail.topic_type == 7)
{
ws.Cell(row, 1).Value = " " + detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.SetBold().Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
//ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218);
row++;
}
if (detail.topic_type == 8)
{
ws.Cell(row, 1).Value = " " + detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
//ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218);
row++;
}
if (detail.topic_type == 9)
{
ws.Cell(row, 1).Value = " " + detail.topic;
ws.Cell(row, 2).Value = detail.act_year1_1;
ws.Cell(row, 3).Value = detail.act_year1_2;
ws.Cell(row, 4).Value = detail.disbursement_results_1;
ws.Cell(row, 5).Value = detail.disbursement_results_2;
ws.Cell(row, 6).Value = detail.budget_act_year2_1;
ws.Cell(row, 7).Value = detail.budget_act_year2_2;
ws.Cell(row, 8).Value = detail.adjust_the_base_year2_1;
ws.Cell(row, 9).Value = detail.adjust_the_base_year2_2;
ws.Cell(row, 10).Value = detail.request_1;
ws.Cell(row, 11).Value = detail.request_2;
ws.Cell(row, 12).Value = detail.offer_account1_1;
ws.Cell(row, 13).Value = detail.offer_account1_2;
ws.Cell(row, 14).Value = detail.offer_increase_decrease_1;
ws.Cell(row, 15).Value = detail.offer_increase_decrease_2;
ws.Cell(row, 16).Value = detail.offer_new_rate_1;
ws.Cell(row, 17).Value = detail.offer_new_rate_2;
ws.Cell(row, 18).Value = detail.offer_total_1;
ws.Cell(row, 19).Value = detail.offer_total_2;
ws.Cell(row, 20).Value = detail.increase_decrease_from_year_1;
ws.Cell(row, 21).Value = detail.increase_decrease_from_year_2;
ws.Cell(row, 22).Value = detail.increase_decrease_from_year_3;
ws.Cell(row, 23).Value = detail.increase_decrease_from_year_4;
ws.Cell(row, 24).Value = detail.mtef_1;
ws.Cell(row, 25).Value = detail.mtef_2;
ws.Cell(row, 26).Value = detail.mtef_3;
ws.Cell(row, 27).Value = detail.remark;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 27).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.Alignment.Horizontal =
XLAlignmentHorizontalValues.Right;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 26)).Style.NumberFormat.SetFormat("#,#0");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.LeftBorder =
XLBorderStyleValues.Thin;
//ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218);
row++;
}
}
ws.Cell(row, 1).Value =
"หมายเหตุ : 1. บัญชี 2 หมายถึง อัตราใหม่ เงินเพิ่มอื่นที่จ่ายควบกับเงินเดือนและค่าใช้จ่ายตามสิทธิที่กฎหมายกำหนดให้จ่ายแก่อัตราตั้งใหม่ 2. การกำหนดทะเบียนรายการ /ชื่อรายการ ต้องตรงกับชื่อที่กำหนดไว้ตามกฎหมาย และระเบียบที่เกี่ยวข้อง";
ws.Cell(row, 1).Style.Font.FontName =
"TH SarabunPSK";
ws.Cell(row, 1).Style.Font.FontSize = 16;
ws.Cell(row, 1).Style.Alignment.WrapText = true;
}
using (var stream1 = new MemoryStream())
@@ -9766,7 +10316,7 @@ namespace rmutr_report.Controllers
return File(
content,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"budget_proposal_details_" + date + ".xlsx");
"budget_expenditure_proposal_" + date + ".xlsx");
}
}
}