This commit is contained in:
kamonwan taengsuk
2023-07-13 16:07:12 +07:00
parent 6ac23499d4
commit b18118e309
7 changed files with 264 additions and 265 deletions

View File

@@ -1598,11 +1598,11 @@ namespace rmutr_report.Controllers
public IActionResult GetBudgetReport([FromRoute] string type, public IActionResult GetBudgetReport([FromRoute] string type,
[FromBody] budget_expenditure_from_revenue budget_expenditure_from_revenues) [FromBody] budget_expenditure_from_revenue budget_expenditure_from_revenues)
{ {
var topic2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details.ToArray() // var topic2 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
.Where(i => i.topic_type == 2).ToList(); // .Where(i => i.topic_type == 2).ToList();
var topic3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details.ToArray() // var topic3 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
.Where(i => i.topic_type == 3).OrderBy(f=>f.couse_uid).ThenBy(m=>m.major_uid) // .Where(i => i.topic_type == 3).OrderBy(f=>f.couse_uid).ThenBy(m=>m.major_uid)
.ThenBy(r=>r.row).ToList(); // .ThenBy(r=>r.row).ToList();
// var sum_1 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details // var sum_1 = budget_expenditure_from_revenues.budget_expenditure_from_revenue_details
// .Where(h => h.topic_type == 2).Sum(j => // .Where(h => h.topic_type == 2).Sum(j =>
// j.current_students); // j.current_students);
@@ -1667,7 +1667,7 @@ namespace rmutr_report.Controllers
foreach (var detail in budget_expenditure_from_revenues.budget_expenditure_from_revenue_details) foreach (var detail in budget_expenditure_from_revenues.budget_expenditure_from_revenue_details)
{ {
if (detail.topic_type == 1 && detail.topic_type != 2&& detail.topic_type != 3) if (detail.topic_type == 1)
{ {
detail.topic_1 = detail.topic; detail.topic_1 = detail.topic;
detail.topic_2 = null; detail.topic_2 = null;
@@ -1720,64 +1720,63 @@ namespace rmutr_report.Controllers
j.education_fee_less_fee_total); j.education_fee_less_fee_total);
budget_expenditure_from_revenues.sum_12 = sum12; budget_expenditure_from_revenues.sum_12 = sum12;
detail.current_students = topic2.Sum(d=>d.current_students); // detail.current_students = topic3.Sum(d=>d.current_students);
//
detail.students_reduced = topic2.Sum(d=>d.students_reduced); // detail.students_reduced = topic3.Sum(d=>d.students_reduced);
//
detail.students_estimates = topic2.Sum(d=>d.students_estimates); // detail.students_estimates = topic3.Sum(d=>d.students_estimates);
//
detail.price_regis_flat_payment = topic2.Sum(d=>d.price_regis_flat_payment); // detail.price_regis_flat_payment = topic3.Sum(d=>d.price_regis_flat_payment);
//
detail.library_total = topic2.Sum(d=>d.library_total); // detail.library_total = topic3.Sum(d=>d.library_total);
//
detail.utilities_total =topic2.Sum(d=>d.utilities_total); // detail.utilities_total =topic3.Sum(d=>d.utilities_total);
//
detail.student_club_library_total = topic2.Sum(d=>d.student_club_library_total); // detail.student_club_library_total = topic3.Sum(d=>d.student_club_library_total);
//
detail.accident_insurance_total = topic2.Sum(d=>d.accident_insurance_total); // detail.accident_insurance_total = topic3.Sum(d=>d.accident_insurance_total);
//
detail.academic_activities_total = topic2.Sum(d=>d.academic_activities_total); // detail.academic_activities_total = topic3.Sum(d=>d.academic_activities_total);
//
detail.examination_and_x_rays_total = topic2.Sum(d=>d.examination_and_x_rays_total); // detail.examination_and_x_rays_total = topic3.Sum(d=>d.examination_and_x_rays_total);
//
detail.tuition_fee_total = topic2.Sum(d=>d.tuition_fee_total); // detail.tuition_fee_total = topic3.Sum(d=>d.tuition_fee_total);
//
detail.education_fee_less_fee_total = topic2.Sum(d=>d.education_fee_less_fee_total); // detail.education_fee_less_fee_total = topic3.Sum(d=>d.education_fee_less_fee_total);
} }
if (detail.topic_type == 2&& detail.topic_type != 1&& detail.topic_type != 3) if (detail.topic_type == 2)
{ {
detail.topic_1 = detail.topic; detail.topic_1 = detail.topic;
detail.topic_2 = null; detail.topic_2 = null;
detail.current_students = topic3.Sum(d=>d.current_students); // detail.current_students = topic2.Sum(d=>d.current_students);
//
detail.students_reduced = topic3.Sum(d=>d.students_reduced); // detail.students_reduced = topic2.Sum(d=>d.students_reduced);
//
detail.students_estimates = topic3.Sum(d=>d.students_estimates); // detail.students_estimates = topic2.Sum(d=>d.students_estimates);
//
detail.price_regis_flat_payment = topic3.Sum(d=>d.price_regis_flat_payment); // detail.price_regis_flat_payment = topic2.Sum(d=>d.price_regis_flat_payment);
//
detail.library_total = topic3.Sum(d=>d.library_total); // detail.library_total = topic2.Sum(d=>d.library_total);
//
detail.utilities_total =topic3.Sum(d=>d.utilities_total); // detail.utilities_total =topic2.Sum(d=>d.utilities_total);
//
detail.student_club_library_total = topic3.Sum(d=>d.student_club_library_total); // detail.student_club_library_total = topic2.Sum(d=>d.student_club_library_total);
//
detail.accident_insurance_total = topic3.Sum(d=>d.accident_insurance_total); // detail.accident_insurance_total = topic2.Sum(d=>d.accident_insurance_total);
//
detail.academic_activities_total = topic3.Sum(d=>d.academic_activities_total); // detail.academic_activities_total = topic2.Sum(d=>d.academic_activities_total);
//
detail.examination_and_x_rays_total = topic3.Sum(d=>d.examination_and_x_rays_total); // detail.examination_and_x_rays_total = topic2.Sum(d=>d.examination_and_x_rays_total);
//
detail.tuition_fee_total = topic3.Sum(d=>d.tuition_fee_total); // detail.tuition_fee_total = topic2.Sum(d=>d.tuition_fee_total);
//
detail.education_fee_less_fee_total = topic3.Sum(d=>d.education_fee_less_fee_total); // detail.education_fee_less_fee_total = topic2.Sum(d=>d.education_fee_less_fee_total);
} }
if (detail.topic_type == 3&& detail.topic_type != 1&& detail.topic_type != 2) if (detail.topic_type == 3)
{ {
detail.topic_2 = detail.topic; detail.topic_2 = detail.topic;
detail.topic_1 = null; detail.topic_1 = null;

View File

@@ -91,6 +91,7 @@ namespace rmutr_report.Models
public Guid? academic_year_uid { get; set; } public Guid? academic_year_uid { get; set; }
public Guid? couse_uid { get; set; } public Guid? couse_uid { get; set; }
public Guid? major_uid { get; set; } public Guid? major_uid { get; set; }
//public List<t_budget_expenditure_from_revenue_detail_2> budget_expenditure_from_revenue_details_2 { get; set; }
} }
@@ -134,9 +135,10 @@ namespace rmutr_report.Models
// //
// //
// public int? topic_type { get; set; } // public int? topic_type { get; set; }
// //public List<t_budget_expenditure_from_revenue_detail_3> budget_expenditure_from_revenue_details_3 { get; set; }
// //
// } // }
//
// public class t_budget_expenditure_from_revenue_detail_3 // public class t_budget_expenditure_from_revenue_detail_3
// { // {
// public string topic { get; set; } // public string topic { get; set; }

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="07/12/2023 17:34:29" ReportInfo.CreatorVersion="2021.1.0.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="07/13/2023 15:33:26" ReportInfo.CreatorVersion="2021.1.0.0">
<Dictionary> <Dictionary>
<BusinessObjectDataSource Name="budget_expenditure_from_revenue" ReferenceName="budget_expenditure_from_revenue" DataType="null" Enabled="true"> <BusinessObjectDataSource Name="budget_expenditure_from_revenue" ReferenceName="budget_expenditure_from_revenue" DataType="null" Enabled="true">
<Column Name="academic_year_name_th" DataType="System.String"/> <Column Name="academic_year_name_th" DataType="System.String"/>
@@ -187,8 +187,7 @@
</TableRow> </TableRow>
</TableObject> </TableObject>
</PageHeaderBand> </PageHeaderBand>
<DataBand Name="Data1" Top="262.7" Width="2079"> <DataBand Name="Data1" Top="263.48" Width="2079" Height="47.25" DataSource="budget_expenditure_from_revenue_details">
<DataBand Name="Data2" Top="270.24" Width="2079" Height="47.25" DataSource="budget_expenditure_from_revenue_details">
<TableObject Name="Table17" Width="2079" Height="47.25" Border.Lines="All"> <TableObject Name="Table17" Width="2079" Height="47.25" Border.Lines="All">
<TableColumn Name="Column131" Width="236.25"/> <TableColumn Name="Column131" Width="236.25"/>
<TableColumn Name="Column132"/> <TableColumn Name="Column132"/>
@@ -391,8 +390,7 @@
</TableRow> </TableRow>
</TableObject> </TableObject>
</DataBand> </DataBand>
</DataBand> <ReportSummaryBand Name="ReportSummary1" Top="319.07" Width="2079" Height="151.2">
<ReportSummaryBand Name="ReportSummary1" Top="325.04" Width="2079" Height="151.2">
<TableObject Name="Table26" Width="2079" Height="47.25" Border.Lines="All"> <TableObject Name="Table26" Width="2079" Height="47.25" Border.Lines="All">
<TableColumn Name="Column221" Width="217.35"/> <TableColumn Name="Column221" Width="217.35"/>
<TableColumn Name="Column222" Width="85.05"/> <TableColumn Name="Column222" Width="85.05"/>