diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index c6ecbd5..3426dc8 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -161,7 +161,8 @@ namespace rmutr_report.Controllers report.Export(mht, stream); stream.Seek(0, SeekOrigin.Begin); return File(stream, "multipart/related"); - break;case "csv": + break; + case "csv": CSVExport csv = new CSVExport(); report.Export(csv, stream); stream.Seek(0, SeekOrigin.Begin); @@ -3679,7 +3680,7 @@ namespace rmutr_report.Controllers ws.Range("AS6:AS7").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell("AS6").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("AS6").Style.Font.SetBold().Font.FontSize = 16; - ws.Range("AS6:AS7").Style.Fill.BackgroundColor=XLColor.Orange; + ws.Range("AS6:AS7").Style.Fill.BackgroundColor = XLColor.Orange; ws.Range("AT6:AT7").Merge().Value = "ค่าตอบแทนรายเดือน (เทียบเท่าเงินประจำตำแหน่ง)"; ws.Cell("AT6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -3760,51 +3761,51 @@ namespace rmutr_report.Controllers if (_personnel != null) { ws.Range(ws.Cell(row, 3), ws.Cell(row, 5)).Merge().Value = "รวมทั้งสิ้น"; - //ws.Cell(row, 16).Value = _personnel.salary; - ws.Cell(row, 17).Value = _personnel.wages1; - ws.Cell(row, 18).Value = _personnel.wages2; - ws.Cell(row, 19).Value = _personnel.wages3; - ws.Cell(row, 20).Value = _personnel.wages4; - ws.Cell(row, 21).Value = _personnel.wages5; - ws.Cell(row, 22).Value = _personnel.total_wages; - ws.Cell(row, 23).Value = _personnel.promote; - ws.Cell(row, 24).Value = _personnel.total_salary; - ws.Cell(row, 25).Value = _personnel.welfare_benefit1; - ws.Cell(row, 26).Value = _personnel.welfare_benefit2; - ws.Cell(row, 27).Value = _personnel.welfare_benefit3; - ws.Cell(row, 28).Value = _personnel.welfare_benefit4; - ws.Cell(row, 29).Value = _personnel.welfare_benefit5; - ws.Cell(row, 30).Value = _personnel.total_welfare_benefit; - ws.Cell(row, 31).Value = _personnel.total_salary_welfare_benefit; - ws.Cell(row, 32).Value = _personnel.birth_date; - ws.Cell(row, 33).Value = _personnel.retiree; - ws.Cell(row, 34).Value = _personnel.salary_per_month; - ws.Cell(row, 35).Value = _personnel.position_money; - ws.Cell(row, 36).Value = _personnel.monthly_remuneration; - ws.Cell(row, 37).Value = _personnel.position_money_2; - ws.Cell(row, 38).Value = _personnel.monthly_remuneration_2; - ws.Cell(row, 39).Value = _personnel.compensation; - ws.Cell(row, 40).Value = _personnel.other; - ws.Cell(row, 41).Value = _personnel.other_price; - ws.Cell(row, 42).Value = _personnel.total; - ws.Cell(row, 43).Value = _personnel.position_money_3; - ws.Cell(row, 44).Value = _personnel.monthly_remuneration_3; - ws.Cell(row, 45).Value = _personnel.position_money_4; - ws.Cell(row, 46).Value = _personnel.monthly_remuneration_4; - ws.Cell(row, 47).Value = _personnel.total2; - ws.Cell(row, 48).Value = _personnel.total_wage; - // ws.Cell(row, 49).Value = _personnel.compensation_1; - // ws.Cell(row, 50).Value = _personnel.compensation_2; - // ws.Cell(row, 51).Value = _personnel.compensation_3; - // ws.Cell(row, 52).Value = _personnel.compensation_4; - // ws.Cell(row, 53).Value = _personnel.compensation_5; - // ws.Cell(row, 54).Value = _personnel.compensation_6; - // ws.Cell(row, 55).Value = _personnel.other; - // ws.Cell(row, 56).Value = _personnel.other_price; - // ws.Cell(row, 57).Value = _personnel.total_2; - // ws.Cell(row, 58).Value = _personnel.total_including_salary_and_fittings; - // ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings_12; - //ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings; + //ws.Cell(row, 16).Value = _personnel.salary; + ws.Cell(row, 17).Value = _personnel.wages1; + ws.Cell(row, 18).Value = _personnel.wages2; + ws.Cell(row, 19).Value = _personnel.wages3; + ws.Cell(row, 20).Value = _personnel.wages4; + ws.Cell(row, 21).Value = _personnel.wages5; + ws.Cell(row, 22).Value = _personnel.total_wages; + ws.Cell(row, 23).Value = _personnel.promote; + ws.Cell(row, 24).Value = _personnel.total_salary; + ws.Cell(row, 25).Value = _personnel.welfare_benefit1; + ws.Cell(row, 26).Value = _personnel.welfare_benefit2; + ws.Cell(row, 27).Value = _personnel.welfare_benefit3; + ws.Cell(row, 28).Value = _personnel.welfare_benefit4; + ws.Cell(row, 29).Value = _personnel.welfare_benefit5; + ws.Cell(row, 30).Value = _personnel.total_welfare_benefit; + ws.Cell(row, 31).Value = _personnel.total_salary_welfare_benefit; + ws.Cell(row, 32).Value = _personnel.birth_date; + ws.Cell(row, 33).Value = _personnel.retiree; + ws.Cell(row, 34).Value = _personnel.salary_per_month; + ws.Cell(row, 35).Value = _personnel.position_money; + ws.Cell(row, 36).Value = _personnel.monthly_remuneration; + ws.Cell(row, 37).Value = _personnel.position_money_2; + ws.Cell(row, 38).Value = _personnel.monthly_remuneration_2; + ws.Cell(row, 39).Value = _personnel.compensation; + ws.Cell(row, 40).Value = _personnel.other; + ws.Cell(row, 41).Value = _personnel.other_price; + ws.Cell(row, 42).Value = _personnel.total; + ws.Cell(row, 43).Value = _personnel.position_money_3; + ws.Cell(row, 44).Value = _personnel.monthly_remuneration_3; + ws.Cell(row, 45).Value = _personnel.position_money_4; + ws.Cell(row, 46).Value = _personnel.monthly_remuneration_4; + ws.Cell(row, 47).Value = _personnel.total2; + ws.Cell(row, 48).Value = _personnel.total_wage; + // ws.Cell(row, 49).Value = _personnel.compensation_1; + // ws.Cell(row, 50).Value = _personnel.compensation_2; + // ws.Cell(row, 51).Value = _personnel.compensation_3; + // ws.Cell(row, 52).Value = _personnel.compensation_4; + // ws.Cell(row, 53).Value = _personnel.compensation_5; + // ws.Cell(row, 54).Value = _personnel.compensation_6; + // ws.Cell(row, 55).Value = _personnel.other; + // ws.Cell(row, 56).Value = _personnel.other_price; + // ws.Cell(row, 57).Value = _personnel.total_2; + // ws.Cell(row, 58).Value = _personnel.total_including_salary_and_fittings; + // ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings_12; + //ws.Cell(row, 59).Value = _personnel.total_including_salary_and_fittings; //ws.Cell(row, 60).Value = _personnel.total_including_salary_and_fittings_12; ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; @@ -3826,42 +3827,42 @@ namespace rmutr_report.Controllers row++; foreach (var detail in _personnel.personnel_salary_university) { - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Merge().Value = detail.agency_category_name; - // ws.Cell(row, 1).Value = no; - // no++; - // ws.Cell(row, 2).Value = detail.manpower; - // ws.Cell(row, 3).Value = detail.first_name_th; - // ws.Cell(row, 4).Value = detail.last_name_th; - // ws.Cell(row, 5).Value = detail.parent_agency_name; - // ws.Cell(row, 6).Value = detail.area; - // ws.Cell(row, 7).Value = detail.position; - // ws.Cell(row, 8).Value = detail.salary; - // if (detail2.is_academic_line == true) - // { - // ws.Cell(row, 9).Value = "/"; - // } - // - // if (detail2.is_academic_line == false) - // { - // ws.Cell(row, 9).Value = ""; - // } - // - // if (detail2.is_support_line == true) - // { - // ws.Cell(row, 10).Value = "/"; - // } - // - // if (detail2.is_support_line == false) - // { - // ws.Cell(row, 10).Value = ""; - // } - // - // ws.Cell(row, 11).Value = detail.management_position_name; - // ws.Cell(row, 12).Value = detail.position_name; - // ws.Cell(row, 13).Value = detail.assign_no_plus_assign_effective_date; - // ws.Cell(row, 14).Value = detail.education_level; - // ws.Cell(row, 15).Value = detail.education_of_manpower; - // ws.Cell(row, 16).Value = detail.salary2; + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Merge().Value = detail.agency_category_name; + // ws.Cell(row, 1).Value = no; + // no++; + // ws.Cell(row, 2).Value = detail.manpower; + // ws.Cell(row, 3).Value = detail.first_name_th; + // ws.Cell(row, 4).Value = detail.last_name_th; + // ws.Cell(row, 5).Value = detail.parent_agency_name; + // ws.Cell(row, 6).Value = detail.area; + // ws.Cell(row, 7).Value = detail.position; + // ws.Cell(row, 8).Value = detail.salary; + // if (detail2.is_academic_line == true) + // { + // ws.Cell(row, 9).Value = "/"; + // } + // + // if (detail2.is_academic_line == false) + // { + // ws.Cell(row, 9).Value = ""; + // } + // + // if (detail2.is_support_line == true) + // { + // ws.Cell(row, 10).Value = "/"; + // } + // + // if (detail2.is_support_line == false) + // { + // ws.Cell(row, 10).Value = ""; + // } + // + // ws.Cell(row, 11).Value = detail.management_position_name; + // ws.Cell(row, 12).Value = detail.position_name; + // ws.Cell(row, 13).Value = detail.assign_no_plus_assign_effective_date; + // ws.Cell(row, 14).Value = detail.education_level; + // ws.Cell(row, 15).Value = detail.education_of_manpower; + // ws.Cell(row, 16).Value = detail.salary2; ws.Cell(row, 17).Value = detail.wages1; ws.Cell(row, 18).Value = detail.wages2; ws.Cell(row, 19).Value = detail.wages3; @@ -3911,7 +3912,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Fill.BackgroundColor = XLColor.LightYellow; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.LeftBorder = XLBorderStyleValues.Thin; @@ -3939,154 +3940,155 @@ namespace rmutr_report.Controllers CultureInfo culture = new CultureInfo("th-TH"); if (detail2.first_name_th != "รวมมีคนครองกับอัตราว่าง") { - ws.Cell(row, 1).Value = no; - no++; - ws.Cell(row, 2).Value = detail2.manpower; - ws.Cell(row, 3).Value = detail2.first_name_th; - ws.Cell(row, 4).Value = detail2.last_name_th; - ws.Cell(row, 5).Value = detail2.parent_agency_name; - ws.Cell(row, 6).Value = detail2.area; - ws.Cell(row, 7).Value = detail2.position; - ws.Cell(row, 8).Value = detail2.position_level; - if (detail2.is_academic_line == true) - { - ws.Cell(row, 9).Value = "/"; - } - - if (detail2.is_academic_line == false) - { - ws.Cell(row, 9).Value = ""; - } - - if (detail2.is_support_line == true) - { - ws.Cell(row, 10).Value = "/"; - } - - if (detail2.is_support_line == false) - { - ws.Cell(row, 10).Value = ""; - } - ws.Cell(row, 11).Value = detail2.management_position_name; - ws.Cell(row, 12).Value = detail2.position_name; - ws.Cell(row, 13).Value = detail2.assign_no_plus_assign_effective_date; - ws.Cell(row, 14).Value = detail2.education_level; - ws.Cell(row, 15).Value = detail2.education_of_manpower; - ws.Cell(row, 16).Value = detail2.salary; - ws.Cell(row, 17).Value = detail2.wages1; - ws.Cell(row, 18).Value = detail2.wages2; - ws.Cell(row, 19).Value = detail2.wages3; - ws.Cell(row, 20).Value = detail2.wages4; - ws.Cell(row, 21).Value = detail2.wages5; - ws.Cell(row, 22).Value = detail2.total_wages; - ws.Cell(row, 23).Value = detail2.promote; - ws.Cell(row, 24).Value = detail2.total_salary; - ws.Cell(row, 25).Value = detail2.welfare_benefit1; - ws.Cell(row, 26).Value = detail2.welfare_benefit2; - ws.Cell(row, 27).Value = detail2.welfare_benefit3; - ws.Cell(row, 28).Value = detail2.welfare_benefit4; - ws.Cell(row, 29).Value = detail2.welfare_benefit5; - ws.Cell(row, 30).Value = detail2.total_welfare_benefit; - ws.Cell(row, 31).Value = detail2.total_salary_welfare_benefit; - ws.Cell(row, 32).Value = detail2.birth_date; - ws.Cell(row, 33).Value = detail2.retiree; - ws.Cell(row, 34).Value = detail2.salary_per_month; - ws.Cell(row, 35).Value = detail2.position_money; - ws.Cell(row, 36).Value = detail2.monthly_remuneration; - ws.Cell(row, 37).Value = detail2.position_money_2; - ws.Cell(row, 38).Value = detail2.monthly_remuneration_2; - ws.Cell(row, 39).Value = detail2.compensation; - ws.Cell(row, 40).Value = detail2.other; - ws.Cell(row, 41).Value = detail2.other_price; - ws.Cell(row, 42).Value = detail2.total; - ws.Cell(row, 43).Value = detail2.position_money_3; - ws.Cell(row, 44).Value = detail2.monthly_remuneration_3; - ws.Cell(row, 45).Value = detail2.position_money_4; - ws.Cell(row, 46).Value = detail2.monthly_remuneration_4; - ws.Cell(row, 47).Value = detail2.total2; - ws.Cell(row, 48).Value = detail2.total_wage; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.LeftBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.RightBorder = - XLBorderStyleValues.Thin; - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.TopBorder = - // XLBorderStyleValues.Double; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Font.FontName = - "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Font.SetBold().Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row, 17), ws.Cell(row, 48)).Style.Alignment.Horizontal = - XLAlignmentHorizontalValues.Right; - ws.Range(ws.Cell(row, 17), ws.Cell(row, 31)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row, 33), ws.Cell(row, 39)).Style.NumberFormat.SetFormat("#,#"); - ws.Range(ws.Cell(row, 41), ws.Cell(row, 48)).Style.NumberFormat.SetFormat("#,#"); - // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 3), ws.Cell(row, 8)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Left; - // ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 11), ws.Cell(row, 14)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Left; - // ws.Cell(row, 15).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Center; - // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = - // XLAlignmentHorizontalValues.Right; - // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); - // ws.Cell(row, 21).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 27).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 29).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 31).Style.Fill.BackgroundColor = XLColor.LightYellow; - // ws.Cell(row, 36).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 38).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 40).Style.Fill.BackgroundColor = XLColor.LightYellow; - // ws.Cell(row, 42).Style.Fill.BackgroundColor = XLColor.LightBlue; - // ws.Cell(row, 45).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 48).Style.Fill.BackgroundColor = XLColor.LightGreen; - // ws.Cell(row, 59).Style.Fill.BackgroundColor = XLColor.LightGreen; - // - row++; + ws.Cell(row, 1).Value = no; + no++; + ws.Cell(row, 2).Value = detail2.manpower; + ws.Cell(row, 3).Value = detail2.first_name_th; + ws.Cell(row, 4).Value = detail2.last_name_th; + ws.Cell(row, 5).Value = detail2.parent_agency_name; + ws.Cell(row, 6).Value = detail2.area; + ws.Cell(row, 7).Value = detail2.position; + ws.Cell(row, 8).Value = detail2.position_level; + if (detail2.is_academic_line == true) + { + ws.Cell(row, 9).Value = "/"; + } + + if (detail2.is_academic_line == false) + { + ws.Cell(row, 9).Value = ""; + } + + if (detail2.is_support_line == true) + { + ws.Cell(row, 10).Value = "/"; + } + + if (detail2.is_support_line == false) + { + ws.Cell(row, 10).Value = ""; + } + + ws.Cell(row, 11).Value = detail2.management_position_name; + ws.Cell(row, 12).Value = detail2.position_name; + ws.Cell(row, 13).Value = detail2.assign_no_plus_assign_effective_date; + ws.Cell(row, 14).Value = detail2.education_level; + ws.Cell(row, 15).Value = detail2.education_of_manpower; + ws.Cell(row, 16).Value = detail2.salary; + ws.Cell(row, 17).Value = detail2.wages1; + ws.Cell(row, 18).Value = detail2.wages2; + ws.Cell(row, 19).Value = detail2.wages3; + ws.Cell(row, 20).Value = detail2.wages4; + ws.Cell(row, 21).Value = detail2.wages5; + ws.Cell(row, 22).Value = detail2.total_wages; + ws.Cell(row, 23).Value = detail2.promote; + ws.Cell(row, 24).Value = detail2.total_salary; + ws.Cell(row, 25).Value = detail2.welfare_benefit1; + ws.Cell(row, 26).Value = detail2.welfare_benefit2; + ws.Cell(row, 27).Value = detail2.welfare_benefit3; + ws.Cell(row, 28).Value = detail2.welfare_benefit4; + ws.Cell(row, 29).Value = detail2.welfare_benefit5; + ws.Cell(row, 30).Value = detail2.total_welfare_benefit; + ws.Cell(row, 31).Value = detail2.total_salary_welfare_benefit; + ws.Cell(row, 32).Value = detail2.birth_date; + ws.Cell(row, 33).Value = detail2.retiree; + ws.Cell(row, 34).Value = detail2.salary_per_month; + ws.Cell(row, 35).Value = detail2.position_money; + ws.Cell(row, 36).Value = detail2.monthly_remuneration; + ws.Cell(row, 37).Value = detail2.position_money_2; + ws.Cell(row, 38).Value = detail2.monthly_remuneration_2; + ws.Cell(row, 39).Value = detail2.compensation; + ws.Cell(row, 40).Value = detail2.other; + ws.Cell(row, 41).Value = detail2.other_price; + ws.Cell(row, 42).Value = detail2.total; + ws.Cell(row, 43).Value = detail2.position_money_3; + ws.Cell(row, 44).Value = detail2.monthly_remuneration_3; + ws.Cell(row, 45).Value = detail2.position_money_4; + ws.Cell(row, 46).Value = detail2.monthly_remuneration_4; + ws.Cell(row, 47).Value = detail2.total2; + ws.Cell(row, 48).Value = detail2.total_wage; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.LeftBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.RightBorder = + XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.TopBorder = + // XLBorderStyleValues.Double; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 48)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Right; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 31)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 33), ws.Cell(row, 39)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 41), ws.Cell(row, 48)).Style.NumberFormat.SetFormat("#,#"); + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 8)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 9), ws.Cell(row, 10)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 11), ws.Cell(row, 14)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 15).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.Alignment.Horizontal = + // XLAlignmentHorizontalValues.Right; + // ws.Range(ws.Cell(row, 16), ws.Cell(row, 59)).Style.NumberFormat.SetFormat("#,#"); + // ws.Cell(row, 21).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 27).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 29).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 31).Style.Fill.BackgroundColor = XLColor.LightYellow; + // ws.Cell(row, 36).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 38).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 40).Style.Fill.BackgroundColor = XLColor.LightYellow; + // ws.Cell(row, 42).Style.Fill.BackgroundColor = XLColor.LightBlue; + // ws.Cell(row, 45).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 48).Style.Fill.BackgroundColor = XLColor.LightGreen; + // ws.Cell(row, 59).Style.Fill.BackgroundColor = XLColor.LightGreen; + // + row++; } if (detail2.first_name_th == "รวมมีคนครองกับอัตราว่าง") { ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Merge().Value = detail2.first_name_th; ws.Cell(row, 17).Value = detail2.wages1; - ws.Cell(row, 18).Value = detail2.wages2; - ws.Cell(row, 19).Value = detail2.wages3; - ws.Cell(row, 20).Value = detail2.wages4; - ws.Cell(row, 21).Value = detail2.wages5; - ws.Cell(row, 22).Value = detail2.total_wages; - ws.Cell(row, 23).Value = detail2.promote; - ws.Cell(row, 24).Value = detail2.total_salary; - ws.Cell(row, 25).Value = detail2.welfare_benefit1; - ws.Cell(row, 26).Value = detail2.welfare_benefit2; - ws.Cell(row, 27).Value = detail2.welfare_benefit3; - ws.Cell(row, 28).Value = detail2.welfare_benefit4; - ws.Cell(row, 29).Value = detail2.welfare_benefit5; - ws.Cell(row, 30).Value = detail2.total_welfare_benefit; - ws.Cell(row, 31).Value = detail2.total_salary_welfare_benefit; - ws.Cell(row, 32).Value = detail2.birth_date; - ws.Cell(row, 33).Value = detail2.retiree; - ws.Cell(row, 34).Value = detail2.salary_per_month; - ws.Cell(row, 35).Value = detail2.position_money; - ws.Cell(row, 36).Value = detail2.monthly_remuneration; - ws.Cell(row, 37).Value = detail2.position_money_2; - ws.Cell(row, 38).Value = detail2.monthly_remuneration_2; - ws.Cell(row, 39).Value = detail2.compensation; - ws.Cell(row, 40).Value = detail2.other; - ws.Cell(row, 41).Value = detail2.other_price; - ws.Cell(row, 42).Value = detail2.total; - ws.Cell(row, 43).Value = detail2.position_money_3; - ws.Cell(row, 44).Value = detail2.monthly_remuneration_3; - ws.Cell(row, 45).Value = detail2.position_money_4; - ws.Cell(row, 46).Value = detail2.monthly_remuneration_4; - ws.Cell(row, 47).Value = detail2.total2; - ws.Cell(row, 48).Value = detail2.total_wage; + ws.Cell(row, 18).Value = detail2.wages2; + ws.Cell(row, 19).Value = detail2.wages3; + ws.Cell(row, 20).Value = detail2.wages4; + ws.Cell(row, 21).Value = detail2.wages5; + ws.Cell(row, 22).Value = detail2.total_wages; + ws.Cell(row, 23).Value = detail2.promote; + ws.Cell(row, 24).Value = detail2.total_salary; + ws.Cell(row, 25).Value = detail2.welfare_benefit1; + ws.Cell(row, 26).Value = detail2.welfare_benefit2; + ws.Cell(row, 27).Value = detail2.welfare_benefit3; + ws.Cell(row, 28).Value = detail2.welfare_benefit4; + ws.Cell(row, 29).Value = detail2.welfare_benefit5; + ws.Cell(row, 30).Value = detail2.total_welfare_benefit; + ws.Cell(row, 31).Value = detail2.total_salary_welfare_benefit; + ws.Cell(row, 32).Value = detail2.birth_date; + ws.Cell(row, 33).Value = detail2.retiree; + ws.Cell(row, 34).Value = detail2.salary_per_month; + ws.Cell(row, 35).Value = detail2.position_money; + ws.Cell(row, 36).Value = detail2.monthly_remuneration; + ws.Cell(row, 37).Value = detail2.position_money_2; + ws.Cell(row, 38).Value = detail2.monthly_remuneration_2; + ws.Cell(row, 39).Value = detail2.compensation; + ws.Cell(row, 40).Value = detail2.other; + ws.Cell(row, 41).Value = detail2.other_price; + ws.Cell(row, 42).Value = detail2.total; + ws.Cell(row, 43).Value = detail2.position_money_3; + ws.Cell(row, 44).Value = detail2.monthly_remuneration_3; + ws.Cell(row, 45).Value = detail2.position_money_4; + ws.Cell(row, 46).Value = detail2.monthly_remuneration_4; + ws.Cell(row, 47).Value = detail2.total2; + ws.Cell(row, 48).Value = detail2.total_wage; ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Range(ws.Cell(row, 1), ws.Cell(row, 48)).Style.Border.LeftBorder = @@ -4802,5 +4804,1308 @@ namespace rmutr_report.Controllers "personnel_" + date + ".xlsx"); } } + + [HttpPost, Route("reports/personnel_expense_budget/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetSetPersonExBudgetReport([FromRoute] string type, + [FromBody] personnel_expense_budget personnel) + { + var workbook = new XLWorkbook(); + var ws = workbook.Worksheets.Add("1.เงินเดือน เลื่อนในงบกลาง"); + + ws.Range("A1:U1").Merge().Value = "ข้อมูลการตั้งงบประมาณค่าใช้จ่ายบุคลากร ปีงบประมาณ พ.ศ. " + + personnel.academic_year_name_th; + ws.Cell("A1").Style.Alignment.WrapText = true; + ws.Range("A2:U2").Merge().Value = "สำหรับส่วนราชการทั่วไป , มหาวิทยาลัย (เฉพาะข้าราชการ)"; + ws.Range("A3:U3").Merge().Value = "(กรณีเงินเลื่อนขั้นอยู่ในงบกลาง และมีการเลื่อนเงินเดือนปีละ 2 ครั้ง)"; + ws.Range("A1:U3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A1:U3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A1:U3").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A1:U3").Style.Font.FontSize = 16; + ws.Range("A1:U3").Style.Font.Bold = true; + 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("A7").Value = "กรอบอัตรากำลัง"; + ws.Cell("A7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("A7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A7").Style.Font.FontSize = 16; + ws.Cell("A7").Style.Font.Bold = true; + ws.Cell("A7").Style.Font.FontColor = XLColor.Red; + ws.Cell("A7").Style.Font.Underline = XLFontUnderlineValues.Single; + + ws.Cell("B7").Value = "จำนวน"; + ws.Cell("B7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("B7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B7").Style.Font.FontSize = 16; + ws.Cell("B7").Style.Font.Bold = true; + ws.Cell("B7").Style.Font.FontColor = XLColor.Red; + + ws.Cell("C7").Value = personnel.rate_frame_total; + ws.Cell("C7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("C7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("C7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("C7").Style.Font.FontSize = 16; + ws.Cell("C7").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("C7").Style.Font.FontColor = XLColor.Red; + + ws.Cell("D7").Value = "อัตรา"; + ws.Cell("D7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("D7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D7").Style.Font.FontSize = 16; + ws.Cell("D7").Style.Font.Bold = true; + ws.Cell("D7").Style.Font.FontColor = XLColor.Red; + + ws.Cell("E7").Value = "ประกอบด้วย"; + ws.Cell("E7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("E7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("E7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E7").Style.Font.FontSize = 16; + ws.Cell("E7").Style.Font.Bold = true; + ws.Cell("E7").Style.Font.FontColor = XLColor.Red; + + ws.Range("F7:G7").Merge().Value = "(1) อัตราที่มีคนครอง"; + ws.Range("F7:G7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("F7:G7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("F7:G7").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("F7:G7").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("F7:G7").Style.Font.FontColor = XLColor.Red; + //ws.Range("F7:G7").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("H7").Value = personnel.rate_frame_owner; + ws.Cell("H7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H7").Style.Font.FontSize = 16; + ws.Cell("H7").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("H7").Style.Font.FontColor = XLColor.Red; + + ws.Cell("I7").Value = "อัตรา"; + ws.Cell("I7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("I7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I7").Style.Font.FontSize = 16; + ws.Cell("I7").Style.Font.Bold = true; + ws.Cell("I7").Style.Font.FontColor = XLColor.Red; + + ws.Range("J7:K7").Merge().Value = "(2) อัตราว่างมีเงิน"; + ws.Range("J7:K7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("J7:K7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("J7:K7").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("J7:K7").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("J7:K7").Style.Font.FontColor = XLColor.Red; + ws.Cell("L7").Value = personnel.rate_frame_free; + ws.Cell("L7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("L7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L7").Style.Font.FontSize = 16; + ws.Cell("L7").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("L7").Style.Font.FontColor = XLColor.Red; + ws.Cell("M7").Value = "อัตรา"; + ws.Cell("M7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("M7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M7").Style.Font.FontSize = 16; + ws.Cell("M7").Style.Font.Bold = true; + ws.Cell("M7").Style.Font.FontColor = XLColor.Red; + + ws.Range("N7:O7").Merge().Value = "(3) อัตราว่างไม่มีเงิน"; + ws.Range("N7:O7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("N7:O7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("N7:O7").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("N7:O7").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("N7:O7").Style.Font.FontColor = XLColor.Red; + ws.Cell("P7").Value = personnel.rate_frame_not_free; + ws.Cell("P7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("P7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("P7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("P7").Style.Font.FontSize = 16; + ws.Cell("P7").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("P7").Style.Font.FontColor = XLColor.Red; + ws.Cell("Q7").Value = "อัตรา"; + ws.Cell("Q7").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("Q7").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("Q7").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("Q7").Style.Font.FontSize = 16; + ws.Cell("Q7").Style.Font.Bold = true; + ws.Cell("Q7").Style.Font.FontColor = XLColor.Red; + + ws.Cell("A8").Value = "สรุป เสนอตั้งงบประมาณ"; + ws.Cell("A8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("A8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A8").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A8").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("A8").Style.Font.Underline = XLFontUnderlineValues.Single; + + ws.Cell("D8").Value = "จำนวน"; + ws.Cell("D8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("D8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D8").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D8").Style.Font.FontSize = 16; + ws.Cell("D8").Style.Font.Bold = true; + + ws.Range("E8:F8").Merge().Value = personnel.budget_proposal_summary; + ws.Range("E8:F8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("E8:F8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E8:F8").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("E8:F8").Style.Font.FontSize = 16; + ws.Range("E8:F8").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("G8").Value = "อัตรา"; + ws.Cell("G8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G8").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G8").Style.Font.FontSize = 16; + ws.Cell("G8").Style.Font.Bold = true; + + ws.Cell("H8").Value = "งบประมาณ"; + ws.Cell("H8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H8").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H8").Style.Font.FontSize = 16; + ws.Cell("H8").Style.Font.Bold = true; + + ws.Range("I8:J8").Merge().Value = personnel.budget_summary; + ws.Range("I8:J8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("I8:J8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I8:J8").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("I8:J8").Style.Font.FontSize = 16; + ws.Range("I8:J8").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("K8").Value = "ล้านบาท (รวมส่วนควบและค่าใช้จ่ายตามสิทธิ)"; + ws.Cell("K8").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("K8").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K8").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K8").Style.Font.FontSize = 16; + ws.Cell("K8").Style.Font.Bold = true; + + ws.Cell("A9").Value = "ประกอบด้วย"; + ws.Cell("A9").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + 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 = false; + + ws.Cell("A10").Value = "แบบคำนวณเงินเดือน"; + ws.Cell("A10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("A10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A10").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A10").Style.Font.FontSize = 16; + ws.Cell("A10").Style.Font.Bold = true; + ws.Cell("D10").Value = "จำนวนรวมทั้งสิ้น"; + ws.Cell("D10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("D10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D10").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D10").Style.Font.FontSize = 16; + ws.Cell("D10").Style.Font.Bold = true; + ws.Range("E10:F10").Merge().Value = personnel.salary_calculation; + ws.Range("E10:F10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("E10:F10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E10:F10").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("E10:F10").Style.Font.FontSize = 16; + ws.Range("E10:F10").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("G10").Value = "อัตรา"; + ws.Cell("G10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G10").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G10").Style.Font.FontSize = 16; + ws.Cell("G10").Style.Font.Bold = true; + ws.Cell("H10").Value = "งบประมาณ"; + ws.Cell("H10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H10").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H10").Style.Font.FontSize = 16; + ws.Cell("H10").Style.Font.Bold = true; + + ws.Range("I10:J10").Merge().Value = personnel.salary_calculation_budget; + ws.Range("I10:J10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Range("I10:J10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I10:J10").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("I10:J10").Style.Font.FontSize = 16; + ws.Range("I10:J10").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("K10").Value = "ล้านบาท (ไม่รวมส่วนควบ)"; + ws.Cell("K10").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("K10").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K10").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K10").Style.Font.FontSize = 16; + ws.Cell("K10").Style.Font.Bold = true; + + + ws.Cell("A11").Value = "พรบ.ปี 2564"; + ws.Cell("A11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A11").Style.Font.FontSize = 16; + ws.Cell("A11").Style.Font.Bold = true; + + ws.Cell("B11").Value = personnel.act_1; + ws.Cell("B11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("B11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B11").Style.Font.FontSize = 16; + ws.Cell("B11").Style.Font.Bold = true; + ws.Cell("B11").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + + ws.Cell("C11").Value = "ลบ."; + ws.Cell("C11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("C11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("C11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("C11").Style.Font.FontSize = 16; + ws.Cell("C11").Style.Font.Bold = true; + + ws.Cell("D11").Value = "(1) เบิกจ่ายปี งปม.64"; + ws.Cell("D11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("D11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D11").Style.Font.FontSize = 16; + ws.Cell("D11").Style.Font.Bold = true; + + ws.Cell("F11").Value = personnel.act_1_disbursement_year; + ws.Cell("F11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("F11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F11").Style.Font.FontSize = 16; + ws.Cell("F11").Style.Font.Bold = true; + ws.Cell("F11").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("G11").Value = "ลบ."; + ws.Cell("G11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G11").Style.Font.FontSize = 16; + ws.Cell("G11").Style.Font.Bold = true; + + ws.Cell("H11").Value = "คิดเป็นร้อยละ"; + ws.Cell("H11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H11").Style.Font.FontSize = 16; + ws.Cell("H11").Style.Font.Bold = true; + + ws.Cell("I11").Value = personnel.act_1_disbursement_year_percentage; + ws.Cell("I11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("I11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I11").Style.Font.FontSize = 16; + ws.Cell("I11").Style.Font.Bold = true; + ws.Cell("I11").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("J11").Value = "คงเหลือ"; + ws.Cell("J11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("J11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("J11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J11").Style.Font.FontSize = 16; + ws.Cell("J11").Style.Font.Bold = true; + ws.Cell("K11").Value = personnel.act_1_remaining; + ws.Cell("K11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("K11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K11").Style.Font.FontSize = 16; + ws.Cell("K11").Style.Font.Bold = true; + ws.Cell("K11").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("L11").Value = "ลบ."; + ws.Cell("L11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("L11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L11").Style.Font.FontSize = 16; + ws.Cell("L11").Style.Font.Bold = true; + + ws.Cell("M11").Value = "คิดเป็นร้อยละ"; + ws.Cell("M11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("M11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M11").Style.Font.FontSize = 16; + ws.Cell("M11").Style.Font.Bold = true; + ws.Cell("N11").Value = personnel.act_1_remaining_percentage; + ws.Cell("N11").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("N11").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N11").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N11").Style.Font.FontSize = 16; + ws.Cell("N11").Style.Font.Bold = true; + ws.Cell("N11").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("D12").Value = "(2) ใช้เงินเลื่อนขั้น (งบกลาง)"; + ws.Cell("D12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("D12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D12").Style.Font.FontSize = 16; + ws.Cell("D12").Style.Font.Bold = true; + ws.Cell("F12").Value = personnel.money_to_advance; + ws.Cell("F12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("F12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F12").Style.Font.FontSize = 16; + ws.Cell("F12").Style.Font.Bold = true; + ws.Cell("F12").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("G12").Value = "ลบ."; + ws.Cell("G12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G12").Style.Font.FontSize = 16; + ws.Cell("G12").Style.Font.Bold = true; + + ws.Cell("H12").Value = "คิดเป็นร้อยละ"; + ws.Cell("H12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("H12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H12").Style.Font.FontSize = 16; + ws.Cell("H12").Style.Font.Bold = true; + ws.Cell("I12").Value = personnel.money_to_advance_percentage; + ws.Cell("I12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("I12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I12").Style.Font.FontSize = 16; + ws.Cell("I12").Style.Font.Bold = true; + ws.Cell("I12").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + ws.Cell("J12").Value = "ของ พรบ. ปี 2565"; + ws.Cell("J12").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("J12").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("J12").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J12").Style.Font.FontSize = 16; + ws.Cell("J12").Style.Font.Bold = true; + + + ws.Cell("A13").Value = "พรบ.ปี 2565"; + ws.Cell("A13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A13").Style.Font.FontSize = 16; + ws.Cell("A13").Style.Font.Bold = true; + + ws.Cell("B13").Value = personnel.act_2; + ws.Cell("B13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("B13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B13").Style.Font.FontSize = 16; + ws.Cell("B13").Style.Font.Bold = true; + ws.Cell("B13").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("C13").Value = "ลบ."; + ws.Cell("C13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("C13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("C13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("C13").Style.Font.FontSize = 16; + ws.Cell("C13").Style.Font.Bold = true; + ws.Cell("D13").Value = "จ่ายจริง ต.ค.64 - พ.ย.64"; + ws.Cell("D13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("D13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D13").Style.Font.FontSize = 16; + ws.Cell("D13").Style.Font.Bold = true; + ws.Cell("F13").Value = personnel.act_2_actually_aid; + ws.Cell("F13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("F13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F13").Style.Font.FontSize = 16; + ws.Cell("F13").Style.Font.Bold = true; + ws.Cell("F13").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("G13").Value = "ลบ."; + ws.Cell("G13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G13").Style.Font.FontSize = 16; + ws.Cell("G13").Style.Font.Bold = true; + ws.Cell("H13").Value = "คิดเป็นร้อยละ"; + ws.Cell("H13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("H13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H13").Style.Font.FontSize = 16; + ws.Cell("H13").Style.Font.Bold = true; + + ws.Cell("I13").Value = personnel.act_2_actually_aid_percentage; + ws.Cell("I13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("I13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I13").Style.Font.FontSize = 16; + ws.Cell("I13").Style.Font.Bold = true; + ws.Cell("I13").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("J13").Value = "คงเหลือ"; + ws.Cell("J13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("J13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("J13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J13").Style.Font.FontSize = 16; + ws.Cell("J13").Style.Font.Bold = true; + ws.Cell("K13").Value = personnel.act_2_remaining; + ws.Cell("K13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("K13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K13").Style.Font.FontSize = 16; + ws.Cell("K13").Style.Font.Bold = true; + ws.Cell("K13").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("L13").Value = "ลบ."; + ws.Cell("L13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("L13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L13").Style.Font.FontSize = 16; + ws.Cell("L13").Style.Font.Bold = true; + ws.Cell("M13").Value = "คิดเป็นร้อยละ"; + ws.Cell("M13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("M13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M13").Style.Font.FontSize = 16; + ws.Cell("M13").Style.Font.Bold = true; + ws.Cell("N13").Value = personnel.act_2_remaining_percentage; + ws.Cell("N13").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("N13").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N13").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N13").Style.Font.FontSize = 16; + ws.Cell("N13").Style.Font.Bold = true; + ws.Cell("N13").Style.Border.BottomBorder = XLBorderStyleValues.Dotted; + + ws.Cell("A14").Value = "(ไม่รวมส่วนควบ)"; + ws.Cell("A14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("A14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A14").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A14").Style.Font.FontSize = 16; + + ws.Cell("D14").Value = "(ไม่รวมส่วนควบ)"; + ws.Cell("D14").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("D14").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("D14").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("D14").Style.Font.FontSize = 16; + ws.Cell("A15").Value = "เฉลี่ยต่อเดือน"; + ws.Cell("A15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("A15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("A15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("A15").Style.Font.FontSize = 16; + ws.Cell("B15").Value = personnel.average_per_month_1; + ws.Cell("B15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("B15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("B15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("B15").Style.Font.FontSize = 16; + + ws.Cell("C15").Value = "ลบ."; + ws.Cell("C15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("C15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("C15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("C15").Style.Font.FontSize = 16; + ws.Cell("E15").Value = "เฉลี่ยต่อเดือน"; + ws.Cell("E15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("E15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("E15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E15").Style.Font.FontSize = 16; + ws.Cell("F15").Value = personnel.average_per_month_2; + ws.Cell("F15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("F15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F15").Style.Font.FontSize = 16; + + ws.Cell("G15").Value = "ลบ."; + ws.Cell("G15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell("G15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G15").Style.Font.FontSize = 16; + + ws.Cell("U15").Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)"; + ws.Cell("U15").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell("U15").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("U15").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("U15").Style.Font.SetBold().Font.FontSize = 16; + //ws.Range("N4:N6").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Row(4).Height = 30; + // ws.Row(5).Height = 30; + // ws.Row(6).Height = 30; + ws.Column(1).Width = 40; + ws.Column(2).Width = 12; + ws.Column(3).Width = 12; + ws.Column(4).Width = 12; + ws.Column(5).Width = 12; + ws.Column(6).Width = 12; + ws.Column(7).Width = 12; + ws.Column(8).Width = 12; + ws.Column(9).Width = 12; + ws.Column(10).Width = 12; + ws.Column(11).Width = 12; + ws.Column(12).Width = 12; + ws.Column(13).Width = 12; + ws.Column(14).Width = 12; + ws.Column(15).Width = 12; + ws.Column(16).Width = 12; + ws.Column(17).Width = 12; + ws.Column(18).Width = 12; + ws.Column(19).Width = 30; + ws.Column(20).Width = 12; + ws.Column(21).Width = 30; + + int row = 19; + int headtable = 19; + + if (personnel != null) + { + ws.Range("A16:D18").Merge().Value = "รายการ"; + ws.Range("A16:D18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("A16:D18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("A16:D18").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("A16:D18").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("A16:D18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range("A16:D18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range("E16:F16").Merge().Value = "งปม. 2565"; + ws.Range("E16:F16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("E16:F16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E16:F16").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("E16:F16").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("E16:F16").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("E16:F16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range("E17:F17").Merge().Value = "พ.ร.บ."; + ws.Range("E17:F17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("E17:F17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("E17:F17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("E17:F17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("E17:F17").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("E17:F17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("E18").Value = "อัตรา"; + ws.Cell("E18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("E18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("E18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("E18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("E18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("E18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Cell("F18").Value = "งบประมาณ"; + ws.Cell("F18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("F18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("F18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("F18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("F18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("F18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + + ws.Range("G16:J16").Merge().Value = "งปม. 2566 (จ่ายจริง ต.ค.- ธ.ค. 64)"; + ws.Range("G16:J16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("G16:J16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("G16:J16").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("G16:J16").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("G16:J16").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range("G16:J16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("G17:H17").Merge().Value = "คำขอ"; + ws.Range("G17:H17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("G17:H17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("G17:H17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("G17:H17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("G17:H17").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range("G17:H17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("I17:J17").Merge().Value = "ข้อเสนอ"; + ws.Range("I17:J17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("I17:J17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("I17:J17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("I17:J17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("I17:J17").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range("I17:J17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("G18").Value = "อัตรา"; + ws.Cell("G18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("G18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("G18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("G18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("G18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("G18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell("H18").Value = "งบประมาณ"; + ws.Cell("H18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("H18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("H18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("H18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("H18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("H18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell("I18").Value = "อัตรา"; + ws.Cell("I18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("I18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("I18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("I18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("I18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("I18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell("J18").Value = "งบประมาณ"; + ws.Cell("J18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("J18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("J18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("J18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("J18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("J18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + + ws.Range("K16:P16").Merge().Value = "MTEF"; + ws.Range("K16:P16").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("K16:P16").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("K16:P16").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("K16:P16").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("K16:P16").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("K16:P16").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("K17:L17").Merge().Value = "2567"; + ws.Range("K17:L17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("K17:L17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("K17:L17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("K17:L17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("K17:L17").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("K17:L17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("M17:N17").Merge().Value = "2568"; + ws.Range("M17:N17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("M17:N17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("M17:N17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("M17:N17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("M17:N17").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("M17:N17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range("O17:P17").Merge().Value = "2569"; + ws.Range("O17:P17").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("O17:P17").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("O17:P17").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("O17:P17").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("O17:P17").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("O17:P17").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("K18").Value = "อัตรา"; + ws.Cell("K18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("K18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("K18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("K18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("K18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("K18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("L18").Value = "งบประมาณ"; + ws.Cell("L18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("L18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("L18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("L18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("L18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("L18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("M18").Value = "อัตรา"; + ws.Cell("M18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("M18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("M18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("M18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("M18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("M18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("N18").Value = "งบประมาณ"; + ws.Cell("N18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("N18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("N18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("N18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("N18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("N18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("O18").Value = "อัตรา"; + ws.Cell("O18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("O18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("O18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("O18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("O18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("O18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell("P18").Value = "งบประมาณ"; + ws.Cell("P18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell("P18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell("P18").Style.Font.FontName = "TH SarabunPSK"; + ws.Cell("P18").Style.Font.SetBold().Font.FontSize = 16; + ws.Cell("P18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell("P18").Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range("Q16:U18").Merge().Value = "คำชี้แจง"; + ws.Range("Q16:U18").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range("Q16:U18").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range("Q16:U18").Style.Font.FontName = "TH SarabunPSK"; + ws.Range("Q16:U18").Style.Font.SetBold().Font.FontSize = 16; + ws.Range("Q16:U18").Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range("Q16:U18").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + foreach (var detail in personnel.personnel_expense_budget_details) + { + if (detail.is_bold == true) + { + 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, 6).Value = detail.act_budget; + ws.Cell(row, 7).Value = detail.request_rate; + ws.Cell(row, 8).Value = detail.request_budget; + ws.Cell(row, 9).Value = detail.offer_rate; + ws.Cell(row, 10).Value = detail.offer_budget; + ws.Cell(row, 11).Value = detail.year1_rate; + ws.Cell(row, 12).Value = detail.year1_budget; + ws.Cell(row, 13).Value = detail.year2_rate; + ws.Cell(row, 14).Value = detail.year2_budget; + ws.Cell(row, 15).Value = detail.year3_rate; + ws.Cell(row, 16).Value = detail.year3_budget; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Value = detail.remark; + + 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.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + row++; + } + + if (detail.is_bold == false) + { + 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, 6).Value = detail.act_budget; + ws.Cell(row, 7).Value = detail.request_rate; + ws.Cell(row, 8).Value = detail.request_budget; + ws.Cell(row, 9).Value = detail.offer_rate; + ws.Cell(row, 10).Value = detail.offer_budget; + ws.Cell(row, 11).Value = detail.year1_rate; + ws.Cell(row, 12).Value = detail.year1_budget; + ws.Cell(row, 13).Value = detail.year2_rate; + ws.Cell(row, 14).Value = detail.year2_budget; + ws.Cell(row, 15).Value = detail.year3_rate; + ws.Cell(row, 16).Value = detail.year3_budget; + ws.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Value = detail.remark; + + 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.Range(ws.Cell(row, 17), ws.Cell(row, 21)).Merge().Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row, 5), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#"); + + ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + row++; + } + + foreach (var detail2 in detail.personnel_expense_budget_details_2) + { + if (detail2.is_header==true) + { + + ws.Cell(row + 1, 1).Value = "ส่วนที่ 2 เงินเพิ่มอื่นที่จ่ายควบกับเงินเดือน"; + ws.Cell(row + 1, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row + 1, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 1).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 4).Value = "งบประมาณ"; + ws.Cell(row + 1, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 1, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 4).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 4).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 6).Value = personnel.other_additional; + ws.Cell(row + 1, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 1, 6).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 6).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 6).Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell(row + 1, 7).Value = "ล้านบาท"; + ws.Cell(row + 1, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row + 1, 7).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 7).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 7).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 1, 19).Value = "หน่วย : ล้านบาท (ทศนิยม 4 ตำแหน่ง)"; + ws.Cell(row + 1, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 1, 19).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 1, 19).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 1, 19).Style.Font.SetBold().Font.FontSize = 16; + + ws.Cell(row + 3, 1).Value = "ประเภท"; + ws.Cell(row + 3, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 3, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 3, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 3, 1).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 2, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 3, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 1).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 1).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 1).Style.Border.TopBorder = XLBorderStyleValues.Thin; + + ws.Cell(row + 3, 3).Value = "รายการ"; + ws.Cell(row + 3, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row + 3, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Cell(row + 3, 3).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 3, 3).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 2, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 2, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 2, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 3, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 3).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 4).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 3).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 2).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 3).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 2, 4).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Merge().Value = "งปม. 2566"; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 2, 5), ws.Cell(row + 2, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Merge().Value = "คำขอ"; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 3, 5), ws.Cell(row + 3, 6)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Merge().Value = "ข้อเสนอ"; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 3, 7), ws.Cell(row + 3, 8)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 5).Value = "อัตรา"; + ws.Cell(row + 4, 5).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 5).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 5).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 5).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 5).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 5).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 6).Value = "งบประมาณ"; + ws.Cell(row + 4, 6).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 6).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 6).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 6).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 6).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 6).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 7).Value = "อัตรา"; + ws.Cell(row + 4, 7).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 7).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 7).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 7).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 7).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 7).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 8).Value = "งบประมาณ"; + ws.Cell(row + 4, 8).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 8).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 8).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 8).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 8).Style.Fill.BackgroundColor = + XLColor.FromArgb(214, 220, 228); + ws.Cell(row + 4, 8).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Merge().Value = "MTEF"; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 2, 9), ws.Cell(row + 2, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Merge().Value = "2567"; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3, 9), ws.Cell(row + 3, 10)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Merge().Value = "2568"; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 11), ws.Cell(row + 3, 12)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3,11), ws.Cell(row + 3, 12)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Merge().Value = "2569"; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 3, 13), ws.Cell(row + 3, 14)).Style.Fill.BackgroundColor = XLColor.FromArgb(172, 185, 202); + ws.Range(ws.Cell(row + 3,13), ws.Cell(row + 3, 14)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Cell(row + 4, 9).Value = "อัตรา"; + ws.Cell(row + 4, 9).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 9).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 9).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 9).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 9).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 9).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 10).Value = "งบประมาณ"; + ws.Cell(row + 4, 10).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 10).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 10).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 10).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 10).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 10).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 11).Value = "อัตรา"; + ws.Cell(row + 4, 11).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 11).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 11).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 11).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 11).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 11).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 12).Value = "งบประมาณ"; + ws.Cell(row + 4, 12).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 12).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 12).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 12).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 12).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 12).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 13).Value = "อัตรา"; + ws.Cell(row + 4, 13).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 13).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 13).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 13).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 13).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 13).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Cell(row + 4, 14).Value = "งบประมาณ"; + ws.Cell(row + 4, 14).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Center; + ws.Cell(row + 4, 14).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row + 4, 14).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 4, 14).Style.Font.SetBold().Font.FontSize = 16; + ws.Cell(row + 4, 14).Style.Fill.BackgroundColor = + XLColor.FromArgb(172, 185, 202); + ws.Cell(row + 4, 14).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Merge().Value = "คำชี้แจง"; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.FontName = "TH SarabunPSK"; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Fill.BackgroundColor = XLColor.FromArgb(214, 220, 228); + ws.Range(ws.Cell(row + 2, 15), ws.Cell(row + 4, 19)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + } + + if (detail2.is_bold == true && detail2.list == "รวมทั้งสิ้น") + { + ws.Cell(row+5, 2).Value = "รวมทั้งสิ้น"; + ws.Cell(row+5, 5).Value = detail2.request_rate; + ws.Cell(row+5, 6).Value = detail2.request_budget; + ws.Cell(row+5, 7).Value = detail2.offer_rate; + ws.Cell(row+5, 8).Value = detail2.offer_budget; + ws.Cell(row+5, 9).Value = detail2.year1_rate; + ws.Cell(row+5, 10).Value = detail2.year1_budget; + ws.Cell(row+5, 11).Value = detail2.year2_rate; + ws.Cell(row+5, 12).Value = detail2.year2_budget; + ws.Cell(row+5, 13).Value = detail2.year3_rate; + ws.Cell(row+5, 14).Value = detail2.year3_budget; + // ws.Cell(row, 15).Value = detail.year3_rate; + // ws.Cell(row, 16).Value = detail.year3_budget; + ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; + + //ws.Cell(row + 5, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row + 5, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row + 5, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; + + ws.Cell(row + 5, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 5, 5), ws.Cell(row + 5, 14)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + + ws.Cell(row + 5, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + } + if (detail2.is_bold == true) + { + ws.Cell(row+5, 1).Value = detail2.type; + //ws.Cell(row+5, 2).Value = detail2.list; + ws.Cell(row+5, 5).Value = detail2.request_rate; + ws.Cell(row+5, 6).Value = detail2.request_budget; + ws.Cell(row+5, 7).Value = detail2.offer_rate; + ws.Cell(row+5, 8).Value = detail2.offer_budget; + ws.Cell(row+5, 9).Value = detail2.year1_rate; + ws.Cell(row+5, 10).Value = detail2.year1_budget; + ws.Cell(row+5, 11).Value = detail2.year2_rate; + ws.Cell(row+5, 12).Value = detail2.year2_budget; + ws.Cell(row+5, 13).Value = detail2.year3_rate; + ws.Cell(row+5, 14).Value = detail2.year3_budget; + // ws.Cell(row, 15).Value = detail.year3_rate; + // ws.Cell(row, 16).Value = detail.year3_budget; + ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; + + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.TopBorder = XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Thin; + + ws.Cell(row + 5, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Font.SetBold().Font.FontSize = 16; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row, 19)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 5, 5), ws.Cell(row + 5, 14)).Style.NumberFormat.SetFormat("#,#"); + ws.Cell(row + 5, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row + 5, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + + ws.Cell(row + 5, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + + row++; + } + if (detail2.is_bold == false) + { + ws.Range(ws.Cell(row+5, 2), ws.Cell(row+5, 4)).Merge().Value = detail2.list; + ws.Cell(row+5, 5).Value = detail2.request_rate; + ws.Cell(row+5, 6).Value = detail2.request_budget; + ws.Cell(row+5, 7).Value = detail2.offer_rate; + ws.Cell(row+5, 8).Value = detail2.offer_budget; + ws.Cell(row+5, 9).Value = detail2.year1_rate; + ws.Cell(row+5, 10).Value = detail2.year1_budget; + ws.Cell(row+5, 11).Value = detail2.year2_rate; + ws.Cell(row+5, 12).Value = detail2.year2_budget; + ws.Cell(row+5, 13).Value = detail2.year3_rate; + ws.Cell(row+5, 14).Value = detail2.year3_budget; + // ws.Cell(row, 15).Value = detail.year3_rate; + // ws.Cell(row, 16).Value = detail.year3_budget; + ws.Range(ws.Cell(row+5, 15), ws.Cell(row+5, 19)).Merge().Value = detail2.remark; + + ws.Cell(row + 5, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row + 5, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 15), ws.Cell(row + 5, 19)).Merge().Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 19)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 19)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 19)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row + 5, 1), ws.Cell(row + 5, 19)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 5, 5), ws.Cell(row + 5, 14)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row + 5, 2), ws.Cell(row + 5, 4)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + ws.Cell(row + 5, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; + ws.Cell(row + 5, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + + + row++; + } + + } + } + ws.Cell(row + 6, 1).Value = "หมายเหตุ : " + personnel.remark; + ws.Cell(row + 6, 1).Style.Alignment.Horizontal = + XLAlignmentHorizontalValues.Left; + ws.Cell(row + 6, 1).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row + 6, 1), ws.Cell(row+6, 19)).Style.Alignment.WrapText = true; + ws.Cell(row + 6, 1).Style.Font.FontName = "TH SarabunPSK"; + ws.Cell(row + 6, 1).Style.Font.SetBold().Font.FontSize = 16; + } + + 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_expense_budget" + date + ".xlsx"); + } + } } } \ No newline at end of file diff --git a/Models/Personnel/personnel_expense_budget.cs b/Models/Personnel/personnel_expense_budget.cs new file mode 100644 index 0000000..d36f4fa --- /dev/null +++ b/Models/Personnel/personnel_expense_budget.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace rmutr_report.Models.Personnel +{ + public class personnel_expense_budget //งบประมาณค่าใช้จ่ายบุคลากร + { + [Key] public Guid? personnel_expense_budget_uid { get; set; } + + // public Guid? academic_year_uid { get; set; } + public string academic_year_name_th { get; set; } + + // + public string ministry_name_th { get; set; } + + // + public string agency_name_th { get; set; } + + // + public decimal? rate_frame_total { get; set; } + public decimal? rate_frame_owner { get; set; } + public decimal? rate_frame_free { get; set; } + + public decimal? rate_frame_not_free { get; set; } + + // + public decimal? budget_proposal_summary { get; set; } + + public decimal? budget_summary { get; set; } + + // + public decimal? salary_calculation { get; set; } + + public decimal? salary_calculation_budget { get; set; } + + // + public decimal? act_1 { get; set; } + public decimal? act_1_disbursement_year { get; set; } + public decimal? act_1_disbursement_year_percentage { get; set; } + public decimal? act_1_remaining { get; set; } + + public decimal? act_1_remaining_percentage { get; set; } + + // + public decimal? money_to_advance { get; set; } + + public decimal? money_to_advance_percentage { get; set; } + + // + public decimal? act_2 { get; set; } + public decimal? act_2_actually_aid { get; set; } + public decimal? act_2_actually_aid_percentage { get; set; } + public decimal? act_2_remaining { get; set; } + + public decimal? act_2_remaining_percentage { get; set; } + + // + public decimal? average_per_month_1 { get; set; } + + public decimal? average_per_month_2 { get; set; } + + //path 2 ด้านล่างต่อจากตาราง + public decimal? other_additional { get; set; } + + // + public string remark { get; set; } + public DateTime? version { get; set; } + public List personnel_expense_budget_details { get; set; } + + + } + + public class t_personnel_expense_budget_detail + { + [Key] public Guid? personnel_expense_budget_detail_uid { get; set; } + public Guid? personnel_expense_budget_uid { get; set; } + public string topic { get; set; } + public int? act_rate { get; set; } + public decimal? act_budget { get; set; } + public int? request_rate { get; set; } + public decimal? request_budget { get; set; } + public int? offer_rate { get; set; } + public decimal? offer_budget { get; set; } + public int? year1_rate { get; set; } + public decimal? year1_budget { get; set; } + public int? year2_rate { get; set; } + public decimal? year2_budget { get; set; } + public int? year3_rate { get; set; } + public decimal? year3_budget { get; set; } + public string remark { get; set; } + public int? row { get; set; } + [NotMapped] public bool? is_bold { get; set; } + public List personnel_expense_budget_details_2 { get; set; } + + } + + public class t_personnel_expense_budget_detail_2 + { + [Key] public Guid? personnel_expense_budget_detail_2_uid { get; set; } + public Guid? personnel_expense_budget_uid { get; set; } + public string type { get; set; } + public string list { get; set; } + public int? request_rate { get; set; } + public decimal? request_budget { get; set; } + public int? offer_rate { get; set; } + public decimal? offer_budget { get; set; } + public int? year1_rate { get; set; } + public decimal? year1_budget { get; set; } + public int? year2_rate { get; set; } + public decimal? year2_budget { get; set; } + public int? year3_rate { get; set; } + public decimal? year3_budget { get; set; } + public string remark { get; set; } + public int? row { get; set; } + [NotMapped] public bool? is_bold { get; set; } + public bool? is_header { 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 0499869..7cfb565 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 0b61b9d..13c9570 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 b53f1c6..782a048 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -a9b769c5aa8198877b368595fbd27fdd31ce1f62 +b72e1ee7109b710bd4d78c020e9006ab9f3adfe8 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 0499869..7cfb565 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 0b61b9d..13c9570 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ