bug fixed

This commit is contained in:
kamonwan taengsuk
2023-03-14 16:33:39 +07:00
parent 7a7b12bc77
commit 4022335661
2 changed files with 26 additions and 21 deletions

View File

@@ -217,7 +217,7 @@ namespace rmutr_report.Controllers
expenses.teaching_hours_workload_pertype2);
decimal? sum4 = (expenses.teaching_hours_workload2 -
expenses.teaching_hours_workload_pertype2) * 400;
_calculation_excess_tuition_fee.total_1 = sum1;
//_calculation_excess_tuition_fee.total_1 = sum1;
var sum5 = _calculation_excess_tuition_fee.data.Where(g =>
g.teaching_hours_workload_pertype1 == g.teaching_hours_workload_pertype1).Sum(a =>
a.teaching_hours_workload_pertype1);
@@ -230,11 +230,23 @@ namespace rmutr_report.Controllers
var sum8 = _calculation_excess_tuition_fee.data
.Where(g => g.teaching_hours_workload2 == g.teaching_hours_workload2).Sum(a =>
a.teaching_hours_workload2);
var sum9 = sum6-sum5;
var teach_rate1 = _calculation_excess_tuition_fee.data
.Where(g => g.teach_rate_1 == g.teach_rate_1).Sum(a =>
a.teach_rate_1);
var diff_teach1 = _calculation_excess_tuition_fee.data
.Where(g => g.diff_teach1 == g.diff_teach1).Sum(a =>
a.diff_teach1);
var teach_rate2 = _calculation_excess_tuition_fee.data
.Where(g => g.teach_rate_2 == g.teach_rate_2).Sum(a =>
a.teach_rate_2);
var diff_teach2 = _calculation_excess_tuition_fee.data
.Where(g => g.diff_teach2 == g.diff_teach2).Sum(a =>
a.diff_teach2);
var sum9 = diff_teach1;
var sum10 = sum9*400;
var sum11 = sum8-sum7;
var sum11 = diff_teach2;
var sum12 = sum11*400;
var sum13 = sum10+sum12;
var sum13 = teach_rate1+teach_rate2;
if ( expenses.name !="รวม")
{
ws.Cell(row, 1).Value = rowno;
@@ -245,13 +257,13 @@ namespace rmutr_report.Controllers
ws.Cell(row, 5).Value = expenses.pertype;
ws.Cell(row, 6).Value = expenses.teaching_hours_workload_pertype1;
ws.Cell(row, 7).Value = expenses.teaching_hours_workload1;
ws.Cell(row, 8).Value = sum1;
ws.Cell(row, 9).Value = sum2;
ws.Cell(row, 8).Value = expenses.diff_teach1;
ws.Cell(row, 9).Value = expenses.teach_rate_1;
ws.Cell(row, 10).Value = expenses.teaching_hours_workload_pertype2;
ws.Cell(row, 11).Value = expenses.teaching_hours_workload2;
ws.Cell(row, 12).Value = sum3;
ws.Cell(row, 13).Value = sum4;
ws.Cell(row, 14).Value = sum2 + sum4;
ws.Cell(row, 12).Value = expenses.diff_teach2;
ws.Cell(row, 13).Value = expenses.teach_rate_2;
ws.Cell(row, 14).Value = expenses.teach_rate_1 + expenses.teach_rate_2;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 14)).Style.Font.FontName =
"TH Sarabun New";

View File

@@ -12,14 +12,7 @@ namespace rmutr_report.Models
public string academic_semester_name_th1 { get; set; }
public string academic_semester_name_th2 { get; set; }
public List<calculation_excess_tuition_fee_detail> data { get; set; }
public decimal? total_1 { get; set; }
public decimal? total_2 { get; set; }
public decimal? total_3 { get; set; }
public decimal? total_4 { get; set; }
public decimal? total_5 { get; set; }
public decimal? total_6 { get; set; }
public decimal? total_7 { get; set; }
public decimal? total_8 { get; set; }
}
@@ -30,12 +23,12 @@ namespace rmutr_report.Models
public string pertype { get; set; }
public decimal? teaching_hours_workload_pertype1 { get; set; }
public decimal? teaching_hours_workload1 { get; set; }
// public decimal? difference1 { get; set; }
// public decimal? tuition_rate1 { get; set; }
public decimal? diff_teach1 { get; set; }
public decimal? teach_rate_1 { get; set; }
public decimal? teaching_hours_workload_pertype2 { get; set; }
public decimal? teaching_hours_workload2 { get; set; }
// public decimal? difference2 { get; set; }
// public decimal? tuition_rate2 { get; set; }
public decimal? diff_teach2 { get; set; }
public decimal? teach_rate_2 { get; set; }
//public decimal? total_budget { get; set; }
}
}