diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index bf1d866..180b804 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -493,7 +493,8 @@ namespace rmutr_report.Controllers return Ok(); } - [HttpPost, Route("reports/personnel_salary_government_employee/{type}")] + + [HttpPost, Route("reports/personnel_salary_government_employee/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetPersonSalaryReport([FromRoute] string type, [FromBody] personnel_salary_government_employee_root _personnel) @@ -863,7 +864,7 @@ namespace rmutr_report.Controllers row++; foreach (var deltail2 in detail.personnel_salary_government_employee_deltail) { - if (deltail2.full_name != "รวม") + if (deltail2.first_name_th != "รวม") { ws.Cell(row, 1).Value = no; no++; @@ -887,7 +888,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 18).Value = deltail2.quantity_money; ws.Cell(row, 19).Value = deltail2.total2; ws.Cell(row, 20).Value = deltail2.including_salary_and_fittings; - ws.Cell(row, 21).Value = deltail2.including_salary_and_fittings_12 ; + ws.Cell(row, 21).Value = deltail2.including_salary_and_fittings_12; ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 3).Style.Border.LeftBorder = XLBorderStyleValues.Thin; @@ -926,9 +927,9 @@ namespace rmutr_report.Controllers row++; } - if (deltail2.full_name == "รวม") + if (deltail2.first_name_th == "รวม") { - ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = deltail2.full_name; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = deltail2.first_name_th; ws.Cell(row, 5).Value = deltail2.position; ws.Cell(row, 6).Value = deltail2.parent_agency_name; ws.Cell(row, 7).Value = deltail2.area; @@ -945,7 +946,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 18).Value = deltail2.quantity_money; ws.Cell(row, 19).Value = deltail2.total2; ws.Cell(row, 20).Value = deltail2.including_salary_and_fittings; - ws.Cell(row, 21).Value = deltail2.including_salary_and_fittings_12 ; + ws.Cell(row, 21).Value = deltail2.including_salary_and_fittings_12; ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -981,29 +982,23 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#"); } } - if (detail.is_footer==true) + + if (detail.is_footer == true) { - - ws.Cell(row+2, 1).Value = "หมายเหตุ : ในกรณีที่เงินเดือนตุลาคม 2564 ยังไม่เลื่อนขั้นเงินเดือน ให้กรอกเงินเลื่อนขั้น 4% ในช่อง (2)"; - ws.Cell(row+2, 1).Style.Font.FontName = + ws.Cell(row + 2, 1).Value = + "หมายเหตุ : ในกรณีที่เงินเดือนตุลาคม 2564 ยังไม่เลื่อนขั้นเงินเดือน ให้กรอกเงินเลื่อนขั้น 4% ในช่อง (2)"; + ws.Cell(row + 2, 1).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row+2, 1).Style.Font.FontSize = 16; + ws.Cell(row + 2, 1).Style.Font.FontSize = 16; } - if (detail.is_footer==false) + + if (detail.is_footer == false) { ws.Cell(row, 1).Value = ""; - } } - } - var richText = ws.PageSetup.Footer.Left.AddText( - "หมายเหตุ : ในกรณีที่เงินเดือนตุลาคม 2564 ยังไม่เลื่อนขั้นเงินเดือน ให้กรอกเงินเลื่อนขั้น 4% ในช่อง (2)", - XLHFOccurrence.FirstPage); - richText.FontSize = 16; - richText.FontName = "TH SarabunPSK"; - using (var stream1 = new MemoryStream()) { workbook.SaveAs(stream1); @@ -1015,516 +1010,7 @@ namespace rmutr_report.Controllers "personnel_government_employee_" + date + ".xlsx"); } } - - - // [HttpPost, Route("reports/personnel_salary_permanent/{type}")] - // [ApiExplorerSettings(GroupName = "reports")] - // public IActionResult GetPersonSalaryReport([FromRoute] string type, - // [FromBody] personnel_salary_permanent_root _personnel) - // { - // var workbook = new XLWorkbook(); - // var ws = workbook.Worksheets.Add("พนักงานราชการ"); - // if (_personnel.year == "2567") - // { - // _personnel.year = "2566"; - // } - // - // ws.Range("A1:T1").Merge().Value = "รายละเอียดเงินเดือนและส่วนควบของพนักงานราชการ ประจำปีงบประมาณ พ.ศ. " + - // _personnel.year; - // ws.Cell("A1").Style.Alignment.WrapText = true; - // ws.Range("A1:T1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Range("A1:T1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("A1:T1").Style.Font.FontName = "TH SarabunPSK"; - // ws.Range("A1:T1").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("A2:T2").Merge().Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; - // ws.Cell("A2").Style.Alignment.WrapText = true; - // ws.Range("A2:T2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Range("A2:T2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("A2:T2").Style.Font.FontName = "TH SarabunPSK"; - // ws.Range("A2:T2").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("A3:T3").Merge().Value = "หน่วย : บาท"; - // ws.Cell("A3").Style.Alignment.WrapText = true; - // ws.Range("A3:T3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - // ws.Range("A3:T3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("A3:T3").Style.Font.FontName = "TH SarabunPSK"; - // ws.Range("A3:T3").Style.Font.FontSize = 16; - // ws.Range("A4:A7").Merge().Value = "ลำดับที่"; - // ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("A4:A7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("A4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("B4:B7").Merge().Value = "เลขที่ตำแหน่ง"; - // ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("B4:B7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("B4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("C4:D7").Merge().Value = "ชื่อ- สกุล"; - // ws.Cell("C4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("C4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("C4:D7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("C4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("C4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("E4:E7").Merge().Value = "ชื่อตำแหน่ง"; - // ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("E4:E7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("F4:G7").Merge().Value = "สังกัด/พื้นที่"; - // ws.Cell("F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("F4:G7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("F4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("F4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("H4:H7").Merge().Value = "เงินเดือน ณ 1 ต.ค. 64 - 30 ก.ย. 65"; - // ws.Cell("H4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("H4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("H4:H7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("H4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("H4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("I4:I6").Merge().Value = "ประมาณการเงินเดือน 1 ต.ค. 65- 30 ก.ย. 66"; - // ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("I4:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("J4:J6").Merge().Value = "เลื่อนขั้น 4% 1 ต.ค. 66- 30 ก.ย. 67"; - // ws.Cell("J4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("J4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("J4:J6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("J4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("J4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("K4:K6").Merge().Value = "รวม"; - // ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("K4:K6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("K4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("K4").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("L4:L6").Merge().Value = "เงินเดือน*12"; - // ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("L4:L6").Merge().Value = "เงินเดือน*12"; - // ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("M4:S4").Merge().Value = "ส่วนควบงบดำเนินงาน"; - // ws.Cell("M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("M4:S4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("M4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("M4").Style.Font.SetBold().Font.FontSize = 16; - // - // ws.Range("M5:N6").Merge().Value = "เงินสมทบกองทุนประกันสังคม"; - // ws.Cell("M5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("M5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("M5:N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("M5").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("M5").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("O5:P6").Merge().Value = "เงินสมทบกองทุนเงินทดแทน"; - // ws.Cell("O5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("O5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("O5:P6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("O5").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("O5").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("Q5:R5").Merge().Value = "อื่น ๆ"; - // ws.Cell("Q5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("Q5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("Q5:R5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("Q5").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("Q5").Style.Font.SetBold().Font.FontSize = 16; - // ws.Cell("Q6").Value = "ระบุรายการ"; - // ws.Cell("Q6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("Q6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("Q6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("Q6").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("Q6").Style.Font.SetBold().Font.FontSize = 16; - // ws.Cell("R6").Value = "จำนวนเงิน"; - // ws.Cell("R6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("R6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("R6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("R6").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("R6").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("S5:S6").Merge().Value = "รวม"; - // ws.Cell("S5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("S5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("S5:S6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("S5").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("S5").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("T4:T6").Merge().Value = "รวมเงินเดือนและส่วนควบ"; - // ws.Cell("T4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("T4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("T4:T6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("T4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("T4").Style.Font.SetBold().Font.FontSize = 16; - // ws.Range("U4:U6").Merge().Value = "รวมเงินเดือนและส่วนควบ*12เดือน"; - // ws.Cell("U4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("U4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Range("U4:U6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("U4").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("U4").Style.Font.SetBold().Font.FontSize = 16; - // ws.Cell("I7").Value = "-1"; - // ws.Cell("I7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("I7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("I7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("I7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("I7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("J7").Value = "-(2)"; - // ws.Cell("J7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("J7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("J7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("J7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("J7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("K7").Value = "(3) = (1) + (2)"; - // ws.Cell("K7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("K7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("K7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("K7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("K7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("L7").Value = "(3)*12"; - // ws.Cell("L7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("L7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("L7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("L7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("L7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("M7").Value = "(4)"; - // ws.Cell("M7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("M7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("M7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("M7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("M7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("N7").Value = "(4)*12"; - // ws.Cell("N7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("N7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("N7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("N7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("N7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("O7").Value = "(5)"; - // ws.Cell("O7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("O7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("O7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("O7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("O7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("P7").Value = "(5)*12"; - // ws.Cell("P7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("P7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("P7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("P7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("P7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("R7").Value = "(6)"; - // ws.Cell("R7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("R7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("R7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("R7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("R7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("S7").Value = "(7) = (4) ถึง (6)"; - // ws.Cell("S7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("S7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("S7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("S7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("S7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("T7").Value = "(8) = (3) + (7)"; - // ws.Cell("T7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("T7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("T7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("T7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("T7").Style.Font.SetBold().Font.FontSize = 12; - // ws.Cell("U7").Value = "(8)*12"; - // ws.Cell("U7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - // ws.Cell("U7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - // ws.Cell("U7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("Q7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell("U7").Style.Font.FontName = "TH SarabunPSK"; - // ws.Cell("U7").Style.Font.SetBold().Font.FontSize = 12; - // - // ws.Range("A4:U7").Style.Alignment.WrapText = true; - // ws.Row(4).Height = 25; - // ws.Row(5).Height = 25; - // ws.Row(6).Height = 25; - // ws.Column(1).Width = 10; - // ws.Column(2).Width = 10; - // ws.Column(3).Width = 20; - // ws.Column(4).Width = 15; - // ws.Column(5).Width = 15; - // ws.Column(6).Width = 15; - // ws.Column(7).Width = 15; - // ws.Column(8).Width = 15; - // ws.Column(9).Width = 15; - // ws.Column(10).Width = 15; - // ws.Column(11).Width = 15; - // ws.Column(12).Width = 15; - // ws.Column(13).Width = 15; - // ws.Column(14).Width = 15; - // ws.Column(15).Width = 15; - // ws.Column(16).Width = 15; - // 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; - // int row = 8; - // int no = 1; - // - // if (_personnel != null) - // { - // ws.Range(ws.Cell(row, 3), ws.Cell(row, 5)).Merge().Value = "รวมงบประมาณทั้งสิ้น"; - // ws.Cell(row, 8).Value = _personnel.salary; - // ws.Cell(row, 9).Value = _personnel.estimate_promote_1; - // ws.Cell(row, 10).Value = _personnel.estimate_promote_2; - // ws.Cell(row, 11).Value = _personnel.estimate_promote_3; - // ws.Cell(row, 12).Value = _personnel.estimate_promote_4; - // ws.Cell(row, 13).Value = _personnel.salary_next_year_12; - // ws.Cell(row, 14).Value = _personnel.retiree; - // ws.Cell(row, 15).Value = _personnel.salary_per_month; - // ws.Cell(row, 16).Value = _personnel.salary_per_month_12; - // ws.Cell(row, 17).Value = _personnel.retirement_salary_per_year; - // ws.Cell(row, 18).Value = _personnel.special_compensation; - // ws.Cell(row, 19).Value = _personnel.special_compensation_12; - // ws.Cell(row, 20).Value = _personnel.full_salary; - // ws.Cell(row, 21).Value = _personnel.special_compensation_1; - // // ws.Cell(row, 22).Value = detail.special_compensation_2; - // // ws.Cell(row, 23).Value = detail.special_compensation_3; - // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Font.FontName = - // "TH SarabunPSK"; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.SetBold().Font.FontSize = 16; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical = - // XLAlignmentVerticalValues.Center; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#"); - // row++; - // foreach (var detail in _personnel.personnel_salary_permanent) - // { - // ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Merge().Value = detail.agency_category_name; - // ws.Cell(row, 8).Value = detail.salary; - // ws.Cell(row, 9).Value = detail.estimate_promote_1; - // ws.Cell(row, 10).Value = detail.estimate_promote_2; - // ws.Cell(row, 11).Value = detail.estimate_promote_3; - // ws.Cell(row, 12).Value = detail.estimate_promote_4; - // ws.Cell(row, 13).Value = detail.salary_next_year_12; - // ws.Cell(row, 14).Value = detail.retiree; - // ws.Cell(row, 15).Value = detail.salary_per_month; - // ws.Cell(row, 16).Value = detail.salary_per_month_12; - // ws.Cell(row, 17).Value = detail.retirement_salary_per_year; - // ws.Cell(row, 18).Value = detail.special_compensation; - // ws.Cell(row, 19).Value = detail.special_compensation_12; - // ws.Cell(row, 20).Value = detail.full_salary; - // ws.Cell(row, 21).Value = detail.special_compensation_1; - // // ws.Cell(row, 22).Value = detail.special_compensation_2; - // // ws.Cell(row, 23).Value = detail.special_compensation_3; - // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Fill.BackgroundColor = XLColor.LightYellow; - // - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName = - // "TH SarabunPSK"; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontSize = 16; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical = - // XLAlignmentVerticalValues.Center; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#"); - // row++; - // foreach (var deltail2 in detail.personnel_salary_deltails) - // { - // if (deltail2.full_name != "รวม") - // { - // ws.Cell(row, 1).Value = no; - // no++; - // ws.Cell(row, 2).Value = deltail2.manpower; - // ws.Cell(row, 3).Value = deltail2.first_name_th; - // ws.Cell(row, 4).Value = deltail2.last_name_th; - // //ws.Range(ws.Cell(row, 3), ws.Cell(row, 4)).Merge().Value = deltail2.full_name; - // ws.Cell(row, 5).Value = deltail2.position; - // ws.Cell(row, 6).Value = deltail2.parent_agency_name; - // ws.Cell(row, 7).Value = deltail2.area; - // ws.Cell(row, 8).Value = deltail2.salary; - // ws.Cell(row, 9).Value = deltail2.estimate_promote_1; - // ws.Cell(row, 10).Value = deltail2.estimate_promote_2; - // ws.Cell(row, 11).Value = deltail2.estimate_promote_3; - // ws.Cell(row, 12).Value = deltail2.estimate_promote_4; - // ws.Cell(row, 13).Value = deltail2.salary_next_year_12; - // ws.Cell(row, 14).Value = deltail2.retiree; - // ws.Cell(row, 15).Value = deltail2.salary_per_month; - // ws.Cell(row, 16).Value = deltail2.salary_per_month_12; - // ws.Cell(row, 17).Value = deltail2.retirement_salary_per_year; - // ws.Cell(row, 18).Value = deltail2.special_compensation; - // ws.Cell(row, 19).Value = deltail2.special_compensation_12; - // ws.Cell(row, 20).Value = deltail2.full_salary; - // ws.Cell(row, 21).Value = deltail2.special_compensation_1; - // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 3).Style.Border.LeftBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 3).Style.Border.RightBorder = XLBorderStyleValues.None; - // ws.Cell(row, 3).Style.Border.BottomBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 4).Style.Border.LeftBorder = XLBorderStyleValues.None; - // ws.Cell(row, 4).Style.Border.RightBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 4).Style.Border.BottomBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName = - // "TH SarabunPSK"; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontSize = 16; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical = - // XLAlignmentVerticalValues.Center; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#"); - // row++; - // } - // - // if (deltail2.full_name == "รวม") - // { - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = deltail2.full_name; - // ws.Cell(row, 5).Value = deltail2.position; - // ws.Cell(row, 6).Value = deltail2.parent_agency_name; - // ws.Cell(row, 7).Value = deltail2.area; - // ws.Cell(row, 8).Value = deltail2.salary; - // ws.Cell(row, 9).Value = deltail2.estimate_promote_1; - // ws.Cell(row, 10).Value = deltail2.estimate_promote_2; - // ws.Cell(row, 11).Value = deltail2.estimate_promote_3; - // ws.Cell(row, 12).Value = deltail2.estimate_promote_4; - // ws.Cell(row, 13).Value = deltail2.salary_next_year_12; - // ws.Cell(row, 14).Value = deltail2.retiree; - // ws.Cell(row, 15).Value = deltail2.salary_per_month; - // ws.Cell(row, 16).Value = deltail2.salary_per_month_12; - // ws.Cell(row, 17).Value = deltail2.retirement_salary_per_year; - // ws.Cell(row, 18).Value = deltail2.special_compensation; - // ws.Cell(row, 19).Value = deltail2.special_compensation_12; - // ws.Cell(row, 20).Value = deltail2.full_salary; - // ws.Cell(row, 21).Value = deltail2.special_compensation_1; - // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Border.TopBorder = - // XLBorderStyleValues.Double; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.FontName = - // "TH SarabunPSK"; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Font.SetBold().Font.FontSize = 16; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.WrapText = true; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Vertical = - // XLAlignmentVerticalValues.Center; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); - // ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).Style.NumberFormat.SetFormat("#,#"); - // } - // } - // } - // } - // - // var richText = ws.PageSetup.Footer.Left.AddText( - // "หมายเหตุ : ในกรณีที่เงินเดือนตุลาคม 2564 ยังไม่เลื่อนขั้นเงินเดือน ให้กรอกเงินเลื่อนขั้น 4% ในช่อง (2)", - // XLHFOccurrence.FirstPage); - // richText.FontSize = 16; - // richText.FontName = "TH SarabunPSK"; - // - // using (var stream1 = new MemoryStream()) - // { - // workbook.SaveAs(stream1); - // var content = stream1.ToArray(); - // string date = DateTime.Now.ToString("yyyyMMddHHmmss"); - // return File( - // content, - // "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - // "personnel_permanent_" + date + ".xlsx"); - // } - // } + [HttpPost, Route("reports/personnel_salary_government/{type}")] [ApiExplorerSettings(GroupName = "reports")] @@ -2373,11 +1859,11 @@ namespace rmutr_report.Controllers XLAlignmentHorizontalValues.Center; ws.Range(ws.Cell(row, 11), ws.Cell(row, 15)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = + ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Range(ws.Cell(row, 16), ws.Cell(row, 45)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row, 46), ws.Cell(row, 54)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row, 56), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 16), ws.Cell(row, 45)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 46), ws.Cell(row, 54)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 56), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); row++; foreach (var detail2 in detail.personnel_salary_deltails) { @@ -2416,15 +1902,17 @@ namespace rmutr_report.Controllers ws.Cell(row, 11).Value = detail2.management_position_name; ws.Cell(row, 12).Value = detail2.position_name; ws.Cell(row, 13).Value = detail2.assign_no + " " + detail2.assign_document_date; - if (detail2.assign_effective_date!=null) + if (detail2.assign_effective_date != null) { ws.Cell(row, 14).Value = - detail2.assign_effective_date.Value.ToString("dd MMMM yyyy", culture); + detail2.assign_effective_date.Value.ToString("dd MMMM yyyy", culture); } - if (detail2.assign_effective_date==null) + + if (detail2.assign_effective_date == null) { - ws.Cell(row, 14).Value = null; + ws.Cell(row, 14).Value = null; } + ws.Cell(row, 15).Value = detail2.retire_year; ws.Cell(row, 16).Value = detail2.salary; ws.Cell(row, 17).Value = detail2.estimated_salary_3_percent_1; @@ -2578,35 +2066,32 @@ namespace rmutr_report.Controllers XLAlignmentHorizontalValues.Right; ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); } - } - if (detail.is_footer==true) + + if (detail.is_footer == true) { var imagePath = _setting.report_path + @"Picture1.png"; - ws.AddPicture(imagePath).MoveTo(ws.Cell(row+1,2)).WithSize(72,30); - ws.Cell(row+1, 3).Value = "= ผู้เกษียณอายุราชการประจำปีงบประมาณ พ.ศ. 2565 (1 ต.ค. 2564)"; + ws.AddPicture(imagePath).MoveTo(ws.Cell(row + 1, 2)).WithSize(72, 30); + ws.Cell(row + 1, 3).Value = "= ผู้เกษียณอายุราชการประจำปีงบประมาณ พ.ศ. 2565 (1 ต.ค. 2564)"; var imagePath2 = _setting.report_path + @"Picture2.png"; - ws.AddPicture(imagePath2).MoveTo(ws.Cell(row+2,2)).WithSize(72,30); - ws.Cell(row+2, 3).Value = "= อัตราที่จะเสนอขอยุบเลิก ในปีงบประมาณ พ.ศ. 2565 และขอรับจัดสรรอัตราทดแทนเป็นพนักงานมหาวิทยาลัย ในปีงบประมาณ พ.ศ. 2566"; - ws.Cell(row+1, 3).Style.Font.FontName = + ws.AddPicture(imagePath2).MoveTo(ws.Cell(row + 2, 2)).WithSize(72, 30); + ws.Cell(row + 2, 3).Value = + "= อัตราที่จะเสนอขอยุบเลิก ในปีงบประมาณ พ.ศ. 2565 และขอรับจัดสรรอัตราทดแทนเป็นพนักงานมหาวิทยาลัย ในปีงบประมาณ พ.ศ. 2566"; + ws.Cell(row + 1, 3).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row+1, 3).Style.Font.FontSize = 16; - ws.Cell(row+2, 3).Style.Font.FontName = - "TH SarabunPSK"; - ws.Cell(row+2, 3).Style.Font.FontSize = 16; + ws.Cell(row + 1, 3).Style.Font.FontSize = 16; + ws.Cell(row + 2, 3).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row + 2, 3).Style.Font.FontSize = 16; } - if (detail.is_footer==false) + + if (detail.is_footer == false) { - // var imagePath = _setting.report_path + @"Picture1.png"; - // ws.AddPicture(imagePath).MoveTo(ws.Cell(row,2)).Scale(0.1); ws.Cell(row, 3).Value = ""; - // var imagePath2 = _setting.report_path + @"Picture2.png"; - // ws.AddPicture(imagePath2).MoveTo(ws.Cell(row+1,2)).Scale(0.1); - //ws.Cell(row, 3).Value = ""; } } } - + using (var stream1 = new MemoryStream()) { workbook.SaveAs(stream1); @@ -2619,6 +2104,698 @@ namespace rmutr_report.Controllers } } + + [HttpPost, Route("reports/personnel_salary_permanent/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetPersonSalaryReport([FromRoute] string type, + [FromBody] personnel_salary_permanent_root _personnel) + { + var workbook = new XLWorkbook(); + var ws = workbook.Worksheets.Add("ลูกจ้างประจํา"); + if (_personnel.year == "2567") + { + _personnel.year = "2566"; + } + + ws.Range("A1:AA1").Merge().Value = "รายละเอียดค่าจ้างและส่วนควบของลูกจ้างประจำ ประจำปีงบประมาณ พ.ศ." + + _personnel.year; + ws.Cell("A1").Style.Alignment.WrapText = true; + ws.Range("A1:AA1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A1:AA1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A1:AA1").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A1:AA1").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A2:AA2").Merge().Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; + ws.Cell("A2").Style.Alignment.WrapText = true; + ws.Range("A2:AA2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A2:AA2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A2:AA2").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A2:AA2").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A3:AA3").Merge().Value = "หน่วย : บาท"; + ws.Cell("A3").Style.Alignment.WrapText = true; + ws.Range("A3:AA3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("A3:AA3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A3:AA3").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A3:AA3").Style.Font.FontSize = 16; + ws.Range("A4:A7").Merge().Value = "ลำดับที่"; + ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A4:A7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("B4:B7").Merge().Value = "เลขที่ตำแหน่ง"; + ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B4:B7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("C4:D7").Merge().Value = "ชื่อ- สกุล"; + ws.Cell("C4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("C4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("C4:D7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("C4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("C4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("E4:E7").Merge().Value = "ชื่อตำแหน่ง"; + ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E4:E7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("F4:G7").Merge().Value = "สังกัด/พื้นที่"; + ws.Cell("F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("F4:G7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("F4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("H4:H6").Merge().Value = "ค่าจ้าง ณ 1 ต.ค. 64 - 30 ก.ย. 64"; + ws.Cell("H4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("H4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("H4:H6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("H4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("I4:I6").Merge().Value = "ประมาณการเลื่อนขั้น 1 ขั้น ณ 1 ต.ค. 64 - 30 ก.ย. 65"; + ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I4:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("J4:J6").Merge().Value = "ประมาณการเลื่อนขั้น 1 ขั้น 1 เม.ย. 65 - 30 ก.ย. 65"; + ws.Cell("J4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("J4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J4:J6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("J4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("K4:K6").Merge().Value = "ประมาณการเลื่อนขั้น 1 ขั้น 1 ต.ค. 65 - 31 มี.ค. 66"; + ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("K4:K6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("K4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("L4:L6").Merge().Value = "ประมาณการเลื่อนขั้น 1 ขั้น 1 เม.ย. 66 - 30 ก.ย. 66"; + ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("M4:M6").Merge().Value = "ค่าจ้างปีงบประมาณ พ.ศ. 2565 12 เดือน"; + ws.Cell("M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("M4:M6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("M4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("N4:P5").Merge().Value = "ผู้เกษียณอายุราชการปี 2565"; + ws.Cell("N4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("N4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("N4:P5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("N4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell("N6").Value = "ผู้เกษียณ"; + ws.Cell("N6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("M5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("O6:P6").Merge().Value = "ค่าจ้างต่อเดือน"; + ws.Cell("O6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("O6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("O6:P6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("O6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("O6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("Q4:Q6").Merge().Value = "เงินเดือน หัก เงินเดือนผู้เกษียณ ต่อปี"; + ws.Cell("Q4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Q4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Q4:Q6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Q4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Q4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("R4:Z4").Merge().Value = "ส่วนควบงบดำเนินงาน"; + ws.Cell("R4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("R4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("R4:Z4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("R4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("R4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("R5:S6").Merge().Value = "ค่าตอบแทนพิเศษที่ได้รับเงินเดือนเต็มขั้น (ประมาณการ 1 ขั้น)"; + ws.Cell("R5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("R5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("R5:S6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("R5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("R5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("T5:T6").Merge().Value = "เงินเดือนเต็มขั้น หักผู้เกษียณ ต่อปี"; + ws.Cell("T5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("T5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("T5:T6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("T5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("T5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("U5:U6").Merge().Value = "ค่าตอบแทนพิเศษสำหรับผู้ปฏิบัติงานในเขตพื้นที่พิเศษภาคใต้"; + ws.Cell("U5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("U5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("T4:U6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("U5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("U5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("V5:V6").Merge().Value = "ค่าตอบแทนพิเศษสำหรับการปฏิบัติงานประจำสำนักงานในพื้นที่พิเศษ (สปพ.)"; + ws.Cell("V5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("V5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("V5:V6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("V5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("V5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("W5:W6").Merge().Value = "ค่าตอบแทนพิเศษสำหรับการสู้รบ (พสร.)"; + ws.Cell("W5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("W5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("W5:W6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("W5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("W5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("X5:Y5").Merge().Value = "อื่น ๆ"; + ws.Cell("X5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("X5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("X5:Y5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("X5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("X5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell("X6").Value = "ระบุรายการ"; + ws.Cell("X6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("X6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("X6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("X6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("X6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell("Y6").Value = "จำนวนเงิน"; + ws.Cell("Y6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Y6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("Y6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Y6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Y6").Style.Font.SetBold().Font.FontSize = 16; + + + ws.Range("Z5:Z6").Merge().Value = "รวม"; + ws.Cell("Z5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Z5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Z5:Z6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Z5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Z5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AA4:AA6").Merge().Value = "รวมค่าจ้างและส่วนควบ"; + ws.Cell("AA4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AA4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AA4:AA6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AA4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AA4").Style.Font.SetBold().Font.FontSize = 16; + + + ws.Cell("J7").Value = "(1)"; + ws.Cell("J7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("J7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("J7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("J7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("K7").Value = "(2)"; + ws.Cell("K7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("K7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("K7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("L7").Value = "(3)"; + ws.Cell("L7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("L7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("L7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("M7").Value = "(3)*12"; + ws.Cell("M7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("M7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("N7").Value = ""; + ws.Cell("N7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("N7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N7").Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell("N7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("O7").Value = "(4)"; + ws.Cell("O7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("O7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("O7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("O7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("O7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("P7").Value = "(4)*12"; + ws.Cell("P7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("P7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("P7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("P7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("P7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("R7").Value = "(5)"; + ws.Cell("R7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("R7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("R7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("R7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("R7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("S7").Value = "(5)*12"; + ws.Cell("S7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("S7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("S7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("S7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("S7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("T7").Value = "(5.1)"; + ws.Cell("T7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("T7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("T7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("T7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("T7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("U7").Value = "(6)"; + ws.Cell("U7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("U7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("U7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + //ws.Cell("Q7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("U7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("U7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("V7").Value = "(7)"; + ws.Cell("V7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("V7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("V7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + //ws.Cell("V7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("V7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("V7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("W7").Value = "(8)"; + ws.Cell("W7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("W7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("W7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("X7").Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell("W7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("W7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("Y7").Value = "(9)"; + ws.Cell("Y7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Y7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("Y7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Y7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Y7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("Z7").Value = "(10) = (5) ถึง (9)"; + ws.Cell("Z7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Z7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("Z7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Z7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Z7").Style.Font.SetBold().Font.FontSize = 12; + ws.Cell("AA7").Value = "(11) = (3) + (10)"; + ws.Cell("AA7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AA7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("AA7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AA7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AA7").Style.Font.SetBold().Font.FontSize = 12; + ws.Range("A4:AA7").Style.Alignment.WrapText = true; + ws.Row(4).Height = 40; + ws.Row(5).Height = 60; + ws.Row(6).Height = 60; + ws.Column(1).Width = 10; + ws.Column(2).Width = 10; + ws.Column(3).Width = 20; + ws.Column(4).Width = 20; + ws.Column(5).Width = 30; + ws.Column(6).Width = 30; + ws.Column(7).Width = 20; + ws.Column(8).Width = 15; + ws.Column(9).Width = 15; + ws.Column(10).Width = 15; + ws.Column(11).Width = 15; + ws.Column(12).Width = 15; + ws.Column(13).Width = 15; + ws.Column(14).Width = 15; + ws.Column(15).Width = 15; + ws.Column(16).Width = 15; + 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 = 15; + int row = 8; + int no = 1; + + if (_personnel != null) + { + ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Merge().Value = "รวมงบประมาณทั้งสิ้น"; + ws.Cell(row, 8).Value = _personnel.salary; + ws.Cell(row, 9).Value = _personnel.estimate_promote_1; + ws.Cell(row, 10).Value = _personnel.estimate_promote_2; + ws.Cell(row, 11).Value = _personnel.estimate_promote_3; + ws.Cell(row, 12).Value = _personnel.estimate_promote_4; + ws.Cell(row, 13).Value = _personnel.salary_next_year_12; + ws.Cell(row, 14).Value = _personnel.retiree; + ws.Cell(row, 15).Value = _personnel.salary_per_month; + ws.Cell(row, 16).Value = _personnel.salary_per_month_12; + ws.Cell(row, 17).Value = _personnel.retirement_salary_per_year; + ws.Cell(row, 18).Value = _personnel.special_compensation; + ws.Cell(row, 19).Value = _personnel.special_compensation_12; + ws.Cell(row, 20).Value = _personnel.full_salary; + ws.Cell(row, 21).Value = _personnel.special_compensation_1; + ws.Cell(row, 22).Value = _personnel.special_compensation_2; + ws.Cell(row, 23).Value = _personnel.special_compensation_3; + ws.Cell(row, 24).Value = _personnel.other; + ws.Cell(row, 25).Value = _personnel.other_price; + ws.Cell(row, 26).Value = _personnel.total; + ws.Cell(row, 27).Value = _personnel.total_wages_and_fittings; + //ws.Cell(row, 28).Value = _personnel.total_wages_and_fittings_12; + ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 24).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 25).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 26).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 27).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + 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.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + //ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.NumberFormat.SetFormat("#,#"); + row++; + foreach (var detail in _personnel.personnel_salary_permanent) + { + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Merge().Value = detail.agency_category_name; + ws.Cell(row, 8).Value = detail.salary; + ws.Cell(row, 9).Value = detail.estimate_promote_1; + ws.Cell(row, 10).Value = detail.estimate_promote_2; + ws.Cell(row, 11).Value = detail.estimate_promote_3; + ws.Cell(row, 12).Value = detail.estimate_promote_4; + ws.Cell(row, 13).Value = detail.salary_next_year_12; + ws.Cell(row, 14).Value = detail.retiree; + ws.Cell(row, 15).Value = detail.salary_per_month; + ws.Cell(row, 16).Value = detail.salary_per_month_12; + ws.Cell(row, 17).Value = detail.retirement_salary_per_year; + ws.Cell(row, 18).Value = detail.special_compensation; + ws.Cell(row, 19).Value = detail.special_compensation_12; + ws.Cell(row, 20).Value = detail.full_salary; + ws.Cell(row, 21).Value = detail.special_compensation_1; + ws.Cell(row, 22).Value = detail.special_compensation_2; + ws.Cell(row, 23).Value = detail.special_compensation_3; + ws.Cell(row, 24).Value = detail.other; + ws.Cell(row, 25).Value = detail.other_price; + ws.Cell(row, 26).Value = detail.total; + ws.Cell(row, 27).Value = detail.total_wages_and_fittings; + ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 24).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 25).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 26).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 27).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + 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.Range(ws.Cell(row, 1), ws.Cell(row, 7)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Fill.BackgroundColor = XLColor.LightYellow; + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.NumberFormat.SetFormat("#,#"); + row++; + foreach (var detail2 in detail.personnel_salary_deltails) + { + if (detail2.first_name_th != "รวม") + { + ws.Cell(row, 1).Value = no; + no++; + ws.Cell(row, 2).Value = detail2.manpower; + ws.Cell(row, 3).Value = detail2.first_name_th; + ws.Cell(row, 4).Value = detail2.last_name_th; + //ws.Range(ws.Cell(row, 3), ws.Cell(row, 4)).Merge().Value = detail2.full_name; + ws.Cell(row, 5).Value = detail2.position; + ws.Cell(row, 6).Value = detail2.parent_agency_name; + ws.Cell(row, 7).Value = detail2.area; + ws.Cell(row, 8).Value = detail2.salary; + ws.Cell(row, 9).Value = detail2.estimate_promote_1; + ws.Cell(row, 10).Value = detail2.estimate_promote_2; + ws.Cell(row, 11).Value = detail2.estimate_promote_3; + ws.Cell(row, 12).Value = detail2.estimate_promote_4; + ws.Cell(row, 13).Value = detail2.salary_next_year_12; + ws.Cell(row, 14).Value = detail2.retiree; + ws.Cell(row, 15).Value = detail2.salary_per_month; + ws.Cell(row, 16).Value = detail2.salary_per_month_12; + ws.Cell(row, 17).Value = detail2.retirement_salary_per_year; + ws.Cell(row, 18).Value = detail2.special_compensation; + ws.Cell(row, 19).Value = detail2.special_compensation_12; + ws.Cell(row, 20).Value = detail2.full_salary; + ws.Cell(row, 21).Value = detail2.special_compensation_1; + ws.Cell(row, 22).Value = detail2.special_compensation_2; + ws.Cell(row, 23).Value = detail2.special_compensation_3; + ws.Cell(row, 24).Value = detail2.other; + ws.Cell(row, 25).Value = detail2.other_price; + ws.Cell(row, 26).Value = detail2.total; + ws.Cell(row, 27).Value = detail2.total_wages_and_fittings; + //ws.Cell(row, 28).Value = _personnel.total_wages_and_fittings_12; + ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 24).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 25).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 26).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 27).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + 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.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 3), ws.Cell(row, 7)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + //ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.NumberFormat.SetFormat("#,#"); + row++; + } + + if (detail2.first_name_th == "รวม") + { + ws.Range(ws.Cell(row, 1), ws.Cell(row, 3)).Merge().Value = detail2.first_name_th; + + ws.Cell(row, 8).Value = detail2.salary; + ws.Cell(row, 9).Value = detail2.estimate_promote_1; + ws.Cell(row, 10).Value = detail2.estimate_promote_2; + ws.Cell(row, 11).Value = detail2.estimate_promote_3; + ws.Cell(row, 12).Value = detail2.estimate_promote_4; + ws.Cell(row, 13).Value = detail2.salary_next_year_12; + ws.Cell(row, 14).Value = detail2.retiree; + ws.Cell(row, 15).Value = detail2.salary_per_month; + ws.Cell(row, 16).Value = detail2.salary_per_month_12; + ws.Cell(row, 17).Value = detail2.retirement_salary_per_year; + ws.Cell(row, 18).Value = detail2.special_compensation; + ws.Cell(row, 19).Value = detail2.special_compensation_12; + ws.Cell(row, 20).Value = detail2.full_salary; + ws.Cell(row, 21).Value = detail2.special_compensation_1; + ws.Cell(row, 22).Value = detail2.special_compensation_2; + ws.Cell(row, 23).Value = detail2.special_compensation_3; + ws.Cell(row, 24).Value = detail2.other; + ws.Cell(row, 25).Value = detail2.other_price; + ws.Cell(row, 26).Value = detail2.total; + ws.Cell(row, 27).Value = detail2.total_wages_and_fittings; + //ws.Cell(row, 28).Value = _personnel.total_wages_and_fittings_12; + ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 17).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, 20).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 24).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 25).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 26).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 27).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Style.Border.TopBorder = + XLBorderStyleValues.Double; + 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.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 7)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + //ws.Range(ws.Cell(row, 8), ws.Cell(row, 21)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 8), ws.Cell(row, 27)).Style.NumberFormat.SetFormat("#,#"); + } + } + + if (detail.is_footer == true) + { + ws.Cell(row + 1, 1).Value = "หมายเหตุ : "; + ws.Cell(row + 2, 1).Value = + "1. ในกรณีที่ค่าจ้างตุลาคม 2564 ยังไม่เลื่อนขั้น ให้กรอกเงินเลื่อนขั้น 3% ในช่อง (2)"; + ws.Cell(row + 3, 1).Value = + "2. ในช่อง (4) ให้กรอกค่าจ้างต่อเดือนของผู้เกษียณรวมปรับเลื่อนขั้นแล้ว ไม่รวมส่วนควบของผู้เกษียณ (เท่ากับช่อง (3))"; + var imagePath = _setting.report_path + @"Picture3.png"; + ws.AddPicture(imagePath).MoveTo(ws.Cell(row + 4, 3)).WithSize(50, 20); + ws.Cell(row + 4, 1).Value = " เลขที่ตำแหน่งที่เป็น"; + ws.Cell(row + 4, 3).Value = " เกษียณอายุราชการ ณ วันที่ 1 ตุลาคม 2564"; + var imagePath2 = _setting.report_path + @"Picture4.png"; + ws.AddPicture(imagePath2).MoveTo(ws.Cell(row + 5, 3)).WithSize(50, 20); + ws.Cell(row + 5, 1).Value = " การเลื่อนขั้นเต็มขั้น"; + var imagePath3 = _setting.report_path + @"Picture5.png"; + ws.AddPicture(imagePath3).MoveTo(ws.Cell(row + 6, 3)).WithSize(50, 20); + ws.Cell(row + 6, 1).Value = " เลขที่ตำแหน่งที่เป็น"; + ws.Cell(row + 6, 3).Value = " อัตราว่างระหว่างปีงบประมาณ พ.ศ. 2564 จากการเสียชีวิต"; + ws.Cell(row+1, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+1, 1).Style.Font.FontSize = 16; + ws.Cell(row+2, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+2, 1).Style.Font.FontSize = 16; + ws.Cell(row+3, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+3, 1).Style.Font.FontSize = 16; + ws.Cell(row+4, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+4, 1).Style.Font.FontSize = 16; + ws.Cell(row+4, 3).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+4, 3).Style.Font.FontSize = 16; + ws.Cell(row+5, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+5, 1).Style.Font.FontSize = 16; + ws.Cell(row+6, 1).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+6, 1).Style.Font.FontSize = 16; + ws.Cell(row+6, 3).Style.Font.FontName = + "TH SarabunPSK"; + ws.Cell(row+6, 3).Style.Font.FontSize = 16; + } + + if (detail.is_footer == false) + { + ws.Cell(row, 3).Value = ""; + } + } + } + + + using (var stream1 = new MemoryStream()) + { + workbook.SaveAs(stream1); + var content = stream1.ToArray(); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + content, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "personnel_permanent_" + date + ".xlsx"); + } + } + [HttpPost, Route("reports/set_personnel_budget/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSetPersonBudgetReport([FromRoute] string type, diff --git a/Models/Personnel/personnel_salary_permanent.cs b/Models/Personnel/personnel_salary_permanent.cs index 88f26c7..9bb0d17 100644 --- a/Models/Personnel/personnel_salary_permanent.cs +++ b/Models/Personnel/personnel_salary_permanent.cs @@ -64,6 +64,8 @@ namespace rmutr_report.Models.Personnel public int? total_wages_and_fittings { get; set; } public int? total_wages_and_fittings_12 { get; set; } public List personnel_salary_deltails { get; set; } + public bool? is_footer { get; set; } + } public class t_personnel_salary_permanent_deltail diff --git a/bin/Debug/net5.0/ref/rmutr-report.dll b/bin/Debug/net5.0/ref/rmutr-report.dll index 17a44f6..456c6ab 100644 Binary files a/bin/Debug/net5.0/ref/rmutr-report.dll and b/bin/Debug/net5.0/ref/rmutr-report.dll differ diff --git a/bin/Debug/net5.0/rmutr-report.dll b/bin/Debug/net5.0/rmutr-report.dll index 25c7d5c..eb3964d 100644 Binary files a/bin/Debug/net5.0/rmutr-report.dll and b/bin/Debug/net5.0/rmutr-report.dll differ diff --git a/bin/Debug/net5.0/rmutr-report.pdb b/bin/Debug/net5.0/rmutr-report.pdb index 3e9ab0b..4bf284f 100644 Binary files a/bin/Debug/net5.0/rmutr-report.pdb and b/bin/Debug/net5.0/rmutr-report.pdb differ diff --git a/obj/Debug/net5.0/ref/rmutr-report.dll b/obj/Debug/net5.0/ref/rmutr-report.dll index 17a44f6..456c6ab 100644 Binary files a/obj/Debug/net5.0/ref/rmutr-report.dll and b/obj/Debug/net5.0/ref/rmutr-report.dll differ diff --git a/obj/Debug/net5.0/rmutr-report.dll b/obj/Debug/net5.0/rmutr-report.dll index 25c7d5c..eb3964d 100644 Binary files a/obj/Debug/net5.0/rmutr-report.dll and b/obj/Debug/net5.0/rmutr-report.dll differ diff --git a/obj/Debug/net5.0/rmutr-report.pdb b/obj/Debug/net5.0/rmutr-report.pdb index 3e9ab0b..4bf284f 100644 Binary files a/obj/Debug/net5.0/rmutr-report.pdb and b/obj/Debug/net5.0/rmutr-report.pdb differ diff --git a/wwwroot/reports/Picture3.png b/wwwroot/reports/Picture3.png new file mode 100644 index 0000000..8367291 Binary files /dev/null and b/wwwroot/reports/Picture3.png differ diff --git a/wwwroot/reports/Picture4.png b/wwwroot/reports/Picture4.png new file mode 100644 index 0000000..998d8b3 Binary files /dev/null and b/wwwroot/reports/Picture4.png differ diff --git a/wwwroot/reports/Picture5.png b/wwwroot/reports/Picture5.png new file mode 100644 index 0000000..32d2f31 Binary files /dev/null and b/wwwroot/reports/Picture5.png differ