From 622e535cb5699d3d37ddfc4fab88d80ba2ac967f Mon Sep 17 00:00:00 2001 From: kamonwan taengsuk Date: Thu, 6 Apr 2023 12:22:45 +0700 Subject: [PATCH] bug fixed --- Controllers/Personnel.Controller.cs | 1382 ++++++++++++++++- .../personnel_salary_temporary_root.cs | 85 + .../personnel_salary_university_root.cs | 195 +++ 3 files changed, 1644 insertions(+), 18 deletions(-) create mode 100644 Models/Personnel/personnel_salary_temporary_root.cs create mode 100644 Models/Personnel/personnel_salary_university_root.cs diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index 180b804..82e944c 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using ClosedXML; using ClosedXML.Excel; using FastReport; using FastReport.Export.Csv; @@ -160,8 +161,7 @@ namespace rmutr_report.Controllers report.Export(mht, stream); stream.Seek(0, SeekOrigin.Begin); return File(stream, "multipart/related"); - break; - case "csv": + break;case "csv": CSVExport csv = new CSVExport(); report.Export(csv, stream); stream.Seek(0, SeekOrigin.Begin); @@ -2750,30 +2750,30 @@ namespace rmutr_report.Controllers 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 = + 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 = + 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 = + 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 = + 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 = + 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 = + 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 = + 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 = + 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; + ws.Cell(row + 6, 3).Style.Font.FontSize = 16; } if (detail.is_footer == false) @@ -2796,6 +2796,1352 @@ namespace rmutr_report.Controllers } } + // [HttpPost, Route("reports/personnel_salary_temporary/{type}")] + // [ApiExplorerSettings(GroupName = "reports")] + // public IActionResult GetTemporaryReport([FromRoute] string type, + // [FromBody] personnel_salary_temporary_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:C7").Merge().Value = "ชื่อ- สกุล"; + // ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("B4:C7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("B4").Style.Font.SetBold().Font.FontSize = 16; + // + // ws.Range("D4:D7").Merge().Value = "ชื่อตำแหน่ง"; + // ws.Cell("D4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("D4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("D4:D7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("D4").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("D4").Style.Font.SetBold().Font.FontSize = 16; + // + // ws.Range("E4:F7").Merge().Value = "สังกัด"; + // ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("E4:F7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16; + // + // ws.Range("G4:H6").Merge().Value = "ค่าจ้าง ณ 1 ต.ค. 64 - 30 ก.ย. 65"; + // ws.Cell("G4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("G4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("G4:H6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("G4").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("G4").Style.Font.SetBold().Font.FontSize = 16; + // + // ws.Range("I4:J6").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:J6").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:S4").Merge().Value = "ส่วนควบงบดำเนินงาน"; + // ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("K4:S4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("K4").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("K4").Style.Font.SetBold().Font.FontSize = 16; + // + // ws.Range("K5:L6").Merge().Value = "ค่าเช่าบ้าน"; + // ws.Cell("K5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("K5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("K5:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("K5").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("K5").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.Cell("H7").Value = "*12"; + // ws.Cell("H7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell("H7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell("H7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("H7").Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell("H7").Style.Font.SetBold().Font.FontSize = 12; + // 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 = "(1)*12"; + // 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 = "(2)*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 = "(3)"; + // 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 = "(3)*12"; + // 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 = "(6) = (2) ถึง (5)"; + // 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 = "(7) = (1) + (6)"; + // 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.Range("A4:T7").Style.Alignment.WrapText = true; + // ws.Row(4).Height = 40; + // ws.Row(5).Height = 40; + // ws.Row(6).Height = 40; + // 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; + // + // int row = 8; + // int no = 1; + // + // if (_personnel != null) + // { + // foreach (var detail in _personnel.personnel_salary_temporary) + // { + // 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.salary_12; + // ws.Cell(row, 10).Value = detail.salary2_12; + // ws.Cell(row, 11).Value = detail.house_rent; + // ws.Cell(row, 12).Value = detail.house_rent_12; + // 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, 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.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("#,#"); + // } + // } + // } + // } + // + // + // 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_temporary_" + date + ".xlsx"); + // } + // } + + [HttpPost, Route("reports/personnel_salary_university/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetPersonSalaryUniversityReport([FromRoute] string type, + [FromBody] personnel_salary_university_root _personnel) + { + var workbook = new XLWorkbook(); + var ws = workbook.Worksheets.Add("พนักงานมหาวิทยาลัย"); + if (_personnel.year == "2567") + { + _personnel.year = "2566"; + } + + ws.Range("A1:AV1").Merge().Value = + "รายละเอียดค่าจ้างและส่วนควบพนักงานมหาวิทยาลัย ประจำปีงบประมาณ พ.ศ. " + + _personnel.year + " (ทดแทดอัตราเดิม/อัตราใหม่)"; + ws.Cell("A1").Style.Alignment.WrapText = true; + ws.Range("A1:AV1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A1:AV1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A1:AV1").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A1:AV1").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A2:AV2").Merge().Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; + ws.Cell("A2").Style.Alignment.WrapText = true; + ws.Range("A2:AV2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A2:AV2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A2:AV2").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A2:AV2").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A3:AV3").Merge().Value = "หน่วย : บาท"; + ws.Cell("A3").Style.Alignment.WrapText = true; + ws.Range("A3:AV3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range("A3:AV3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A3:AV3").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A3:AV3").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:F7").Merge().Value = "สังกัด"; + ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E4:F7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("G4:G7").Merge().Value = "ตำแหน่ง"; + ws.Cell("G4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("G4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("G4:G7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("G4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("H4:H7").Merge().Value = "ระดับตำแหน่ง"; + 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:J5").Merge().Value = "ประเภท"; + ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I4:J5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("I6:I7").Merge().Value = "สาย ก"; + ws.Cell("I6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("I6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I6:I7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I6").Style.Font.SetBold().Font.FontSize = 16; + //ws.Cell("I6").Style.Alignment.SetTextRotation(90); + + ws.Range("J6:J7").Merge().Value = "สาย ข และ ค"; + ws.Cell("J6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("J6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J6:J7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("J6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J6").Style.Font.SetBold().Font.FontSize = 16; + //ws.Cell("J6").Style.Alignment.SetTextRotation(90); + + ws.Range("K4:K7").Merge().Value = "ชื่อตำแหน่งบริหาร"; + ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("K4:K7").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:L7").Merge().Value = "ชื่อตำแหน่งวิชาการ"; + ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("L4:L7").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:M7").Merge().Value = "หนังสือคำสั่ง ก.พ.อ. และวันที่ดำรงตำแหน่งวิชาการ"; + ws.Cell("M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("M4:M7").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:N7").Merge().Value = "คุณวุฒิที่ใช้จ้าง"; + ws.Cell("N4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("N4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("N4:N7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("N4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("O4:O7").Merge().Value = "คุณวุฒิที่ได้รับจากสำนักงบประมาณ"; + ws.Cell("O4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("O4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("O4:O7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("O4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("O4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("P4:P7").Merge().Value = "ค่าจ้างต.ค. 64 (1 ต.ค. 63 - 30 ก.ย. 64)"; + ws.Cell("P4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("P4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("P4:P7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("P4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("P4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("Q4:Q7").Merge().Value = "ค่าจ้างต.ค. 65 (1 ต.ค. 64 - 30 ก.ย. 65) (+4%)"; + ws.Cell("Q4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Q4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Q4:Q7").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:R7").Merge().Value = "ค่าจ้างต.ค. 66 (1 ต.ค. 65 - 30 ก.ย. 66) (+4%)"; + ws.Cell("R4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("R4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("R4:R7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("R4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("R4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("S4:AE4").Merge().Value = "ค่าจ้างพนักงานมหาวิทยาลัย"; + ws.Cell("S4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("S4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("S4:AE4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("S4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("S4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("S5:S7").Merge().Value = "ค่าจ้างต.ค. 64"; + ws.Cell("S5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("S5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("S5:S7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("S5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("S5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("S5:S7").Style.Font.FontColor = XLColor.Blue; + //ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Fill.BackgroundColor = XLColor.LightYellow; + + + ws.Range("T5:T7").Merge().Value = "ค่าจ้างพ.ย. 64"; + ws.Cell("T5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("T5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("T5:T7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("T5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("T5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("T5:T7").Style.Font.FontColor = XLColor.Blue; + + + ws.Range("U5:U7").Merge().Value = "ค่าจ้างธ.ค. 64"; + ws.Cell("U5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("U5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("U5:U7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("U5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("U5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("U5:U7").Style.Font.FontColor = XLColor.Blue; + + ws.Range("V5:V7").Merge().Value = "รวมค่าจ้างต.ค.-ธ.ค. 64 (รวมเลื่อนขั้น ณ 1 ต.ค. 64)"; + ws.Cell("V5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("V5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("V5:V7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("V5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("V5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("V5:V7").Style.Font.FontColor = XLColor.Blue; + + ws.Range("W5:W7").Merge().Value = "เลื่อนขั้นครั้งที่ 2"; + ws.Cell("W5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("W5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("W5:W7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("W5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("W5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("W5:W7").Style.Font.FontColor = XLColor.Blue; + + ws.Range("X5:X7").Merge().Value = "รวมเงินเดือน"; + ws.Cell("X5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("X5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("X5:X7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("X5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("X5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("X5:X7").Style.Font.FontColor = XLColor.Blue; + + ws.Range("Y5:AD5").Merge().Value = "สวัสดิการ"; + ws.Cell("Y5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Y5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Y5:AD5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Y5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Y5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("Y6:Y7").Merge().Value = "สมทบกองทุนประกันสังคม"; + ws.Cell("Y6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Y6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Y6:Y7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Y6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Y6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("Z6:Z7").Merge().Value = "กองทุนทดแทน"; + ws.Cell("Z6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("Z6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Z6:Z7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("Z6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Z6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AA6:AA7").Merge().Value = "กองทุนสำรองเลี้ยงชีพ"; + ws.Cell("AA6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AA6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AA6:AA7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AA6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AA6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AB6:AB7").Merge().Value = "เงินส่งเสริมคุณภาพชีวิต"; + ws.Cell("AB6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AB6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AB6:AB7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AB6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AB6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AC6:AC7").Merge().Value = "ค่าธรรมเนียม"; + ws.Cell("AC6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AC6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AC6:AC7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AC6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AC6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AD6:AD7").Merge().Value = "รวมสวัสดิการ"; + ws.Cell("AD6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AD6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AD6:AD7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AD6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AD6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AE5:AE7").Merge().Value = "รวมเงินเดือน + สวัสดิการ"; + ws.Cell("AE5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AE5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AE5:AE7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AE5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AE5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AF4:AF7").Merge().Value = "วันเกิด"; + ws.Cell("AF4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AF4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AF4:AF7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AF4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AF4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AG4:AH5").Merge().Value = "ผู้เกษียณอายุราชการปี 2565 (1 ต.ค. 2565)"; + ws.Cell("AG4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AG4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AG4:AH5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AG4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AG4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AG6:AG7").Merge().Value = "ผู้เกษียณ"; + ws.Cell("AG6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AG6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AG6:AG7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AG6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AG6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AH6:AH7").Merge().Value = "ค่าจ้างต่อเดือน"; + ws.Cell("AH6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AH6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AH6:AH7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AH6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AH6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AI4:AP4").Merge().Value = "ส่วนควบงบดำเนินงาน"; + ws.Cell("AI4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AI4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AI4:AP4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AI4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AI4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AI5:AJ5").Merge().Value = "เงินประจำตำแหน่งบริหารที่มีวาระ"; + ws.Cell("AI5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AI5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AI5:AJ5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AI5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AI5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AI6:AI7").Merge().Value = "เงินประจำตำแหน่ง"; + ws.Cell("AI6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AI6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AI6:AI7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AI6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AI6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AJ6:AJ7").Merge().Value = "ค่าตอบแทนรายเดือน (เทียบเท่าเงินประจำตำแหน่ง)"; + ws.Cell("AJ6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AJ6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AJ6:AJ7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AJ6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AJ6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AK5:AL5").Merge().Value = "เงินประจำตำแหน่งบริหารไม่มีวาระ"; + ws.Cell("AK5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AK5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AK5:AL5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AK5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AK5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AK6:AK7").Merge().Value = "เงินประจำตำแหน่ง"; + ws.Cell("AK6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AK6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AK6:AK7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AK6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AK6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AL6:AL7").Merge().Value = "ค่าตอบแทนรายเดือน (เทียบเท่าเงินประจำตำแหน่ง)"; + ws.Cell("AL6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AL6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AL6:AL7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AL6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AL6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AL6:AL7").Style.Fill.BackgroundColor = XLColor.Orange; + + ws.Range("AM5:AM7").Merge().Value = "ค่าตอบแทนเหมาจ่ายแทนการจัดหารถประจำตำแหน่ง"; + ws.Cell("AM5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AM5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AM5:AM7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AM5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AM5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AM5:AM7").Style.Fill.BackgroundColor = XLColor.Orange; + + ws.Range("AN5:AO5").Merge().Value = "อื่น ๆ"; + ws.Cell("AN5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AN5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AN5:AO5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AN5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AN5").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AN5:AO5").Style.Fill.BackgroundColor = XLColor.Orange; + + ws.Range("AN6:AN7").Merge().Value = "ระบุรายการ"; + ws.Cell("AN6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AN6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AN6:AN7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AN6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AN6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AN6:AN7").Style.Fill.BackgroundColor = XLColor.Orange; + + ws.Range("AO6:AO7").Merge().Value = "จำนวนเงิน"; + ws.Cell("AO6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AO6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AO6:AO7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AO6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AO6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AO6:AO7").Style.Fill.BackgroundColor = XLColor.Orange; + + ws.Range("AP5:AP7").Merge().Value = "รวม"; + ws.Cell("AP5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AP5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AP5:AP7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AP5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AP5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AQ4:AU4").Merge().Value = "ส่วนควบงบเงินอุดหนุน"; + ws.Cell("AQ4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AQ4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AQ4:AU4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AQ4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AQ4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AQ5:AR5").Merge().Value = "เงินประจำตำแหน่งวิชาการ"; + ws.Cell("AQ5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AQ5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AQ5:AR5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AQ5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AQ5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AQ6:AQ7").Merge().Value = "เงินประจำตำแหน่ง"; + ws.Cell("AQ6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AQ6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AQ6:AQ7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AQ6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AQ6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AR6:AR7").Merge().Value = "ค่าตอบแทนรายเดือน (เทียบเท่าเงินประจำตำแหน่ง)"; + ws.Cell("AR6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AR6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AR6:AR7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AR6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AR6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AS5:AT5").Merge().Value = "เงินประจำตำแหน่งประเภทวิชาชีพเฉพาะ เชียวชาญเฉพาะ"; + ws.Cell("AS5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AS5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AS5:AT5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AS5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AS5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AS6:AS7").Merge().Value = "เงินประจำตำแหน่ง"; + ws.Cell("AS6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AS6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AS6:AS7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AS6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AS6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AS6:AS7").Style.Fill.BackgroundColor=XLColor.Orange; + + ws.Range("AT6:AT7").Merge().Value = "ค่าตอบแทนรายเดือน (เทียบเท่าเงินประจำตำแหน่ง)"; + ws.Cell("AT6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AT6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AT6:AT7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AT6").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AT6").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AU5:AU7").Merge().Value = "รวม"; + ws.Cell("AU5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AU5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AU5:AU7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AU5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AU5").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("AV4:AV7").Merge().Value = "รวมค่าจ้างและส่วนควบ"; + ws.Cell("AV4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("AV4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AV4:AV7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("AV4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AV4").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("A4:AV7").Style.Alignment.WrapText = true; + ws.Row(4).Height = 45; + ws.Row(5).Height = 45; + ws.Row(6).Height = 45; + ws.Column(1).Width = 10; + ws.Column(2).Width = 10; + ws.Column(3).Width = 30; + ws.Column(4).Width = 30; + ws.Column(5).Width = 30; + ws.Column(6).Width = 30; + ws.Column(7).Width = 30; + ws.Column(8).Width = 30; + ws.Column(9).Width = 10; + ws.Column(10).Width = 10; + ws.Column(11).Width = 30; + ws.Column(12).Width = 30; + ws.Column(13).Width = 30; + 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; + ws.Column(28).Width = 15; + ws.Column(29).Width = 15; + ws.Column(30).Width = 15; + ws.Column(31).Width = 15; + ws.Column(32).Width = 15; + ws.Column(33).Width = 15; + ws.Column(34).Width = 15; + ws.Column(35).Width = 15; + ws.Column(36).Width = 15; + ws.Column(37).Width = 15; + ws.Column(38).Width = 15; + ws.Column(39).Width = 15; + ws.Column(40).Width = 15; + ws.Column(41).Width = 15; + ws.Column(42).Width = 15; + ws.Column(43).Width = 15; + ws.Column(44).Width = 15; + ws.Column(45).Width = 15; + ws.Column(46).Width = 15; + ws.Column(47).Width = 15; + ws.Column(48).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, 16).Value = _personnel.salary; + // ws.Cell(row, 17).Value = _personnel.estimated_salary_3_percent_1; + // ws.Cell(row, 18).Value = _personnel.estimated_salary_3_percent_2; + // ws.Cell(row, 19).Value = _personnel.estimated_salary_3_percent_3; + // ws.Cell(row, 20).Value = _personnel.estimated_salary_3_percent_4; + // ws.Cell(row, 21).Value = _personnel.estimated_salary_3_percent_sum; + // ws.Cell(row, 22).Value = _personnel.retiree; + // ws.Cell(row, 23).Value = _personnel.salary_per_month; + // ws.Cell(row, 24).Value = _personnel.salary_per_month_12; + // ws.Cell(row, 25).Value = _personnel.salary_minus_retirement_year; + // ws.Cell(row, 26).Value = _personnel.position_money; + // ws.Cell(row, 27).Value = _personnel.position_money_12; + // ws.Cell(row, 28).Value = _personnel.compensation_monthly; + // ws.Cell(row, 29).Value = _personnel.compensation_monthly_12; + // ws.Cell(row, 30).Value = _personnel.position_money_2; + // ws.Cell(row, 31).Value = _personnel.position_money_2_12; + // ws.Cell(row, 32).Value = _personnel.compensation_monthly_2; + // ws.Cell(row, 33).Value = _personnel.compensation_monthly_2_12; + // ws.Cell(row, 34).Value = _personnel.total; + // ws.Cell(row, 35).Value = _personnel.position_money_3; + // ws.Cell(row, 36).Value = _personnel.position_money_3_12; + // ws.Cell(row, 37).Value = _personnel.compensation_monthly_3; + // ws.Cell(row, 38).Value = _personnel.compensation_monthly_3_12; + // ws.Cell(row, 39).Value = _personnel.position_money_4; + // ws.Cell(row, 40).Value = _personnel.position_money_4_12; + // ws.Cell(row, 41).Value = _personnel.compensation_monthly_4; + // ws.Cell(row, 42).Value = _personnel.compensation_monthly_4_12; + // ws.Cell(row, 43).Value = _personnel.house_rent; + // ws.Cell(row, 44).Value = _personnel.compensation_paid; + // ws.Cell(row, 45).Value = _personnel.compensation_paid_12; + // ws.Cell(row, 46).Value = _personnel.special_compensation_with_full_salary; + // ws.Cell(row, 47).Value = _personnel.special_compensation; + // + // ws.Cell(row, 48).Value = _personnel.special_compensation_12; + // ws.Cell(row, 49).Value = _personnel.compensation_1; + // ws.Cell(row, 50).Value = _personnel.compensation_2; + // ws.Cell(row, 51).Value = _personnel.compensation_3; + // ws.Cell(row, 52).Value = _personnel.compensation_4; + // ws.Cell(row, 53).Value = _personnel.compensation_5; + // ws.Cell(row, 54).Value = _personnel.compensation_6; + // ws.Cell(row, 55).Value = _personnel.other; + // ws.Cell(row, 56).Value = _personnel.other_price; + // ws.Cell(row, 57).Value = _personnel.total_2; + // ws.Cell(row, 58).Value = _personnel.total_including_salary_and_fittings; + // ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings_12; + // //ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings; + //ws.Cell(row, 60).Value = _personnel.total_including_salary_and_fittings_12; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.LeftBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.RightBorder = 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, 59)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).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, 5), ws.Cell(row, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.Alignment.Horizontal = + 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 = + 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("#,#"); + row++; + foreach (var detail in _personnel.personnel_salary_university) + { + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 5)).Merge().Value = detail.agency_category_name; + // ws.Cell(row, 16).Value = detail.salary; + // ws.Cell(row, 17).Value = detail.estimated_salary_3_percent_1; + // ws.Cell(row, 18).Value = detail.estimated_salary_3_percent_2; + // ws.Cell(row, 19).Value = detail.estimated_salary_3_percent_3; + // ws.Cell(row, 20).Value = detail.estimated_salary_3_percent_4; + // ws.Cell(row, 21).Value = detail.estimated_salary_3_percent_sum; + // ws.Cell(row, 22).Value = detail.retiree; + // ws.Cell(row, 23).Value = detail.salary_per_month; + // ws.Cell(row, 24).Value = detail.salary_per_month_12; + // ws.Cell(row, 25).Value = detail.salary_minus_retirement_year; + // ws.Cell(row, 26).Value = detail.position_money; + // ws.Cell(row, 27).Value = detail.position_money_12; + // ws.Cell(row, 28).Value = detail.compensation_monthly; + // ws.Cell(row, 29).Value = detail.compensation_monthly_12; + // ws.Cell(row, 30).Value = detail.position_money_2; + // ws.Cell(row, 31).Value = detail.position_money_2_12; + // ws.Cell(row, 32).Value = detail.compensation_monthly_2; + // ws.Cell(row, 33).Value = detail.compensation_monthly_2_12; + // ws.Cell(row, 34).Value = detail.total; + // ws.Cell(row, 35).Value = detail.position_money_3; + // ws.Cell(row, 36).Value = detail.position_money_3_12; + // ws.Cell(row, 37).Value = detail.compensation_monthly_3; + // ws.Cell(row, 38).Value = detail.compensation_monthly_3_12; + // ws.Cell(row, 39).Value = detail.position_money_4; + // ws.Cell(row, 40).Value = detail.position_money_4_12; + // ws.Cell(row, 41).Value = detail.compensation_monthly_4; + // ws.Cell(row, 42).Value = detail.compensation_monthly_4_12; + // ws.Cell(row, 43).Value = detail.house_rent; + // ws.Cell(row, 44).Value = detail.compensation_paid; + // ws.Cell(row, 45).Value = detail.compensation_paid_12; + // ws.Cell(row, 46).Value = detail.special_compensation_with_full_salary; + // ws.Cell(row, 47).Value = detail.special_compensation; + // ws.Cell(row, 48).Value = detail.special_compensation_12; + // ws.Cell(row, 49).Value = detail.compensation_1; + // ws.Cell(row, 50).Value = detail.compensation_2; + // ws.Cell(row, 51).Value = detail.compensation_3; + // ws.Cell(row, 52).Value = detail.compensation_4; + // ws.Cell(row, 53).Value = detail.compensation_5; + // ws.Cell(row, 54).Value = detail.compensation_6; + // ws.Cell(row, 55).Value = detail.other; + // ws.Cell(row, 56).Value = detail.other_price; + // ws.Cell(row, 57).Value = detail.total_2; + // ws.Cell(row, 58).Value = detail.total_including_salary_and_fittings; + // ws.Cell(row, 59).Value = detail.total_including_salary_and_fittings_12; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.LeftBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.RightBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Fill.BackgroundColor = XLColor.LightYellow; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.Alignment.Horizontal = + 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 = + 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("#,#"); + row++; + foreach (var detail2 in detail.personnel_salary_university_deltail) + { + CultureInfo culture = new CultureInfo("th-TH"); + // 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.prefix + detail2.first_name_th; + // ws.Cell(row, 4).Value = detail2.last_name_th; + // ws.Cell(row, 5).Value = detail2.parent_agency_name; + // ws.Cell(row, 6).Value = detail2.area; + // ws.Cell(row, 7).Value = detail2.position; + // ws.Cell(row, 8).Value = detail2.position_level; + // if (detail2.is_academic_line == true) + // { + // ws.Cell(row, 9).Value = "/"; + // } + // + // if (detail2.is_academic_line == false) + // { + // ws.Cell(row, 9).Value = ""; + // } + // + // if (detail2.is_support_line == true) + // { + // ws.Cell(row, 10).Value = "/"; + // } + // + // if (detail2.is_support_line == false) + // { + // ws.Cell(row, 10).Value = ""; + // } + // + // 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) + // { + // ws.Cell(row, 14).Value = + // detail2.assign_effective_date.Value.ToString("dd MMMM yyyy", culture); + // } + // + // if (detail2.assign_effective_date == 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; + // ws.Cell(row, 18).Value = detail2.estimated_salary_3_percent_2; + // ws.Cell(row, 19).Value = detail2.estimated_salary_3_percent_3; + // ws.Cell(row, 20).Value = detail2.estimated_salary_3_percent_4; + // ws.Cell(row, 21).Value = detail2.estimated_salary_3_percent_sum; + // ws.Cell(row, 22).Value = detail2.retiree; + // ws.Cell(row, 23).Value = detail2.salary_per_month; + // ws.Cell(row, 24).Value = detail2.salary_per_month_12; + // ws.Cell(row, 25).Value = detail2.salary_minus_retirement_year; + // ws.Cell(row, 26).Value = detail2.position_money; + // ws.Cell(row, 27).Value = detail2.position_money_12; + // ws.Cell(row, 28).Value = detail2.compensation_monthly; + // ws.Cell(row, 29).Value = detail2.compensation_monthly_12; + // ws.Cell(row, 30).Value = detail2.position_money_2; + // ws.Cell(row, 31).Value = detail2.position_money_2_12; + // ws.Cell(row, 32).Value = detail2.compensation_monthly_2; + // ws.Cell(row, 33).Value = detail2.compensation_monthly_2_12; + // ws.Cell(row, 34).Value = detail2.total; + // ws.Cell(row, 35).Value = detail2.position_money_3; + // ws.Cell(row, 36).Value = detail2.position_money_3_12; + // ws.Cell(row, 37).Value = detail2.compensation_monthly_3; + // ws.Cell(row, 38).Value = detail2.compensation_monthly_3_12; + // ws.Cell(row, 39).Value = detail2.position_money_4; + // ws.Cell(row, 40).Value = detail2.position_money_4_12; + // ws.Cell(row, 41).Value = detail2.compensation_monthly_4; + // ws.Cell(row, 42).Value = detail2.compensation_monthly_4_12; + // ws.Cell(row, 43).Value = detail2.house_rent; + // ws.Cell(row, 44).Value = detail2.compensation_paid; + // ws.Cell(row, 45).Value = detail2.compensation_paid_12; + // ws.Cell(row, 46).Value = detail2.special_compensation_with_full_salary; + // ws.Cell(row, 47).Value = detail2.special_compensation; + // ws.Cell(row, 48).Value = detail2.special_compensation_12; + // ws.Cell(row, 49).Value = detail2.compensation_1; + // ws.Cell(row, 50).Value = detail2.compensation_2; + // ws.Cell(row, 51).Value = detail2.compensation_3; + // ws.Cell(row, 52).Value = detail2.compensation_4; + // ws.Cell(row, 53).Value = detail2.compensation_5; + // ws.Cell(row, 54).Value = detail2.compensation_6; + // ws.Cell(row, 55).Value = detail2.other; + // ws.Cell(row, 56).Value = detail2.other_price; + // ws.Cell(row, 57).Value = detail2.total_2; + // ws.Cell(row, 58).Value = detail2.total_including_salary_and_fittings; + // ws.Cell(row, 59).Value = detail2.total_including_salary_and_fittings_12; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.LeftBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.RightBorder = + // 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, 59)).Style.Font.FontSize = 16; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Alignment.WrapText = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).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, 8)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 11), ws.Cell(row, 14)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 15).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Right; + // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); + // ws.Cell(row, 21).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 27).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 29).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 31).Style.Fill.BackgroundColor = XLColor.LightYellow; + // ws.Cell(row, 36).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 38).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 40).Style.Fill.BackgroundColor = XLColor.LightYellow; + // ws.Cell(row, 42).Style.Fill.BackgroundColor = XLColor.LightBlue; + // ws.Cell(row, 45).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 48).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 59).Style.Fill.BackgroundColor = XLColor.LightGreen; + // + // row++; + // } + + // if (detail2.first_name_th == "รวม") + // { + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail2.first_name_th; + // ws.Cell(row, 16).Value = detail2.salary; + // ws.Cell(row, 17).Value = detail2.estimated_salary_3_percent_1; + // ws.Cell(row, 18).Value = detail2.estimated_salary_3_percent_2; + // ws.Cell(row, 19).Value = detail2.estimated_salary_3_percent_3; + // ws.Cell(row, 20).Value = detail2.estimated_salary_3_percent_4; + // ws.Cell(row, 21).Value = detail2.estimated_salary_3_percent_sum; + // ws.Cell(row, 22).Value = detail2.retiree; + // ws.Cell(row, 23).Value = detail2.salary_per_month; + // ws.Cell(row, 24).Value = detail2.salary_per_month_12; + // ws.Cell(row, 25).Value = detail2.salary_minus_retirement_year; + // ws.Cell(row, 26).Value = detail2.position_money; + // ws.Cell(row, 27).Value = detail2.position_money_12; + // ws.Cell(row, 28).Value = detail2.compensation_monthly; + // ws.Cell(row, 29).Value = detail2.compensation_monthly_12; + // ws.Cell(row, 30).Value = detail2.position_money_2; + // ws.Cell(row, 31).Value = detail2.position_money_2_12; + // ws.Cell(row, 32).Value = detail2.compensation_monthly_2; + // ws.Cell(row, 33).Value = detail2.compensation_monthly_2_12; + // ws.Cell(row, 34).Value = detail2.total; + // ws.Cell(row, 35).Value = detail2.position_money_3; + // ws.Cell(row, 36).Value = detail2.position_money_3_12; + // ws.Cell(row, 37).Value = detail2.compensation_monthly_3; + // ws.Cell(row, 38).Value = detail2.compensation_monthly_3_12; + // ws.Cell(row, 39).Value = detail2.position_money_4; + // ws.Cell(row, 40).Value = detail2.position_money_4_12; + // ws.Cell(row, 41).Value = detail2.compensation_monthly_4; + // ws.Cell(row, 42).Value = detail2.compensation_monthly_4_12; + // ws.Cell(row, 43).Value = detail2.house_rent; + // ws.Cell(row, 44).Value = detail2.compensation_paid; + // ws.Cell(row, 45).Value = detail2.compensation_paid_12; + // ws.Cell(row, 46).Value = detail2.special_compensation_with_full_salary; + // ws.Cell(row, 47).Value = detail2.special_compensation; + // ws.Cell(row, 48).Value = detail2.special_compensation_12; + // ws.Cell(row, 49).Value = detail2.compensation_1; + // ws.Cell(row, 50).Value = detail2.compensation_2; + // ws.Cell(row, 51).Value = detail2.compensation_3; + // ws.Cell(row, 52).Value = detail2.compensation_4; + // ws.Cell(row, 53).Value = detail2.compensation_5; + // ws.Cell(row, 54).Value = detail2.compensation_6; + // ws.Cell(row, 55).Value = detail2.other; + // ws.Cell(row, 56).Value = detail2.other_price; + // ws.Cell(row, 57).Value = detail2.total_2; + // ws.Cell(row, 58).Value = detail2.total_including_salary_and_fittings; + // ws.Cell(row, 59).Value = detail2.total_including_salary_and_fittings_12; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.LeftBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.RightBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Border.TopBorder = + // XLBorderStyleValues.Double; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Font.SetBold().Font.FontSize = 16; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 59)).Style.Alignment.WrapText = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).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, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Right; + // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); + // } + } + + // 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)"; + // 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 = + // "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; + // } + // + // 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_salary_university_" + 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_temporary_root.cs b/Models/Personnel/personnel_salary_temporary_root.cs new file mode 100644 index 0000000..a48c1e9 --- /dev/null +++ b/Models/Personnel/personnel_salary_temporary_root.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace rmutr_report.Models.Personnel +{ + public class personnel_salary_temporary_root + { + [Key] + public Guid? personnel_salary_temporary_root_uid { get; set; } + public Guid? log_report_uid { get; set; } + public string year { get; set; } + public int? salary { get; set; } + public int? salary_12 { get; set; } + public int? salary2 { get; set; } + public int? salary2_12 { get; set; } + public int? house_rent { get; set; } + public int? house_rent_12 { get; set; } + public int? fund_contribution { get; set; } + public int? fund_contribution_12 { get; set; } + public int? contribution { get; set; } + public int? contribution_12 { get; set; } + public string other { get; set; } + public int? other_price { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + public List personnel_salary_temporary { get; set; } + + } + + public class t_personnel_salary_temporary + { + [Key] + public Guid? personnel_salary_temporary_uid { get; set; } + public Guid? personnel_salary_temporary_root_uid { get; set; } + + public string agency_category_name { get; set; } + public int? salary { get; set; } + public int? salary_12 { get; set; } + public int? salary2 { get; set; } + public int? salary2_12 { get; set; } + public int? house_rent { get; set; } + public int? house_rent_12 { get; set; } + public int? fund_contribution { get; set; } + public int? fund_contribution_12 { get; set; } + public int? contribution { get; set; } + public int? contribution_12 { get; set; } + public string other { get; set; } + public int? other_price { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + public List personnel_salary_temporary_deltail { get; set; } + + } + + public class t_personnel_salary_temporary_deltail + { + [Key] + + public Guid? personnel_salary_temporary_deltail_uid { get; set; } + public Guid? personnel_salary_temporary_uid { get; set; } + + + public string first_name_th { get; set; } + public string last_name_th { get; set; } + public string position { get; set; } + public string parent_agency_name { get; set; } + public string area { get; set; } + + public int? salary { get; set; } + public int? salary_12 { get; set; } + public int? salary2 { get; set; } + public int? salary2_12 { get; set; } + public int? house_rent { get; set; } + public int? house_rent_12 { get; set; } + public int? fund_contribution { get; set; } + public int? fund_contribution_12 { get; set; } + public int? contribution { get; set; } + public int? contribution_12 { get; set; } + public string other { get; set; } + public int? other_price { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + } +} \ No newline at end of file diff --git a/Models/Personnel/personnel_salary_university_root.cs b/Models/Personnel/personnel_salary_university_root.cs new file mode 100644 index 0000000..65cbb14 --- /dev/null +++ b/Models/Personnel/personnel_salary_university_root.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace rmutr_report.Models.Personnel +{ + public class personnel_salary_university_root + { + [Key] + public Guid? personnel_salary_university_root_uid { get; set; } + public Guid? log_report_uid { get; set; } + public string year { get; set; } + public int? salary { get; set; } + public bool? is_academic_line { get; set; } + public bool? is_support_line { get; set; } + public string management_position_name { get; set; } + public string position_name { get; set; } + public string assign_no_plus_assign_effective_date { get; set; } + public string education_level { get; set; } + public string education_of_manpower { get; set; } + public int? salary2 { get; set; } + + public int? wages1 { get; set; } + public int? wages2 { get; set; } + public int? wages3 { get; set; } + public int? wages4 { get; set; } + public int? wages5 { get; set; } + public int? total_wages { get; set; } + public int? promote { get; set; } + public int? total_salary { get; set; } + + + public int? welfare_benefit1 { get; set; } + public int? welfare_benefit2 { get; set; } + public int? welfare_benefit3 { get; set; } + public int? welfare_benefit4 { get; set; } + public int? welfare_benefit5 { get; set; } + public int? total_welfare_benefit { get; set; } + + + public int? total_salary_welfare_benefit { get; set; } + public string birth_date { get; set; } + public int? retiree { get; set; } + public int? salary_per_month { get; set; } + public int? position_money { get; set; } + public int? monthly_remuneration { get; set; } + public int? position_money_2 { get; set; } + public int? monthly_remuneration_2 { get; set; } + + public int? compensation { get; set; } + + public string other { get; set; } + public int? other_price { get; set; } + public int? total { get; set; } + public int? position_money_3 { get; set; } + public int? monthly_remuneration_3 { get; set; } + public int? position_money_4 { get; set; } + public int? monthly_remuneration_4 { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + public List personnel_salary_university { get; set; } + + } + + public class t_personnel_salary_university + { + [Key] + public Guid? personnel_salary_university_uid { get; set; } + public Guid? personnel_salary_university_root_uid { get; set; } + + public string agency_category_name { get; set; } + public string manpower { get; set; } + + public string first_name_th { get; set; } + public string last_name_th { get; set; } + + public string parent_agency_name { get; set; } + public string area { get; set; } + public string position { get; set; } + public int? salary { get; set; } + public bool? is_academic_line { get; set; } + public bool? is_support_line { get; set; } + public string management_position_name { get; set; } + public string position_name { get; set; } + public string assign_no_plus_assign_effective_date { get; set; } + public string education_level { get; set; } + public string education_of_manpower { get; set; } + public int? salary2 { get; set; } + + public int? wages1 { get; set; } + public int? wages2 { get; set; } + public int? wages3 { get; set; } + public int? wages4 { get; set; } + public int? wages5 { get; set; } + public int? total_wages { get; set; } + public int? promote { get; set; } + public int? total_salary { get; set; } + + + public int? welfare_benefit1 { get; set; } + public int? welfare_benefit2 { get; set; } + public int? welfare_benefit3 { get; set; } + public int? welfare_benefit4 { get; set; } + public int? welfare_benefit5 { get; set; } + public int? total_welfare_benefit { get; set; } + + + public int? total_salary_welfare_benefit { get; set; } + public string birth_date { get; set; } + public int? retiree { get; set; } + public int? salary_per_month { get; set; } + public int? position_money { get; set; } + public int? monthly_remuneration { get; set; } + public int? position_money_2 { get; set; } + public int? monthly_remuneration_2 { get; set; } + + public int? compensation { get; set; } + + public string other { get; set; } + public int? other_price { get; set; } + public int? total { get; set; } + public int? position_money_3 { get; set; } + public int? monthly_remuneration_3 { get; set; } + public int? position_money_4 { get; set; } + public int? monthly_remuneration_4 { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + public List personnel_salary_university_deltail { get; set; } + + } + + public class t_personnel_salary_university_deltail + { + [Key] + + public Guid? personnel_salary_university_deltail_uid { get; set; } + public Guid? personnel_salary_university_uid { get; set; } + public string manpower { get; set; } + + public string first_name_th { get; set; } + public string last_name_th { get; set; } + + public string parent_agency_name { get; set; } + public string area { get; set; } + public string position { get; set; } + public int? salary { get; set; } + public bool? is_academic_line { get; set; } + public bool? is_support_line { get; set; } + public string management_position_name { get; set; } + public string position_name { get; set; } + public string assign_no_plus_assign_effective_date { get; set; } + public string education_level { get; set; } + public string education_of_manpower { get; set; } + public int? salary2 { get; set; } + + public int? wages1 { get; set; } + public int? wages2 { get; set; } + public int? wages3 { get; set; } + public int? wages4 { get; set; } + public int? wages5 { get; set; } + public int? total_wages { get; set; } + public int? promote { get; set; } + public int? total_salary { get; set; } + + + public int? welfare_benefit1 { get; set; } + public int? welfare_benefit2 { get; set; } + public int? welfare_benefit3 { get; set; } + public int? welfare_benefit4 { get; set; } + public int? welfare_benefit5 { get; set; } + public int? total_welfare_benefit { get; set; } + + + public int? total_salary_welfare_benefit { get; set; } + public string birth_date { get; set; } + public int? retiree { get; set; } + public int? salary_per_month { get; set; } + public int? position_money { get; set; } + public int? monthly_remuneration { get; set; } + public int? position_money_2 { get; set; } + public int? monthly_remuneration_2 { get; set; } + + public int? compensation { get; set; } + + public string other { get; set; } + public int? other_price { get; set; } + public int? total { get; set; } + public int? position_money_3 { get; set; } + public int? monthly_remuneration_3 { get; set; } + public int? position_money_4 { get; set; } + public int? monthly_remuneration_4 { get; set; } + public int? total2 { get; set; } + public int? total_wage { get; set; } + } +} \ No newline at end of file