fixed
This commit is contained in:
@@ -1598,11 +1598,76 @@ namespace rmutr_report.Controllers
|
||||
public IActionResult GetBudgetReport([FromRoute] string type,
|
||||
[FromBody] budget_expenditure_from_revenue budget_expenditure_from_revenues)
|
||||
{
|
||||
var topic2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details.ToArray()
|
||||
.Where(i => i.topic_type == 2).ToList();
|
||||
var topic3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details.ToArray()
|
||||
.Where(i => i.topic_type == 3).OrderBy(f=>f.couse_uid).ThenBy(m=>m.major_uid)
|
||||
.ThenBy(r=>r.row).ToList();
|
||||
// var sum_1 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.current_students);
|
||||
// var sum_2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.students_reduced);
|
||||
// var sum_3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.students_estimates);
|
||||
// var sum_4 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.price_regis_flat_payment);
|
||||
// var sum_5 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.library_total);
|
||||
// var sum_6 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.utilities_total);
|
||||
// var sum_7 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.student_club_library_total);
|
||||
// var sum_8 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.accident_insurance_total);
|
||||
// var sum_9 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.academic_activities_total);
|
||||
// var sum_10 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.examination_and_x_rays_total);
|
||||
// var sum_11 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.tuition_fee_total);
|
||||
// var sum_12 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
|
||||
// .Where(h => h.topic_type == 2).Sum(j =>
|
||||
// j.education_fee_less_fee_total);
|
||||
if (budget_expenditure_from_revenues.budget_expenditure_from_revenue_details != null)
|
||||
{
|
||||
// var _sum1 = topic3.Sum(g => g.current_students);
|
||||
// var _sum2 = topic3.Sum(j =>
|
||||
// j.students_reduced);
|
||||
// var _sum3 = topic3.Sum(j =>
|
||||
// j.students_estimates);
|
||||
// var _sum4 = topic3.Sum(j =>
|
||||
// j.price_regis_flat_payment);
|
||||
// var _sum5 = topic3.Sum(j =>
|
||||
// j.library_total);
|
||||
// var _sum6 = topic3.Sum(j =>
|
||||
// j.utilities_total);
|
||||
// var _sum7 = topic3.Sum(j =>
|
||||
// j.student_club_library_total);
|
||||
// var _sum8 = topic3.Sum(j =>
|
||||
// j.accident_insurance_total);
|
||||
// var _sum9 = topic3.Sum(j =>
|
||||
// j.academic_activities_total);
|
||||
// var _sum10 = topic3.Sum(j =>
|
||||
// j.examination_and_x_rays_total);
|
||||
// var _sum11 = topic3.Sum(j =>
|
||||
// j.tuition_fee_total);
|
||||
// var _sum12 = topic3.Sum(j =>
|
||||
// j.education_fee_less_fee_total);
|
||||
|
||||
foreach (var detail in budget_expenditure_from_revenues.budget_expenditure_from_revenue_details)
|
||||
{
|
||||
if (detail.topic_type == 1)
|
||||
if (detail.topic_type == 1 && detail.topic_type != 2&& detail.topic_type != 3)
|
||||
{
|
||||
detail.topic_1 = detail.topic;
|
||||
detail.topic_2 = null;
|
||||
@@ -1654,15 +1719,65 @@ namespace rmutr_report.Controllers
|
||||
.Where(h => h.topic_type == 1).Sum(j =>
|
||||
j.education_fee_less_fee_total);
|
||||
budget_expenditure_from_revenues.sum_12 = sum12;
|
||||
|
||||
detail.current_students = topic2.Sum(d=>d.current_students);
|
||||
|
||||
detail.students_reduced = topic2.Sum(d=>d.students_reduced);
|
||||
|
||||
detail.students_estimates = topic2.Sum(d=>d.students_estimates);
|
||||
|
||||
detail.price_regis_flat_payment = topic2.Sum(d=>d.price_regis_flat_payment);
|
||||
|
||||
detail.library_total = topic2.Sum(d=>d.library_total);
|
||||
|
||||
detail.utilities_total =topic2.Sum(d=>d.utilities_total);
|
||||
|
||||
detail.student_club_library_total = topic2.Sum(d=>d.student_club_library_total);
|
||||
|
||||
detail.accident_insurance_total = topic2.Sum(d=>d.accident_insurance_total);
|
||||
|
||||
detail.academic_activities_total = topic2.Sum(d=>d.academic_activities_total);
|
||||
|
||||
detail.examination_and_x_rays_total = topic2.Sum(d=>d.examination_and_x_rays_total);
|
||||
|
||||
detail.tuition_fee_total = topic2.Sum(d=>d.tuition_fee_total);
|
||||
|
||||
detail.education_fee_less_fee_total = topic2.Sum(d=>d.education_fee_less_fee_total);
|
||||
|
||||
}
|
||||
|
||||
if (detail.topic_type == 2)
|
||||
|
||||
if (detail.topic_type == 2&& detail.topic_type != 1&& detail.topic_type != 3)
|
||||
{
|
||||
detail.topic_1 = detail.topic;
|
||||
detail.topic_2 = null;
|
||||
|
||||
detail.current_students = topic3.Sum(d=>d.current_students);
|
||||
|
||||
detail.students_reduced = topic3.Sum(d=>d.students_reduced);
|
||||
|
||||
detail.students_estimates = topic3.Sum(d=>d.students_estimates);
|
||||
|
||||
detail.price_regis_flat_payment = topic3.Sum(d=>d.price_regis_flat_payment);
|
||||
|
||||
detail.library_total = topic3.Sum(d=>d.library_total);
|
||||
|
||||
detail.utilities_total =topic3.Sum(d=>d.utilities_total);
|
||||
|
||||
detail.student_club_library_total = topic3.Sum(d=>d.student_club_library_total);
|
||||
|
||||
detail.accident_insurance_total = topic3.Sum(d=>d.accident_insurance_total);
|
||||
|
||||
detail.academic_activities_total = topic3.Sum(d=>d.academic_activities_total);
|
||||
|
||||
detail.examination_and_x_rays_total = topic3.Sum(d=>d.examination_and_x_rays_total);
|
||||
|
||||
detail.tuition_fee_total = topic3.Sum(d=>d.tuition_fee_total);
|
||||
|
||||
detail.education_fee_less_fee_total = topic3.Sum(d=>d.education_fee_less_fee_total);
|
||||
}
|
||||
|
||||
if (detail.topic_type == 3)
|
||||
if (detail.topic_type == 3&& detail.topic_type != 1&& detail.topic_type != 2)
|
||||
{
|
||||
detail.topic_2 = detail.topic;
|
||||
detail.topic_1 = null;
|
||||
@@ -1834,7 +1949,6 @@ namespace rmutr_report.Controllers
|
||||
int r2 = 2;
|
||||
foreach (var detail in revenue_estimate.revenue_estimates_details)
|
||||
{
|
||||
|
||||
if (detail.topic_type == 1)
|
||||
{
|
||||
ws.Cell(row, 1).Value = detail.topic;
|
||||
@@ -1899,7 +2013,7 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
|
||||
|
||||
row++;
|
||||
}
|
||||
|
||||
@@ -2102,15 +2216,15 @@ namespace rmutr_report.Controllers
|
||||
row++;
|
||||
}
|
||||
|
||||
if (detail.is_footer== true)
|
||||
if (detail.is_footer == true)
|
||||
{
|
||||
ws.Cell(row, 14).Value = "ลงชื่อ";
|
||||
ws.Cell(row, 15).Value = revenue_estimate.author_name;
|
||||
ws.Cell(row, 15).Value = revenue_estimate.author_name;
|
||||
ws.Cell(row, 17).Value = "ผู้จัดทำ";
|
||||
ws.Cell(row + r1, 14).Value = "ตำแหน่ง";
|
||||
ws.Cell(row+r1, 15).Value = revenue_estimate.position_name;
|
||||
ws.Cell(row+r2, 14).Value = "เบอร์โทรติดต่อ";
|
||||
ws.Cell(row+r2, 15).Value = "'"+revenue_estimate.phone;
|
||||
ws.Cell(row + r1, 15).Value = revenue_estimate.position_name;
|
||||
ws.Cell(row + r2, 14).Value = "เบอร์โทรติดต่อ";
|
||||
ws.Cell(row + r2, 15).Value = "'" + revenue_estimate.phone;
|
||||
ws.Range(ws.Cell(row, 14), ws.Cell(row, 17)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row, 14), ws.Cell(row, 17)).Style.Font.SetBold().Font.FontSize = 14;
|
||||
@@ -2118,30 +2232,30 @@ namespace rmutr_report.Controllers
|
||||
// ws.Range(ws.Cell(row+1, 15), ws.Cell(row, 16)).Style.Border.BottomBorder = XLBorderStyleValues.Dotted;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row+1, 14).Style.Alignment.Horizontal =
|
||||
ws.Cell(row + 1, 14).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row+2, 14).Style.Alignment.Horizontal =
|
||||
ws.Cell(row + 2, 14).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row+1, 14).Style.Font.FontName =
|
||||
ws.Cell(row + 1, 14).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Cell(row+2, 14).Style.Font.FontName =
|
||||
ws.Cell(row + 2, 14).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Cell(row+1, 14).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Cell(row+2, 14).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Cell(row + 1, 14).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Cell(row + 2, 14).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row, 15), ws.Cell(row, 16)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row+1, 15), ws.Cell(row, 16)).Style.Font.FontName =
|
||||
ws.Range(ws.Cell(row + 1, 15), ws.Cell(row, 16)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Cell(row+2, 15).Style.Font.FontName =
|
||||
ws.Cell(row + 2, 15).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row, 15), ws.Cell(row, 16)).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row+1, 15), ws.Cell(row, 16)).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Cell(row+2, 15).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row + 1, 15), ws.Cell(row, 16)).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Cell(row + 2, 15).Style.Font.SetBold().Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row, 15), ws.Cell(row, 16)).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Range(ws.Cell(row+1, 15), ws.Cell(row, 16)).Style.Alignment.Horizontal =
|
||||
ws.Range(ws.Cell(row + 1, 15), ws.Cell(row, 16)).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row+2, 15).Style.Alignment.Horizontal =
|
||||
ws.Cell(row + 2, 15).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row+3, 15).Style.Font.FontName =
|
||||
// "TH SarabunPSK";
|
||||
@@ -2151,8 +2265,6 @@ namespace rmutr_report.Controllers
|
||||
row++;
|
||||
row += r1;
|
||||
row += r2;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2169,13 +2281,13 @@ namespace rmutr_report.Controllers
|
||||
"revenue_estimates_" + date + ".xlsx");
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost, Route("reports/summary_budget_university/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetSumBudgetUniReport([FromRoute] string type,
|
||||
[FromBody] summary_budget_university summary)
|
||||
{
|
||||
|
||||
var summaryBudget = new List<summary_budget_university>() { summary};
|
||||
var summaryBudget = new List<summary_budget_university>() { summary };
|
||||
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "summary_budget_university.frx");
|
||||
@@ -2201,7 +2313,7 @@ namespace rmutr_report.Controllers
|
||||
return File(
|
||||
stream,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"summary_budget_university_"+date + ".xlsx");
|
||||
"summary_budget_university_" + date + ".xlsx");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
|
||||
Reference in New Issue
Block a user