แก้ไข การคำนวณ
This commit is contained in:
@@ -56,12 +56,13 @@ namespace TodoAPI2.Models
|
||||
|
||||
public void DoAfterInsertUpdate(DataContext context)
|
||||
{
|
||||
//total_salary = (from i in context.eva_limit_frame_employee
|
||||
// join j in context.eva_limit_frame_group
|
||||
// on i.frame_group_guid equals j.id
|
||||
// select i.salary).Sum();
|
||||
//limit_frame_005_total = total_salary * limit_frame_005 / 100;
|
||||
//limit_frame_005_total_rounded = MyHelper.RoundOff(limit_frame_005_total.Value, 10);
|
||||
total_salary = (from i in context.eva_limit_frame_employee
|
||||
join j in context.eva_limit_frame_group
|
||||
on i.frame_group_guid equals j.id
|
||||
where j.frame_plan_guid == this.id
|
||||
select i.salary).Sum();
|
||||
limit_frame_005_total = total_salary * limit_frame_005 / 100;
|
||||
limit_frame_005_total_rounded = MyHelper.RoundOff(limit_frame_005_total.Value, 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -256,9 +256,9 @@ namespace TodoAPI2.Models
|
||||
_repository.Context.AddRange(result_frame_group);
|
||||
_repository.Context.AddRange(result_frame_employee);
|
||||
|
||||
entity.total_salary = all_all_emp.Sum(z => z.salary);
|
||||
entity.limit_frame_005_total = entity.total_salary * entity.limit_frame_005 / 100;
|
||||
entity.limit_frame_005_total_rounded = MyHelper.RoundOff(entity.limit_frame_005_total.Value, 10);
|
||||
//entity.total_salary = all_all_emp.Sum(z => z.salary);
|
||||
//entity.limit_frame_005_total = entity.total_salary * entity.limit_frame_005 / 100;
|
||||
//entity.limit_frame_005_total_rounded = MyHelper.RoundOff(entity.limit_frame_005_total.Value, 10);
|
||||
|
||||
entity.SetAutoField(_repository.Context);
|
||||
|
||||
|
||||
@@ -426,6 +426,8 @@ public static class MyHelper
|
||||
|
||||
public static decimal RoundOff(decimal i, decimal round_number)
|
||||
{
|
||||
return (Math.Round(i / round_number)) * round_number;
|
||||
string temp = i.ToString().Split(".")[0];
|
||||
|
||||
return Convert.ToDecimal(temp.Substring(0, temp.Length - 1)) * 10 + 10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ function funcCeilCalculateSalaryLimit(params) {
|
||||
var str_ceil = cal_ceil.toString();
|
||||
var split_ceil = str_ceil.split('');
|
||||
var num_last = Number(split_ceil[split_ceil.length - 1]);
|
||||
console.log(num_last);
|
||||
if (num_last) {
|
||||
after_cal = num_check - num_last;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user