diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index b74be1e..2a5e62a 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -245,13 +245,14 @@ namespace rmutr_report.Controllers return Ok(); } - [HttpPost, Route("reports/summary_building_table/{type}")] + + [HttpPost, Route("reports/summary_building_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumbuildingReport([FromRoute] string type, [FromBody] budget_summary_report budget_summary_reports) { var _budget_summary_report = new List() { budget_summary_reports }; - if (budget_summary_reports.building_1 != null) + if (budget_summary_reports.building_1 != null) { foreach (var bDetail in budget_summary_reports.building_1) { @@ -306,7 +307,8 @@ namespace rmutr_report.Controllers return Ok(); } - [HttpPost, Route("reports/summary_durable_articles_table/{type}")] + + [HttpPost, Route("reports/summary_durable_articles_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumDurableArticlesReport([FromRoute] string type, [FromBody] budget_summary_report budget_summary_reports) @@ -350,6 +352,7 @@ namespace rmutr_report.Controllers return Ok(); } + [HttpPost, Route("reports/summary_all_project_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumAllProjectReport([FromRoute] string type, @@ -1747,11 +1750,11 @@ namespace rmutr_report.Controllers public IActionResult GetBudgetReport([FromRoute] string type, [FromBody] budget_expenditure_from_revenue budget_expenditure_from_revenues) { - // var topic2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details - // .Where(i => i.topic_type == 2).ToList(); - // var topic3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details - // .Where(i => i.topic_type == 3).OrderBy(f=>f.couse_uid).ThenBy(m=>m.major_uid) - // .ThenBy(r=>r.row).ToList(); + // var topic2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details + // .Where(i => i.topic_type == 2).ToList(); + // var topic3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details + // .Where(i => i.topic_type == 3).OrderBy(f=>f.couse_uid).ThenBy(m=>m.major_uid) + // .ThenBy(r=>r.row).ToList(); // var sum_1 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details // .Where(h => h.topic_type == 2).Sum(j => // j.current_students); @@ -1867,8 +1870,8 @@ namespace rmutr_report.Controllers var sum12 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details .Where(h => h.topic_type == 1).Sum(j => j.education_fee_less_fee_total); - budget_expenditure_from_revenues.sum_12 = sum12; - + budget_expenditure_from_revenues.sum_12 = sum12; + // detail.current_students = topic3.Sum(d=>d.current_students); // // detail.students_reduced = topic3.Sum(d=>d.students_reduced); @@ -1900,30 +1903,30 @@ namespace rmutr_report.Controllers detail.topic_1 = detail.topic; detail.topic_2 = null; - // detail.current_students = topic2.Sum(d=>d.current_students); - // - // detail.students_reduced = topic2.Sum(d=>d.students_reduced); - // - // detail.students_estimates = topic2.Sum(d=>d.students_estimates); - // - // detail.price_regis_flat_payment = topic2.Sum(d=>d.price_regis_flat_payment); - // - // detail.library_total = topic2.Sum(d=>d.library_total); - // - // detail.utilities_total =topic2.Sum(d=>d.utilities_total); - // - // detail.student_club_library_total = topic2.Sum(d=>d.student_club_library_total); - // - // detail.accident_insurance_total = topic2.Sum(d=>d.accident_insurance_total); - // - // detail.academic_activities_total = topic2.Sum(d=>d.academic_activities_total); - // - // detail.examination_and_x_rays_total = topic2.Sum(d=>d.examination_and_x_rays_total); - // - // detail.tuition_fee_total = topic2.Sum(d=>d.tuition_fee_total); - // - // detail.education_fee_less_fee_total = topic2.Sum(d=>d.education_fee_less_fee_total); - } + // detail.current_students = topic2.Sum(d=>d.current_students); + // + // detail.students_reduced = topic2.Sum(d=>d.students_reduced); + // + // detail.students_estimates = topic2.Sum(d=>d.students_estimates); + // + // detail.price_regis_flat_payment = topic2.Sum(d=>d.price_regis_flat_payment); + // + // detail.library_total = topic2.Sum(d=>d.library_total); + // + // detail.utilities_total =topic2.Sum(d=>d.utilities_total); + // + // detail.student_club_library_total = topic2.Sum(d=>d.student_club_library_total); + // + // detail.accident_insurance_total = topic2.Sum(d=>d.accident_insurance_total); + // + // detail.academic_activities_total = topic2.Sum(d=>d.academic_activities_total); + // + // detail.examination_and_x_rays_total = topic2.Sum(d=>d.examination_and_x_rays_total); + // + // detail.tuition_fee_total = topic2.Sum(d=>d.tuition_fee_total); + // + // detail.education_fee_less_fee_total = topic2.Sum(d=>d.education_fee_less_fee_total); + } if (detail.topic_type == 3) { @@ -2466,6 +2469,7 @@ namespace rmutr_report.Controllers return Ok(); } + [HttpPost, Route("reports/budget_expenditure_report_from_revenue/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetExpenditureRevenueReport([FromRoute] string type, @@ -2476,7 +2480,7 @@ namespace rmutr_report.Controllers { bb.personnel_list_s = new List { bb.personnel_lists }; } - + var budgetExpenditure = new List() { budget }; Report report = new Report(); @@ -2508,5 +2512,248 @@ namespace rmutr_report.Controllers return Ok(); } + + [HttpPost, Route("reports/summary_government_budget_plan/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetSumGovernmentPlanReport([FromRoute] string type, + [FromBody] summary_government_budget_plan government_budget) + { + var budget1 = government_budget.data.Sum(h => h.personnel_government_budget); + var budget2 = government_budget.data.Sum(h => h.personnel_income_budget); + var budget3 = budget1 + budget2; + var budget4 = government_budget.data.Sum(h => h.operating_government_budget); + var budget5 = government_budget.data.Sum(h => h.operating_income_budget); + var budget6 = budget4 + budget5; + var budget7 = government_budget.data.Sum(h => h.investment_government_budget); + var budget8 = government_budget.data.Sum(h => h.investment_income_budget); + var budget9 = budget7 + budget8; + var budget10 = government_budget.data.Sum(h => h.subsidy_government_budget); + var budget11 = government_budget.data.Sum(h => h.subsidy_income_budget); + var budget12 = budget10 + budget11; + var budget13 = government_budget.data.Sum(h => h.expenses_government_budget); + var budget14 = government_budget.data.Sum(h => h.expenses_income_budget); + var budget15 = budget13 + budget14; + var budget16 = budget1 + budget4 + budget7 + budget10 + budget13; + var budget17 = budget2 + budget5 + budget8 + budget11 + budget14; + var budget18 = budget16 + budget17; + int row = 1; + int datarow = 1; + + foreach (var datas in government_budget.data) + { + datas.total_personnel_income_budget = datas.personnel_government_budget + datas.personnel_income_budget; + datas.total_operating_income_budget = datas.operating_government_budget + datas.operating_income_budget; + datas.total_investment_income_budget = + datas.investment_government_budget + datas.investment_income_budget; + datas.total_subsidy_income_budget = datas.subsidy_government_budget + datas.subsidy_income_budget; + datas.total_expenses_income_budget = datas.expenses_government_budget + datas.expenses_income_budget; + datas.government_budget = datas.personnel_government_budget + datas.operating_government_budget + + datas.investment_government_budget + + datas.subsidy_government_budget + datas.expenses_government_budget; + datas.government_income_budget = + datas.personnel_income_budget + datas.operating_income_budget + datas.investment_income_budget + + datas.subsidy_income_budget + datas.expenses_income_budget; + datas.total_government_income_budget = datas.government_budget + datas.government_income_budget; + government_budget.budget_1 = budget1; + government_budget.budget_2 = budget2; + government_budget.budget_3 = budget3; + government_budget.budget_4 = budget4; + government_budget.budget_5 = budget5; + government_budget.budget_6 = budget6; + government_budget.budget_7 = budget7; + government_budget.budget_8 = budget8; + government_budget.budget_9 = budget9; + government_budget.budget_10 = budget10; + government_budget.budget_11 = budget11; + government_budget.budget_12 = budget12; + government_budget.budget_13 = budget13; + government_budget.budget_14 = budget14; + government_budget.budget_15 = budget15; + government_budget.budget_16 = budget16; + government_budget.budget_17 = budget17; + government_budget.budget_18 = budget18; + if (datas.topic_type == 2) + { + datas.row_no = datarow.ToString(); + datarow++; + } + } + + foreach (var notation in government_budget.notations) + { + int subrow = 1; + notation.row_no = row.ToString(); + if (notation.row_no == "1") + { + notation.row_no = "หมายเหตุ : " + "1"; + } + + foreach (var notation2 in notation.notations_detail) + { + if (notation2.list != null && notation2.amount != null) + { + notation2.sub_row_no = row + "." + subrow; + subrow++; + notation2.free_text = "บาท"; + } + + if (notation2.list == null || notation2.list == "") + { + notation2.sub_row_no = null; + notation2.free_text = null; + } + } + + row++; + } + + var governmentbudget = new List() { government_budget }; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_government_budget_plan.frx"); + report.RegisterData(governmentbudget, "summary_government_budget_plan"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + case "doc": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "docx": + Word2007Export word1 = new Word2007Export(); + report.Export(word1, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "summary_government_budget_plan" + ".xlsx"); + } + + return Ok(); + } + + [HttpPost, Route("reports/budget_projects/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetBudgetProjectsReport([FromRoute] string type, + [FromBody] budget_projects budget) + { + foreach (var detail in budget.data) + { + int row = 1; + foreach (var dataDetail in detail.detail) + { + if (dataDetail.topic_type == 5) + { + dataDetail.row_no = row.ToString(); + row++; + } + else + { + dataDetail.row_no = null; + } + } + } + + var budgets = new List() { budget }; + + Report report = new Report(); + report.Load(_setting.report_path + "budget_projects.frx"); + report.RegisterData(budgets, "budget_projects"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "budget_project_" + date + ".xlsx"); + } + + return Ok(); + } + [HttpPost, Route("reports/total_budget/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetBudgetTotalReport([FromRoute] string type, + [FromBody] total_budget budget) + { + int row = 1; + foreach (var detail2 in budget.data) + { + var a = "- "; + if (detail2.topic_type == 2) + { + detail2.list = a + detail2.list; + } + + if (detail2.topic_type == 5) + { + detail2.row_no = row.ToString(); + row++; + } + else + { + detail2.row_no = null; + } + + } + var summaryBudget = new List() { budget }; + + Report report = new Report(); + report.Load(_setting.report_path + "total_budget.frx"); + report.RegisterData(summaryBudget, "total_budget"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "total_budget_" + date + ".xlsx"); + } + + return Ok(); + } } } \ No newline at end of file diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index e0bcc61..9dfebb2 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -2808,7 +2808,7 @@ namespace rmutr_report.Controllers { _personnel.year = "2566"; } - + ws.Range("A1:T1").Merge().Value = "รายละเอียดค่าจ้างและส่วนควบของลูกจ้างชั่วคราว ประจำปีงบประมาณ พ.ศ." + _personnel.year; ws.Cell("A1").Style.Alignment.WrapText = true; @@ -2834,99 +2834,99 @@ namespace rmutr_report.Controllers 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:I6").Merge().Value = "ค่าจ้าง 1 ต.ค. 65 - 30 ก.ย. 66"; ws.Cell("I4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("I4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("I4:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("I4").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("I4").Style.Font.SetBold().Font.FontSize = 16; - + ws.Range("J4:J6").Merge().Value = "ประมาณการเลื่อนขั้น 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; @@ -2939,7 +2939,7 @@ namespace rmutr_report.Controllers 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; @@ -3012,7 +3012,7 @@ namespace rmutr_report.Controllers 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; @@ -3035,69 +3035,70 @@ namespace rmutr_report.Controllers 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, 7).Value = detail.salary; - ws.Cell(row, 8).Value = detail.salary_12; - ws.Cell(row, 9).Value = detail.salary2; - 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.fund_contribution; - ws.Cell(row, 14).Value = detail.fund_contribution_12; - ws.Cell(row, 15).Value = detail.contribution; - ws.Cell(row, 16).Value = detail.contribution_12; - ws.Cell(row, 17).Value = detail.other; - ws.Cell(row, 18).Value = detail.other_price; - ws.Cell(row, 19).Value = detail.total2; - ws.Cell(row, 20).Value = detail.total_wage; - - 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.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontName = - "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row, 1).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Left; - ws.Range(ws.Cell(row, 7), ws.Cell(row, 20)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Right; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Fill.BackgroundColor = XLColor.FromArgb(255,230,153); - ws.Range(ws.Cell(row, 7), ws.Cell(row, 20)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - row++; + ws.Cell(row, 7).Value = detail.salary; + ws.Cell(row, 8).Value = detail.salary_12; + ws.Cell(row, 9).Value = detail.salary2; + 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.fund_contribution; + ws.Cell(row, 14).Value = detail.fund_contribution_12; + ws.Cell(row, 15).Value = detail.contribution; + ws.Cell(row, 16).Value = detail.contribution_12; + ws.Cell(row, 17).Value = detail.other; + ws.Cell(row, 18).Value = detail.other_price; + ws.Cell(row, 19).Value = detail.total2; + ws.Cell(row, 20).Value = detail.total_wage; + + 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.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row, 1).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 7), ws.Cell(row, 20)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Fill.BackgroundColor = + XLColor.FromArgb(255, 230, 153); + ws.Range(ws.Cell(row, 7), ws.Cell(row, 20)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + row++; foreach (var detail2 in detail.personnel_salary_temporary_deltail) { if (detail2.first_name_th != "รวม") @@ -3123,7 +3124,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 18).Value = detail2.other_price; ws.Cell(row, 19).Value = detail2.total2; ws.Cell(row, 20).Value = detail2.total_wage; - + 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; @@ -3144,8 +3145,8 @@ namespace rmutr_report.Controllers 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.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontSize = 16; @@ -3162,12 +3163,12 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 7), ws.Cell(row, 20)).Style.NumberFormat.SetFormat("#,#0"); row++; } - + if (detail2.first_name_th == "รวม") { ws.Range(ws.Cell(row, 1), ws.Cell(row, 3)).Merge().Value = "รวม"; - - ws.Cell(row, 7).Value = detail2.salary; + + ws.Cell(row, 7).Value = detail2.salary; ws.Cell(row, 8).Value = detail2.salary_12; ws.Cell(row, 9).Value = detail2.salary2; ws.Cell(row, 10).Value = detail2.salary2_12; @@ -3181,7 +3182,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 18).Value = detail2.other_price; ws.Cell(row, 19).Value = detail2.total2; ws.Cell(row, 20).Value = detail2.total_wage; - + 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; @@ -3202,8 +3203,8 @@ namespace rmutr_report.Controllers 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.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Style.Font.FontSize = 16; @@ -3222,8 +3223,8 @@ namespace rmutr_report.Controllers } } } - - + + using (var stream1 = new MemoryStream()) { workbook.SaveAs(stream1); @@ -8446,16 +8447,14 @@ namespace rmutr_report.Controllers ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; row++; - } + } - } foreach (var detail3 in personnel.set_personnel_budget_university_details_3) { - if (detail3.is_header == true) { - ws.Cell(row + 6, 1).Value = "หมายเหตุ : "; //+ detail2.remark; + ws.Cell(row + 6, 1).Value = "หมายเหตุ : "; //+ detail2.remark; ws.Cell(row + 6, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row + 6, 1).Style.Alignment.Vertical = @@ -8675,29 +8674,45 @@ namespace rmutr_report.Controllers if (detail3.topic_type == 1) { ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Merge().Value = detail3.topic; - ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Merge().Value = detail3.year_1_annual_spending_plan_all; - ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Merge().Value = detail3.year_1_annual_spending_plan_public_sector; - ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Merge().Value = detail3.year_1_annual_spending_plan_percent; - ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Merge().Value = detail3.year_2_annual_spending_plan_all; - ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Merge().Value= detail3.year_2_annual_spending_plan_public_sector; - ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Merge().Value = detail3.year_2_annual_spending_plan_percent; - ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Merge().Value= detail3.compare_proportions; + ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Merge().Value = + detail3.year_1_annual_spending_plan_all; + ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Merge().Value = + detail3.year_1_annual_spending_plan_public_sector; + ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Merge().Value = + detail3.year_1_annual_spending_plan_percent; + ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Merge().Value = + detail3.year_2_annual_spending_plan_all; + ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Merge().Value = + detail3.year_2_annual_spending_plan_public_sector; + ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Merge().Value = + detail3.year_2_annual_spending_plan_percent; + ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Merge().Value = + detail3.compare_proportions; ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Merge().Value = detail3.remark; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 1), ws.Cell(row, 19)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row, 19)).Style.Font.SetBold().Font.FontSize = 16; @@ -8717,32 +8732,49 @@ namespace rmutr_report.Controllers ws.Cell(row + 11, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; row++; } - if (detail3.topic_type == 2) + + if (detail3.topic_type == 2) { ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Merge().Value = "รวม"; - ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Merge().Value = detail3.year_1_annual_spending_plan_all; - ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Merge().Value = detail3.year_1_annual_spending_plan_public_sector; - ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Merge().Value = detail3.year_1_annual_spending_plan_percent; - ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Merge().Value = detail3.year_2_annual_spending_plan_all; - ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Merge().Value= detail3.year_2_annual_spending_plan_public_sector; - ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Merge().Value = detail3.year_2_annual_spending_plan_percent; - ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Merge().Value= detail3.compare_proportions; + ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Merge().Value = + detail3.year_1_annual_spending_plan_all; + ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Merge().Value = + detail3.year_1_annual_spending_plan_public_sector; + ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Merge().Value = + detail3.year_1_annual_spending_plan_percent; + ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Merge().Value = + detail3.year_2_annual_spending_plan_all; + ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Merge().Value = + detail3.year_2_annual_spending_plan_public_sector; + ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Merge().Value = + detail3.year_2_annual_spending_plan_percent; + ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Merge().Value = + detail3.compare_proportions; ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Merge().Value = detail3.remark; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range(ws.Cell(row + 11, 1), ws.Cell(row + 11, 4)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 5), ws.Cell(row + 11, 6)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 7), ws.Cell(row + 11, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 9), ws.Cell(row + 11, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 11), ws.Cell(row + 11, 12)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 13), ws.Cell(row + 11, 14)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 15), ws.Cell(row + 11, 16)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 17), ws.Cell(row + 11, 18)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 19), ws.Cell(row + 11, 24)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 11, 1), ws.Cell(row, 19)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row + 11, 1), ws.Cell(row, 19)).Style.Font.SetBold().Font.FontSize = 16; @@ -8760,16 +8792,17 @@ namespace rmutr_report.Controllers ws.Cell(row + 11, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 11, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell(row + 11, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - } - ws.Cell(row + 12, 1).Value = "หมายเหตุ : ตามหลักเกณฑ์ฯ การจัดสรรงบประมาณค่าใช้จ่ายบุคลากรขององค์การมหาชน ให้กำหนดกรอบวงเงินรวมสำหรับค่าใช้จ่ายบุคลากรไว้ไม่เกิน ร้อยละ 30 ของแผนการใช้จ่ายเงินประจำปี (ยกเว้น หน่วยงานที่มีมติ ครม. อนุมัติให้ตั้งเกินร้อยละ 30 ได้)"; - ws.Cell(row + 12, 1).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Left; - ws.Cell(row + 12, 1).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - //ws.Range(ws.Cell(row + 12, 1), ws.Cell(row + 12, 24)).Style.Alignment.WrapText = true; - ws.Cell(row + 12, 1).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row + 12, 1).Style.Font.FontSize = 16; + + ws.Cell(row + 12, 1).Value = + "หมายเหตุ : ตามหลักเกณฑ์ฯ การจัดสรรงบประมาณค่าใช้จ่ายบุคลากรขององค์การมหาชน ให้กำหนดกรอบวงเงินรวมสำหรับค่าใช้จ่ายบุคลากรไว้ไม่เกิน ร้อยละ 30 ของแผนการใช้จ่ายเงินประจำปี (ยกเว้น หน่วยงานที่มีมติ ครม. อนุมัติให้ตั้งเกินร้อยละ 30 ได้)"; + ws.Cell(row + 12, 1).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Cell(row + 12, 1).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + //ws.Range(ws.Cell(row + 12, 1), ws.Cell(row + 12, 24)).Style.Alignment.WrapText = true; + ws.Cell(row + 12, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 12, 1).Style.Font.FontSize = 16; } } @@ -8784,95 +8817,96 @@ namespace rmutr_report.Controllers "set_personnel_budget_university_" + date + ".xlsx"); } } - - [HttpPost, Route("reports/set_personnel_budget_permanent/{type}")] + + [HttpPost, Route("reports/set_personnel_budget_permanent/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSetPersonPermanentReport([FromRoute] string type, [FromBody] set_personnel_budget_permanent personnel) { var workbook = new XLWorkbook(); var ws = workbook.Worksheets.Add("4.ค่าจ้างประจำ"); - ws.Range("A1:S1").Merge().Value= "การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของลูกจ้างประจำ ปีงบประมาณ พ.ศ. " + personnel.academic_year_name_th; + ws.Range("A1:S1").Merge().Value = "การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของลูกจ้างประจำ ปีงบประมาณ พ.ศ. " + + personnel.academic_year_name_th; ws.Range("A1:S1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A1:S1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("A1:S1").Style.Font.FontName = "TH SarabunPSK"; - ws.Range("A1:S1").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("A2:S2").Merge().Value= "กรณี ลูกจ้างประจำเกษียณแล้วยุบ และจ้างพนักงานราชการทดแทน"; - ws.Range("A2:S2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A2:S2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A2:S2").Style.Font.FontName = "TH SarabunPSK"; - ws.Range("A2:S2").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("A3:S3").Merge().Value= "(กรณีเงินเลื่อนขั้นอยู่ในงบกลาง และมีการเลื่อนเงินเดือนปีละ 2 ครั้ง)"; - ws.Range("A3:S3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("A3:S3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("A3:S3").Style.Font.FontName = "TH SarabunPSK"; - ws.Range("A3:S3").Style.Font.SetBold().Font.FontSize = 16; - ws.Cell("A4").Value = "กระทรวง : "; - ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("A4").Style.Font.FontSize = 16; - ws.Cell("A4").Style.Font.Bold = true; - ws.Range("B4:F4").Merge().Value = personnel.ministry_name_th; - ws.Range("B4:F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range("B4:F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("B4").Style.Font.FontSize = 16; - ws.Range("B4:F4").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; - ws.Cell("A5").Value = "หน่วยงาน : "; - ws.Cell("A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell("A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("A5").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("A5").Style.Font.FontSize = 16; - ws.Cell("A5").Style.Font.Bold = true; + ws.Range("A1:S1").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A2:S2").Merge().Value = "กรณี ลูกจ้างประจำเกษียณแล้วยุบ และจ้างพนักงานราชการทดแทน"; + ws.Range("A2:S2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A2:S2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A2:S2").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A2:S2").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A3:S3").Merge().Value = "(กรณีเงินเลื่อนขั้นอยู่ในงบกลาง และมีการเลื่อนเงินเดือนปีละ 2 ครั้ง)"; + ws.Range("A3:S3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A3:S3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A3:S3").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A3:S3").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("A4").Value = "กระทรวง : "; + ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A4").Style.Font.FontSize = 16; + ws.Cell("A4").Style.Font.Bold = true; + ws.Range("B4:F4").Merge().Value = personnel.ministry_name_th; + ws.Range("B4:F4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range("B4:F4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B4").Style.Font.FontSize = 16; + ws.Range("B4:F4").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("A5").Value = "หน่วยงาน : "; + ws.Cell("A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A5").Style.Font.FontSize = 16; + ws.Cell("A5").Style.Font.Bold = true; - ws.Range("B5:F5").Merge().Value = personnel.agency_name_th; - ws.Range("B5:F5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range("B5:F5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("B5").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("B5").Style.Font.FontSize = 16; - ws.Range("B5:F5").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; - ws.Cell("A9").Value = "แบบคำนวณค่าจ้างประจำ"; - ws.Cell("A9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell("A9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("A9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("A9").Style.Font.FontSize = 16; - ws.Cell("A9").Style.Font.Bold = true; - ws.Cell("D9").Value = "จำนวนรวมทั้งสิ้น"; - ws.Cell("D9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell("D9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("D9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("D9").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("E9:F9").Merge().Value = personnel.calculate_regular_wages_rate; - ws.Range("E9:F9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range("E9:F9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("E9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("E9").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("E9:F9").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; - ws.Cell("G9").Value = "อัตรา"; - ws.Cell("G9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell("G9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("G9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("G9").Style.Font.FontSize = 16; - ws.Cell("G9").Style.Font.Bold = true; - ws.Cell("H9").Value = "งบประมาณ"; - ws.Cell("H9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Cell("H9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("H9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("H9").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("I9:J9").Merge().Value = personnel.calculate_regular_wages_budget; - ws.Range("I9:J9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range("I9:J9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("I9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("I9").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("I9:J9").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; - ws.Cell("K9").Value = "ล้านบาท (ไม่รวมส่วนควบ)"; - ws.Cell("K9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell("K9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell("K9").Style.Font.FontName = "TH SarabunPSK"; - ws.Cell("K9").Style.Font.FontSize = 16; - ws.Cell("K9").Style.Font.Bold = true; - ws.Cell("A10").Value = "พรบ.ปี 2564"; + ws.Range("B5:F5").Merge().Value = personnel.agency_name_th; + ws.Range("B5:F5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range("B5:F5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B5").Style.Font.FontSize = 16; + ws.Range("B5:F5").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("A9").Value = "แบบคำนวณค่าจ้างประจำ"; + ws.Cell("A9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A9").Style.Font.FontSize = 16; + ws.Cell("A9").Style.Font.Bold = true; + ws.Cell("D9").Value = "จำนวนรวมทั้งสิ้น"; + ws.Cell("D9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("D9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("E9:F9").Merge().Value = personnel.calculate_regular_wages_rate; + ws.Range("E9:F9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range("E9:F9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("E9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("E9:F9").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("G9").Value = "อัตรา"; + ws.Cell("G9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G9").Style.Font.FontSize = 16; + ws.Cell("G9").Style.Font.Bold = true; + ws.Cell("H9").Value = "งบประมาณ"; + ws.Cell("H9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("I9:J9").Merge().Value = personnel.calculate_regular_wages_budget; + ws.Range("I9:J9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range("I9:J9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("I9:J9").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("K9").Value = "ล้านบาท (ไม่รวมส่วนควบ)"; + ws.Cell("K9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("K9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K9").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K9").Style.Font.FontSize = 16; + ws.Cell("K9").Style.Font.Bold = true; + ws.Cell("A10").Value = "พรบ.ปี 2564"; ws.Cell("A10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("A10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A10").Style.Font.FontName = "TH SarabunPSK"; @@ -8965,7 +8999,7 @@ namespace rmutr_report.Controllers ws.Cell("N10").Style.Font.FontSize = 16; ws.Cell("N10").Style.Font.Bold = true; ws.Cell("N10").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; - ws.Cell("A11").Value = "พรบ.ปี 2565"; + ws.Cell("A11").Value = "พรบ.ปี 2565"; ws.Cell("A11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; ws.Cell("A11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A11").Style.Font.FontName = "TH SarabunPSK"; @@ -9101,7 +9135,7 @@ namespace rmutr_report.Controllers ws.Cell("G13").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("G13").Style.Font.FontSize = 16; ws.Column(1).Width = 30; - + ws.Column(5).Width = 15; ws.Column(6).Width = 15; ws.Column(7).Width = 15; @@ -9127,7 +9161,7 @@ namespace rmutr_report.Controllers ws.Range("A14:D16").Style.Font.SetBold().Font.FontSize = 14; ws.Range("A14:D16").Style.Fill.BackgroundColor = XLColor.FromArgb(252, 252, 214); ws.Range("A14:D16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range("E14:F14").Merge().Value = "งปม. 2565"; ws.Range("E14:F14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("E14:F14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; @@ -9135,14 +9169,14 @@ namespace rmutr_report.Controllers ws.Range("E14:F14").Style.Font.SetBold().Font.FontSize = 14; ws.Range("E14:F14").Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218); ws.Range("E14:F14").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range("E15:F15").Merge().Value = "พ.ร.บ."; - ws.Range("E15:F15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range("E15:F15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range("E15:F15").Style.Font.FontName = "TH SarabunPSK"; - ws.Range("E15:F15").Style.Font.SetBold().Font.FontSize = 14; - ws.Range("E15:F15").Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218); - ws.Range("E15:F15").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range("B7:C9").Merge().Value = "พ.ร.บ."; + ws.Range("B7:C9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("B7:C9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B7:C9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("B7:C9").Style.Font.SetBold().Font.FontSize = 14; + ws.Range("B7:C9").Style.Fill.BackgroundColor = XLColor.FromArgb(226, 239, 218); + ws.Range("B7:C9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E16").Value = "อัตรา"; ws.Cell("E16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell("E16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; @@ -9212,7 +9246,7 @@ namespace rmutr_report.Controllers ws.Cell("J16").Style.Alignment.WrapText = true; ws.Cell("J16").Style.Fill.BackgroundColor = XLColor.FromArgb(221, 235, 247); ws.Cell("J16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - + ws.Range("K14:P14").Merge().Value = "MTEF"; ws.Range("K14:P14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("K14:P14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; @@ -9241,7 +9275,7 @@ namespace rmutr_report.Controllers ws.Cell("L16").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("L16").Style.Font.SetBold().Font.FontSize = 14; ws.Cell("L16").Style.Alignment.WrapText = true; - ws.Cell("L16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); + ws.Cell("L16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); ws.Cell("L16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("M15:N15").Merge().Value = "2568"; ws.Range("M15:N15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -9264,7 +9298,7 @@ namespace rmutr_report.Controllers ws.Cell("N16").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("N16").Style.Font.SetBold().Font.FontSize = 14; ws.Cell("N16").Style.Alignment.WrapText = true; - ws.Cell("N16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); + ws.Cell("N16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); ws.Cell("N16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("O15:P15").Merge().Value = "2569"; ws.Range("O15:P15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -9287,7 +9321,7 @@ namespace rmutr_report.Controllers ws.Cell("P16").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("P16").Style.Font.SetBold().Font.FontSize = 14; ws.Cell("P16").Style.Alignment.WrapText = true; - ws.Cell("P16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); + ws.Cell("P16").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 230, 153); ws.Cell("P16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range("Q14:U16").Merge().Value = "คำชี้แจง"; ws.Range("Q14:U16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -9297,7 +9331,7 @@ namespace rmutr_report.Controllers ws.Range("Q14:U16").Style.Fill.BackgroundColor = XLColor.FromArgb(252, 228, 214); ws.Range("Q14:U16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; //ws.Range(ws.Cell(4, 2), ws.Cell(4, 6)).Style.Alignment.WrapText = true; - + foreach (var detail in personnel.set_personnel_budget_permanent_details) { @@ -9315,8 +9349,9 @@ namespace rmutr_report.Controllers //ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + 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; @@ -9329,7 +9364,8 @@ namespace rmutr_report.Controllers 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.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; row++; } @@ -9349,7 +9385,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 15).Value = detail.mtef_rate_year_3; ws.Cell(row, 16).Value = detail.mtef_budget_year_3; ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Value = detail.remark; - + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.SetBold().Font.FontSize = 14; @@ -9359,9 +9395,12 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 5), ws.Cell(row, 12)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -9375,7 +9414,8 @@ namespace rmutr_report.Controllers 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.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; row++; } @@ -9395,7 +9435,7 @@ namespace rmutr_report.Controllers ws.Cell(row, 15).Value = detail.mtef_rate_year_3; ws.Cell(row, 16).Value = detail.mtef_budget_year_3; ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Value = detail.remark; - + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 14; @@ -9405,9 +9445,12 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 5), ws.Cell(row, 12)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; - ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -9421,10 +9464,10 @@ namespace rmutr_report.Controllers 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.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; row++; } - } } @@ -9439,5 +9482,292 @@ namespace rmutr_report.Controllers "set_personnel_budget_permanent_" + date + ".xlsx"); } } + + [HttpPost, Route("reports/budget_proposal_details/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetPersonDetailReport([FromRoute] string type, + [FromBody] set_personnel_budget_permanent personnel) + { + var workbook = new XLWorkbook(); + var ws = workbook.Worksheets.Add("รายละเอียด"); + ws.Range("A1:AA1").Merge().Value = "รายละเอียดข้อเสนอวงเงินงบประมาณรายจ่ายประจำปีงบประมาณ พ.ศ. " + + personnel.academic_year_name_th; + ws.Range("A1:AA1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A1:AA1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A1:AA1").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A1:AA1").Style.Font.SetBold().Font.FontSize = 16; + + ws.Range("A2:AA2").Merge().Value = "(แผนงานบุคลากรภาครัฐ)"; + ws.Range("A2:AA2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A2:AA2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A2:AA2").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A2:AA2").Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell("A3").Value = "23000 กระทรวงการอุดมศึกษา วิทยาศาสตร์ วิจัยและนวัตกรรม"; + ws.Cell("A3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("A3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A3").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A3").Style.Font.FontSize = 16; + ws.Cell("A3").Style.Font.Bold = true; + ws.Cell("A4").Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; + ws.Cell("A4").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("A4").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A4").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A4").Style.Font.FontSize = 16; + ws.Cell("A4").Style.Font.Bold = true; + ws.Cell("A5").Value = + "ประเภทหน่วยงาน ..............(ส่วนราชการ/ส่วนราชการไม่สังกัดสำนักนายกรัฐมนตรี/รัฐวิสาหกิจ/องค์การมหาชน/หน่วยงานอิสระ/หน่วยงานศาล/หน่วยงานรัฐสภา/หน่วยงานอื่นของรัฐ)"; + ws.Cell("A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A5").Style.Font.FontSize = 16; + ws.Cell("A5").Style.Font.Bold = true; + ws.Cell("AA5").Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)"; + ws.Cell("AA5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("AA5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("AA5").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("AA5").Style.Font.FontSize = 16; + ws.Column(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 = 30; + + int row = 12; + //int no = 1; + if (personnel != null) + { + ws.Range("A6:A11").Merge().Value = "รายการ"; + ws.Range("A6:A11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A6:A11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A6:A11").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A6:A11").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A6:A11").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range("B6:E6").Merge().Value = "ปี 2564"; + ws.Range("B6:E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("B6:E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B6:E6").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("B6:E6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("B6:E6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("B7:C9").Merge().Value = "พ.ร.บ."; + ws.Range("B7:C9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("B7:C9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B7:C9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("B7:C9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("B7:C9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("D7:E9").Merge().Value = "ผลเบิกจ่าย (ณ 30 ก.ย)"; + ws.Range("D7:E9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("D7:E9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("D7:E9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("D7:E9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("D7:E9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range("F6:I6").Merge().Value = "ปี 2565"; + ws.Range("F6:I6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("F6:I6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("F6:I6").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("F6:I6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("F6:I6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("F7:G9").Merge().Value = "งบประมาณ (พ.ร.บ.)"; + ws.Range("F7:G9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("F7:G9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("F7:G9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("F7:G9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("F7:G9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("H7:I9").Merge().Value = "งบประมาณ(พ.ร.บ.) ปรับฐาน"; + ws.Range("H7:I9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("H7:I9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("H7:I9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("H7:I9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("H7:I9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("J6:W6").Merge().Value = "ปี 2566"; + ws.Range("J6:W6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("J6:W6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J6:W6").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("J6:W6").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("J6:W6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("J7:K9").Merge().Value = "คำขอ"; + ws.Range("J7:K9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("J7:K9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J7:K9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("J7:K9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("J7:K9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("L8:M9").Merge().Value = "บัญชี 1"; + ws.Range("L8:M9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("L8:M9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("L8:M9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("L8:M9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("L8:M9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("L7:S7").Merge().Value = "ข้อเสนอ"; + ws.Range("L7:S7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("L7:S7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("L7:S7").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("L7:S7").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("L7:S7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("N8:O8").Merge().Value = "เพิ่ม/ลด"; + ws.Range("N8:O8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("N8:O8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("N8:O8").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("N8:O8").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("N8:O8").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("P8:Q8").Merge().Value = "บัญชี 2"; + ws.Range("P8:Q8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("P8:Q8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("P8:Q8").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("P8:Q8").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("P8:Q8").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("R8:S8").Merge().Value = "รวมทั้งสิ้น"; + ws.Range("R8:S8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("R8:S8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("R8:S8").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("R8:S8").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("R8:S8").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("N9:O9").Merge().Value = "(เปรียบเทียบบัญชี 1 กับ งปม. ปี 65)"; + ws.Range("N9:O9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("N9:O9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("N9:O9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("N9:O9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("N9:O9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("P9:Q9").Merge().Value = "(อัตราใหม่)"; + ws.Range("P9:Q9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("P9:Q9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("P9:Q9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("P9:Q9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("P9:Q9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("R9:S9").Merge().Value = "(บัญชี 1 + บัญชี 2)"; + ws.Range("R9:S9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("R9:S9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("R9:S9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("R9:S9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("R9:S9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("T7:U9").Merge().Value = "เพิ่ม / (-ลด) จากปี 2565"; + ws.Range("T7:U9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("T7:U9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("T7:U9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("T7:U9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("T7:U9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("V7:W9").Merge().Value = "เพิ่ม / (-ลด) จากปี 2565"; + ws.Range("V7:W9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("V7:W9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("V7:W9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("V7:W9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("V7:W9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("X6:Z7").Merge().Value = "MTEF"; + ws.Range("X6:Z7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("X6:Z7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("X6:Z7").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("X6:Z7").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("X6:Z7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("X8:X9").Merge().Value = "ปี 2567"; + ws.Range("X8:X9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("X8:X9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("X8:X9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("X8:X9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("X8:X9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("Y8:Y9").Merge().Value = "ปี 2568"; + ws.Range("Y8:Y9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("Y8:Y9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Y8:Y9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("Y8:Y9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("Y8:Y9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("Z8:Z9").Merge().Value = "ปี 2569"; + ws.Range("Z8:Z9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("Z8:Z9").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Z8:Z9").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("Z8:Z9").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("Z8:Z9").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("AA6:AA11").Merge().Value = "คำชี้แจง"; + ws.Range("AA6:AA11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("AA6:AA11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("AA6:AA11").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("AA6:AA11").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("AA6:AA11").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("B10").Value = "(1)"; + ws.Cell("C10").Value = "(2)"; + ws.Cell("D10").Value = "(3)"; + ws.Cell("E10").Value = "(4)"; + ws.Cell("F10").Value = "(5)"; + ws.Cell("G10").Value = "(6)"; + ws.Cell("H10").Value = "(7)"; + ws.Cell("I10").Value = "(8)"; + ws.Cell("J10").Value = "(9)"; + ws.Cell("K10").Value = "(10)"; + ws.Cell("L10").Value = "(11)"; + ws.Cell("M10").Value = "(12)"; + ws.Cell("N10").Value = "(13) = (11)-(7)"; + ws.Cell("O10").Value = "(14) = (12)-(8)"; + ws.Cell("P10").Value = "(15)"; + ws.Cell("Q10").Value = "(16)"; + ws.Cell("R10").Value = "(17) = (11)+(15)"; + ws.Cell("S10").Value = "(18) = (12)+(16)"; + ws.Cell("T10").Value = "(19) = (17)-(7)"; + ws.Cell("U10").Value = "(20) =(19)/(7)*100"; + ws.Cell("V10").Value = "(21) = (18)-(8)"; + ws.Cell("W10").Value = "(22) =(21)/(8)*100"; + ws.Cell("X10").Value = "(23)"; + ws.Cell("Y10").Value = "(24)"; + ws.Cell("Z10").Value = "(25)"; + ws.Range("B10:Z10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("B10:Z10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B10:Z10").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("B10:Z10").Style.Font.SetBold().Font.FontSize = 14; + ws.Range("B10:Z10").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("B10:Z10").Style.Border.RightBorder = XLBorderStyleValues.Thin; + ws.Range("B10:Z10").Style.Border.LeftBorder = XLBorderStyleValues.Thin; + ws.Cell("B11").Value = "อัตรา"; + ws.Cell("C11").Value = "วงเงิน"; + ws.Cell("D11").Value = "อัตรา"; + ws.Cell("E11").Value = "วงเงิน"; + ws.Cell("F11").Value = "อัตรา"; + ws.Cell("G11").Value = "วงเงิน"; + ws.Cell("H11").Value = "อัตรา"; + ws.Cell("I11").Value = "วงเงิน"; + ws.Cell("J11").Value = "อัตรา"; + ws.Cell("K11").Value = "วงเงิน"; + ws.Cell("L11").Value = "อัตรา"; + ws.Cell("M11").Value = "วงเงิน"; + ws.Cell("N11").Value = "อัตรา"; + ws.Cell("O11").Value = "วงเงิน"; + ws.Cell("P11").Value = "อัตรา"; + ws.Cell("Q11").Value = "วงเงิน"; + ws.Cell("R11").Value = "อัตรา"; + ws.Cell("S11").Value = "วงเงิน"; + ws.Cell("T11").Value = "อัตรา"; + ws.Cell("U11").Value = "ร้อยละ"; + ws.Cell("V11").Value = "วงเงิน"; + ws.Cell("W11").Value = "ร้อยละ"; + ws.Cell("X11").Value = "วงเงิน"; + ws.Cell("Y11").Value = "วงเงิน"; + ws.Cell("Z11").Value = "วงเงิน"; + ws.Range("B11:Z11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("B11:Z11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("B11:Z11").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("B11:Z11").Style.Font.SetBold().Font.FontSize = 14; + ws.Range("B11:Z11").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("B11:Z11").Style.Border.RightBorder = XLBorderStyleValues.Thin; + ws.Range("B11:Z11").Style.Border.LeftBorder = XLBorderStyleValues.Thin; + ws.Range("B7:Z11").Style.Alignment.WrapText = true; + } + + 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", + "budget_proposal_details_" + date + ".xlsx"); + } + } } } \ No newline at end of file diff --git a/Models/budget/budget_projects.cs b/Models/budget/budget_projects.cs new file mode 100644 index 0000000..6bdb9b2 --- /dev/null +++ b/Models/budget/budget_projects.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class budget_projects + { + public string budget_year { get; set; } + public List data { get; set; } + + } + + public class budget_projects_detail + { + public string budget_plan { get; set; } + public List detail { get; set; } + } + + public class budget_projects_data_detail + { + public int? topic_type { get; set; } + public string row_no { get; set; } + public string project { get; set; } + public string project_style { get; set; } + public decimal? budget_amount { get; set; } + public string start_date { get; set; } + public string end_date { get; set; } + public string responsible_agency { get; set; } + public string responsible_person { get; set; } + + } +} \ No newline at end of file diff --git a/Models/budget/summary_government_budget_plan.cs b/Models/budget/summary_government_budget_plan.cs new file mode 100644 index 0000000..7bd8ed3 --- /dev/null +++ b/Models/budget/summary_government_budget_plan.cs @@ -0,0 +1,76 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class summary_government_budget_plan + { + public string budget_year { get; set; } + public List data { get; set; } + public List notations { get; set; } + public decimal? budget_1 { get; set; } + public decimal? budget_2 { get; set; } + public decimal? budget_3 { get; set; } + public decimal? budget_4 { get; set; } + public decimal? budget_5 { get; set; } + public decimal? budget_6 { get; set; } + public decimal? budget_7 { get; set; } + public decimal? budget_8 { get; set; } + public decimal? budget_9 { get; set; } + public decimal? budget_10 { get; set; } + public decimal? budget_11 { get; set; } + public decimal? budget_12 { get; set; } + public decimal? budget_13 { get; set; } + public decimal? budget_14 { get; set; } + public decimal? budget_15 { get; set; } + public decimal? budget_16 { get; set; } + public decimal? budget_17 { get; set; } + public decimal? budget_18 { get; set; } + } + + public class summary_government_budget_plan_detail + { + public int? topic_type { get; set; } + public string row_no { get; set; } + public string product { get; set; } + public decimal? personnel_government_budget { get; set; } + public decimal? personnel_income_budget { get; set; } + public decimal? total_personnel_income_budget { get; set; } + public decimal? operating_government_budget { get; set; } + public decimal? operating_income_budget { get; set; } + public decimal? total_operating_income_budget { get; set; } + public decimal? investment_government_budget { get; set; } + public decimal? investment_income_budget { get; set; } + public decimal? total_investment_income_budget { get; set; } + public decimal? subsidy_government_budget { get; set; } + public decimal? subsidy_income_budget { get; set; } + public decimal? total_subsidy_income_budget { get; set; } + public decimal? expenses_government_budget { get; set; } + public decimal? expenses_income_budget { get; set; } + public decimal? total_expenses_income_budget { get; set; } + public decimal? government_budget { get; set; } + public decimal? government_income_budget { get; set; } + public decimal? total_government_income_budget { get; set; } + } + + public class notation + { + public string row_no { get; set; } + public string list { get; set; } + public string date_range { get; set; } + public decimal? amount { get; set; } + public string free_text { get; set; } + public List notations_detail { get; set; } + + } + + public class notation2 + { + public string sub_row_no { get; set; } + public string list { get; set; } + public decimal? amount { get; set; } + public string free_text { get; set; } + + } + + +} \ No newline at end of file diff --git a/Models/budget/total_budget.cs b/Models/budget/total_budget.cs new file mode 100644 index 0000000..ca9f4e9 --- /dev/null +++ b/Models/budget/total_budget.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class total_budget + { + public decimal? government_budget { get; set; } + public decimal? income_budget { get; set; } + public List data { get; set; } + } + + public class total_budget_detail + { + public int? topic_type { get; set; } + public string row_no { get; set; } + public string budget_plan { get; set; } + public string budget_project { get; set; } + public string list { get; set; } + public decimal? budget_amount { get; set; } + public string start_date { get; set; } + public string end_date { get; set; } + public string responsible_agency { get; set; } + public string responsible_person { get; set; } + } +} \ No newline at end of file diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index ca4fb1b..1321340 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index ad89a64..5bdfb7f 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 21178a4..f3288b1 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e1adc8339732b993dc1452d09fe96dbe573c273d +e8c611bef91a50e36027e867bde92a40dbfb783c diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index ca4fb1b..1321340 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index ad89a64..5bdfb7f 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/wwwroot/reports/budget_projects.frx b/wwwroot/reports/budget_projects.frx new file mode 100644 index 0000000..44271d3 --- /dev/null +++ b/wwwroot/reports/budget_projects.frx @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/personnel_table_1.frx b/wwwroot/reports/personnel_table_1.frx index ae6fa42..0b36263 100644 --- a/wwwroot/reports/personnel_table_1.frx +++ b/wwwroot/reports/personnel_table_1.frx @@ -1,5 +1,5 @@  - + @@ -33,7 +33,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -67,12 +67,12 @@ - + - + @@ -81,7 +81,7 @@ - + @@ -94,23 +94,45 @@ - - - + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -136,51 +158,117 @@ + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/wwwroot/reports/summary_government_budget_plan.frx b/wwwroot/reports/summary_government_budget_plan.frx new file mode 100644 index 0000000..3148d98 --- /dev/null +++ b/wwwroot/reports/summary_government_budget_plan.frx @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/total_budget.frx b/wwwroot/reports/total_budget.frx new file mode 100644 index 0000000..721e468 --- /dev/null +++ b/wwwroot/reports/total_budget.frx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +