add report พนง.ราชการ

This commit is contained in:
kamonwan taengsuk
2023-03-30 13:07:09 +07:00
parent 7ecca50002
commit 0a67d866bd
10 changed files with 1209 additions and 848 deletions

View File

@@ -321,7 +321,6 @@ namespace rmutr_report.Controllers
if (postponement_compensations.get_promoted == false) if (postponement_compensations.get_promoted == false)
{ {
postponement_compensations.check_get_promoted = ""; postponement_compensations.check_get_promoted = "";
} }
if (postponement_compensations.not_get_promoted == true) if (postponement_compensations.not_get_promoted == true)
@@ -494,176 +493,499 @@ namespace rmutr_report.Controllers
return Ok(); return Ok();
} }
// [HttpPost, Route("reports/personnel_salary_permanent/{type}")]
// [ApiExplorerSettings(GroupName = "reports")] [HttpPost, Route("reports/personnel_salary_permanent/{type}")]
// public IActionResult GetPersonSalaryReport([FromRoute] string type, [ApiExplorerSettings(GroupName = "reports")]
// [FromBody] personnel_salary_permanent_root _personnel) public IActionResult GetPersonSalaryReport([FromRoute] string type,
// { [FromBody] personnel_salary_permanent_root _personnel)
// var workbook = new XLWorkbook(); {
// var ws = workbook.Worksheets.Add("พนักงานราชการ"); var workbook = new XLWorkbook();
// var ws = workbook.Worksheets.Add("พนักงานราชการ");
// ws.Range("A4:A6").Merge().Value = "ลำดับความสำคัญ(1)";
// ws.Cell("A4").Style.Alignment.WrapText = true; ws.Range("A1:T1").Merge().Value = "รายละเอียดเงินเดือนและส่วนควบของพนักงานราชการ ประจำปีงบประมาณ พ.ศ. " +
// ws.Range("A4:A6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; _personnel.year;
// ws.Range("A4:A6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A1").Style.Alignment.WrapText = true;
// ws.Range("A4:A6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A1:T1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; ws.Range("A1:T1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("A4").Style.Font.FontSize = 14; ws.Range("A1:T1").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("B4:B6").Merge().Value = "รายการ"; ws.Range("A1:T1").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A2:T2").Merge().Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์";
// ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A2").Style.Alignment.WrapText = true;
// ws.Cell("B4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A2:T2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; ws.Range("A2:T2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("B4").Style.Font.FontSize = 14; ws.Range("A2:T2").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("C5:E5").Merge().Value = "ประเภทของครุภัณฑ์"; ws.Range("A2:T2").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("C5:E5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A3:T3").Merge().Value = "หน่วย : บาท";
// ws.Range("C5:E5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A3").Style.Alignment.WrapText = true;
// ws.Range("C5:E5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A3:T3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
// ws.Cell("C5").Style.Font.FontName = "TH SarabunPSK"; ws.Range("A3:T3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("C5").Style.Font.FontSize = 11; ws.Range("A3:T3").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("C6").Value = "ทดแทนของเดิม"; ws.Range("A3:T3").Style.Font.FontSize = 16;
// ws.Cell("C6").Style.Alignment.WrapText = true; ws.Range("A4:A7").Merge().Value = "ลำดับที่";
// ws.Cell("C6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("C6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("C6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("A4:A7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell("C6").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("C6").Style.Font.FontSize = 11; ws.Cell("A4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("D6").Value = "เพิ่มประสิทธิภาพ";
// ws.Cell("D6").Style.Font.FontName = "TH SarabunPSK"; ws.Range("B4:B7").Merge().Value = "เลขที่ตำแหน่ง";
// ws.Cell("D6").Style.Font.FontSize = 11; ws.Cell("B4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("D6").Style.Alignment.WrapText = true; ws.Cell("B4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("D6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("B4:B7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell("D6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("D6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("B4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("E6").Value = "ครุภัณฑ์ใหม่";
// ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK"; ws.Range("C4:D7").Merge().Value = "ชื่อ- สกุล";
// ws.Cell("E6").Style.Font.FontSize = 11; ws.Cell("C4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("E6").Style.Alignment.WrapText = true; ws.Cell("C4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("C4:D7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell("E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("C4").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("E6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("C4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("F5:F6").Merge().Value = "หน่วยนับ";
// ws.Cell("F5").Style.Font.FontName = "TH SarabunPSK"; ws.Range("E4:E7").Merge().Value = "ชื่อตำแหน่ง";
// ws.Cell("F5").Style.Font.FontSize = 12; ws.Cell("E4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// //ws.Range("F3").Style.Font.Bold = true; ws.Cell("E4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Range("F5:F6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("E4:E7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("F5:F6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("E4").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("F5:F6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("E4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("G5:G6").Merge().Value = "จำนวน";
// ws.Cell("G5").Style.Font.FontName = "TH SarabunPSK"; ws.Range("F4:G7").Merge().Value = "สังกัด/พื้นที่";
// ws.Cell("G5").Style.Font.FontSize = 12; ws.Cell("F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// //ws.Range("G3").Style.Font.Bold = true; ws.Cell("F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Range("G5:G6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("F4:G7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("G5:G6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("F4").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("G5:G6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("F4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("G5").Style.Alignment.SetTextRotation(90);
// ws.Range("H5:H6").Merge().Value = "ราคาต่อหน่วย"; ws.Range("H4:H7").Merge().Value = "เงินเดือน ณ " + _personnel.salary_text_1;
// ws.Cell("H5").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("H4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("H5").Style.Font.FontSize = 12; ws.Cell("H4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// //ws.Range("H3").Style.Font.Bold = true; ws.Range("H4:H7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("H5:H6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("H4").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("H5:H6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("H4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("H5:H6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("I4:M4").Merge().Value = "แผนความต้องการครุภัณฑ์"; ws.Range("I4:I6").Merge().Value = "ประมาณการเงินเดือน " + _personnel.salary_text_2 + " (4 %)";
// ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("I4").Style.Font.FontSize = 14; ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// //ws.Range("I2").Style.Font.Bold = true; ws.Range("I4:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("I4:M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("I4:M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("I4:M4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("I5:M5").Merge().Value = "วงเงิน"; ws.Range("J4:J6").Merge().Value = "เลื่อนขั้น 4%" + _personnel.salary_text_3;
// ws.Cell("I5").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("J4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("I5").Style.Font.FontSize = 14; ws.Cell("J4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Range("I5:M5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("J4:J6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("I5:M5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("J4").Style.Font.FontName = "TH SarabunPSK";
// ws.Range("I5:M5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("J4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range("N4:N6").Merge().Value = "คำอธิบายความพร้อม/ประโยชน์ที่จะได้รับ";
// ws.Cell("N4").Style.Font.FontName = "TH SarabunPSK"; ws.Range("K4:K6").Merge().Value = "รวม";
// ws.Cell("N4").Style.Font.FontSize = 14; ws.Cell("K4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("N4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("K4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell("N4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("K4:K6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range("N4:N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("K4").Style.Font.FontName = "TH SarabunPSK";
// ws.Row(4).Height = 30; ws.Cell("K4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Row(5).Height = 30; ws.Range("L4:L6").Merge().Value = "เงินเดือน*12";
// ws.Row(6).Height = 30; ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Column(1).Width = 9; ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Column(2).Width = 40; ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Column(3).Width = 5; ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK";
// ws.Column(4).Width = 5; ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Column(5).Width = 5; ws.Range("L4:L6").Merge().Value = "เงินเดือน*12";
// ws.Column(6).Width = 10; ws.Cell("L4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Column(7).Width = 10; ws.Cell("L4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Column(8).Width = 10; ws.Range("L4:L6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Column(9).Width = 10; ws.Cell("L4").Style.Font.FontName = "TH SarabunPSK";
// ws.Column(10).Width = 10; ws.Cell("L4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Column(11).Width = 10;
// ws.Column(12).Width = 10; ws.Range("M4:S4").Merge().Value = "ส่วนควบงบดำเนินงาน";
// ws.Column(13).Width = 10; ws.Cell("M4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Column(14).Width = 40; ws.Cell("M4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// int row = 7; ws.Range("M4:S4").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// int no = 1; ws.Cell("M4").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("M4").Style.Font.SetBold().Font.FontSize = 16;
// if (_personnel != null)
// { ws.Range("M5:N6").Merge().Value = "เงินสมทบกองทุนประกันสังคม";
// ws.Cell("M5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// foreach (var detail in _personnel.personnel_salary_permanent) 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(row, 1).Value = no; ws.Cell("M5").Style.Font.SetBold().Font.FontSize = 16;
// no++; ws.Range("O5:P6").Merge().Value = "เงินสมทบกองทุนเงินทดแทน";
// //ws.Cell(row, 2).Value = detail.manpower; ws.Cell("O5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("O5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("O5:P6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("O5").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("O5").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("Q5:R5").Merge().Value = "อื่น ๆ";
// ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("Q5:R5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q5").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q5").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q6").Value = "ระบุรายการ";
// ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("Q6").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("Q6").Style.Font.SetBold().Font.FontSize = 16;
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 14)).Style.Font.FontName = ws.Cell("R6").Value = "จำนวนเงิน";
// "TH SarabunPSK"; ws.Cell("R6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 14)).Style.Font.FontSize = 11; ws.Cell("R6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 14)).Style.Alignment.WrapText = true; ws.Cell("R6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 14)).Style.Alignment.Vertical = ws.Cell("R6").Style.Font.FontName = "TH SarabunPSK";
// XLAlignmentVerticalValues.Center; ws.Cell("R6").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("S5:S6").Merge().Value = "รวม";
// ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell("S5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("S5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("S5:S6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("S5").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("S5").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("T4:T6").Merge().Value = "รวมเงินเดือนและส่วนควบ";
// ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("T4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("T4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Range("T4:T6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("T4").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("T4").Style.Font.SetBold().Font.FontSize = 16;
// ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Range("U4:U6").Merge().Value = "รวมเงินเดือนและส่วนควบ*12เดือน";
// ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell("U4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// ws.Cell("U4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// row++; 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";
// using (var stream1 = new MemoryStream()) ws.Cell("I7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// { ws.Cell("I7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// workbook.SaveAs(stream1); ws.Cell("I7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// var content = stream1.ToArray(); ws.Cell("I7").Style.Font.FontName = "TH SarabunPSK";
// string date = DateTime.Now.ToString("yyyyMMddHHmmss"); ws.Cell("I7").Style.Font.SetBold().Font.FontSize = 12;
// return File( ws.Cell("J7").Value = "-(2)";
// content, ws.Cell("J7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ws.Cell("J7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
// "personnel_" + date + ".xlsx"); 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, 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("#,#");
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.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.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.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("#,#");
}
}
}
}
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}")] [HttpPost, Route("reports/set_personnel_budget/{type}")]
[ApiExplorerSettings(GroupName = "reports")] [ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSetPersonBudgetReport([FromRoute] string type, public IActionResult GetSetPersonBudgetReport([FromRoute] string type,
@@ -672,7 +994,8 @@ namespace rmutr_report.Controllers
var workbook = new XLWorkbook(); var workbook = new XLWorkbook();
var ws = workbook.Worksheets.Add("6.1ค่าตอบแทนพนักงานราชการ"); var ws = workbook.Worksheets.Add("6.1ค่าตอบแทนพนักงานราชการ");
ws.Range("A1:S1").Merge().Value = "การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของพนักงานราชการ ปีงบประมาณ พ.ศ. "+personnel.academic_year_name_th; ws.Range("A1:S1").Merge().Value = "การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของพนักงานราชการ ปีงบประมาณ พ.ศ. " +
personnel.academic_year_name_th;
ws.Cell("A1").Style.Alignment.WrapText = true; ws.Cell("A1").Style.Alignment.WrapText = true;
ws.Range("A1:S1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A1:S1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A1:S1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("A1:S1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -1046,7 +1369,8 @@ namespace rmutr_report.Controllers
ws.Cell("F17").Style.Font.SetBold().Font.FontSize = 16; ws.Cell("F17").Style.Font.SetBold().Font.FontSize = 16;
ws.Cell("F17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("F17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell("F17").Style.Fill.BackgroundColor = XLColor.LightGreen; ws.Cell("F17").Style.Fill.BackgroundColor = XLColor.LightGreen;
ws.Range("G15:J15").Merge().Value = "งปม. " +personnel.year_table2 + "(จ่ายจริง "+ personnel.actually_paid_month +")"; ws.Range("G15:J15").Merge().Value = "งปม. " + personnel.year_table2 + "(จ่ายจริง " +
personnel.actually_paid_month + ")";
ws.Range("G15:J15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("G15:J15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("G15:J15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("G15:J15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("G15:J15").Style.Font.FontName = "TH SarabunPSK"; ws.Range("G15:J15").Style.Font.FontName = "TH SarabunPSK";
@@ -1238,8 +1562,10 @@ namespace rmutr_report.Controllers
row++; row++;
} }
if (detail.is_bold == false) if (detail.is_bold == false)
{ ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail.topic; {
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail.topic;
ws.Cell(row, 5).Value = detail.act_rate; ws.Cell(row, 5).Value = detail.act_rate;
ws.Cell(row, 6).Value = detail.act_budget; ws.Cell(row, 6).Value = detail.act_budget;
ws.Cell(row, 7).Value = detail.request_rate; ws.Cell(row, 7).Value = detail.request_rate;
@@ -1302,8 +1628,6 @@ namespace rmutr_report.Controllers
row++; row++;
} }
} }
} }

View File

@@ -1,47 +1,77 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace rmutr_report.Models.Personnel namespace rmutr_report.Models.Personnel
{ {
public class personnel_salary_permanent_root public class personnel_salary_permanent_root
{ {
public int? total_salary { get; set; } [Key]
public int? total_estimate_salary { get; set; } public Guid? personnel_salary_permanent_root_uid { get; set; }
public int? total_promote { get; set; } public Guid? log_report_uid { get; set; }
public string year { get; set; }
public string salary_text_1 { get; set; }
public string salary_text_2 { get; set; }
public string salary_text_3 { get; set; }
public int? salary { get; set; }
public int? estimate_promote_1 { get; set; }
public int? estimate_promote_2 { get; set; }
public int? estimate_promote_3 { get; set; }
public int? estimate_promote_4 { get; set; }
public int? salary_next_year_12 { get; set; }
public int? retiree { get; set; }
public int? salary_per_month { get; set; }
public int? salary_per_month_12 { get; set; }
public int? retirement_salary_per_year { get; set; }
public int? special_compensation { get; set; }
public int? special_compensation_12 { get; set; }
public int? full_salary { get; set; }
public int? special_compensation_1 { get; set; }
public int? special_compensation_2 { get; set; }
public int? special_compensation_3 { get; set; }
public string other { get; set; }
public string other_price { get; set; }
public int? total { get; set; } public int? total { get; set; }
public int? total_salary_12 { get; set; } public int? total_wages_and_fittings { get; set; }
public int? total_social_security { get; set; } public int? total_wages_and_fittings_12 { get; set; }
public int? total_social_security_12 { get; set; } public List<t_personnel_salary_permanent> personnel_salary_permanent { get; set; }
public int? total_social_compensation { get; set; }
public int? total_social_compensation_12 { get; set; }
public int? total_another2 { get; set; }
public int? total_quantity_money { get; set; }
public int? total2 { get; set; }
public int? including_salary_and_fittings { get; set; }
public int? including_salary_and_fittings_12 { get; set; }
public List<personnel_salary_permanent> personnel_salary_permanent { get; set; }
} }
public class personnel_salary_permanent public class t_personnel_salary_permanent
{ {
[Key]
public Guid? personnel_salary_permanent_uid { get; set; }
public Guid? personnel_salary_permanent_root_uid { get; set; }
public string agency_category_name { get; set; } public string agency_category_name { get; set; }
public int? total_estimate_salary { get; set; } public int? salary { get; set; }
public int? total_promote { get; set; } public int? estimate_promote_1 { get; set; }
public int? estimate_promote_2 { get; set; }
public int? estimate_promote_3 { get; set; }
public int? estimate_promote_4 { get; set; }
public int? salary_next_year_12 { get; set; }
public int? retiree { get; set; }
public int? salary_per_month { get; set; }
public int? salary_per_month_12 { get; set; }
public int? retirement_salary_per_year { get; set; }
public int? special_compensation { get; set; }
public int? special_compensation_12 { get; set; }
public int? full_salary { get; set; }
public int? special_compensation_1 { get; set; }
public int? special_compensation_2 { get; set; }
public int? special_compensation_3 { get; set; }
public string other { get; set; }
public string other_price { get; set; }
public int? total { get; set; } public int? total { get; set; }
public int? total_salary_12 { get; set; } public int? total_wages_and_fittings { get; set; }
public int? total_social_security { get; set; } public int? total_wages_and_fittings_12 { get; set; }
public int? total_social_security_12 { get; set; } public List<t_personnel_salary_permanent_deltail> personnel_salary_deltails { get; set; }
public int? total_social_compensation { get; set; }
public int? total_social_compensation_12 { get; set; }
public int? total_another2 { get; set; }
public int? total_quantity_money { get; set; }
public int? total2 { get; set; }
public int? including_salary_and_fittings { get; set; }
public int? including_salary_and_fittings_12 { get; set; }
public List<personnel_salary_deltail> personnel_salary_deltails { get; set; }
} }
public class personnel_salary_deltail public class t_personnel_salary_permanent_deltail
{ {
public bool? is_color { get; set; } //public bool? is_color { get; set; }
[Key]
public Guid? personnel_salary_permanent_detail_uid { get; set; }
public Guid? personnel_salary_permanent_uid { get; set; }
public string manpower { get; set; } public string manpower { get; set; }
public string full_name { get; set; } public string full_name { get; set; }
public string first_name_th { get; set; } public string first_name_th { get; set; }
@@ -50,18 +80,25 @@ namespace rmutr_report.Models.Personnel
public string parent_agency_name { get; set; } public string parent_agency_name { get; set; }
public string area { get; set; } public string area { get; set; }
public int? salary { get; set; } public int? salary { get; set; }
public int? estimate_salary { get; set; } public int? estimate_promote_1 { get; set; }
public int? promote { get; set; } public int? estimate_promote_2 { get; set; }
public int? estimate_promote_3 { get; set; }
public int? estimate_promote_4 { get; set; }
public int? salary_next_year_12 { get; set; }
public int? retiree { get; set; }
public int? salary_per_month { get; set; }
public int? salary_per_month_12 { get; set; }
public int? retirement_salary_per_year { get; set; }
public int? special_compensation { get; set; }
public int? special_compensation_12 { get; set; }
public int? full_salary { get; set; }
public int? special_compensation_1 { get; set; }
public int? special_compensation_2 { get; set; }
public int? special_compensation_3 { get; set; }
public string other { get; set; }
public string other_price { get; set; }
public int? total { get; set; } public int? total { get; set; }
public int? salary_12 { get; set; } public int? total_wages_and_fittings { get; set; }
public int? social_security { get; set; } public int? total_wages_and_fittings_12 { get; set; }
public int? social_security_12 { get; set; }
public int? social_compensation { get; set; }
public int? social_compensation_12 { get; set; }
public int? another2 { get; set; }
public int? quantity_money { get; set; }
public int? total2 { get; set; }
public int? including_salary_and_fittings { get; set; }
public int? including_salary_and_fittings_12 { get; set; }
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
16800008301171379 16801461433146553