admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Quintiq file version 2.0
#parent: #root
StaticMethod GetSalary (
  const Unit owner,
  const OvertimeMultiplier overtimeMutiplier,
  Real overtime
) const as Real
{
  TextBody:
  [*
    // rislai Jul-10-2024 (created)
    value := 0.0;
    salaryByEmployeeTypeTree := NamedValueTree::Create();
    traverse( owner,EmployeeCost,cost ){
      salaryByEmployeeTypeHandle := salaryByEmployeeTypeTree.GetHandle( cost.EmployeeType().Name() );
      salary := guard( salaryByEmployeeTypeTree.Root().Child( salaryByEmployeeTypeHandle ),null( NamedValue ));
      // 产线人员类别1*人数*基本工资1/21.75/8*工作日加班时长*倍率1
      temp_salary := cost.EmployeeNumber() * cost.BaseSalary() / owner.MacroPlan().StandardWorkingDay() / 8 * overtime * overtimeMutiplier.Multiplier();
      if( not isnull( salary )){
        salary.SetValue( salary.GetValueAsReal() + temp_salary );
      }else{
        salaryByEmployeeTypeTree.Root().AddChild( salaryByEmployeeTypeHandle,temp_salary );
      }
      value := value + temp_salary;
    }
    return value;
  *]
}