เพิ่มหมายเหตุ

This commit is contained in:
Kittapath 2024-07-08 09:21:24 +07:00
parent 9ac38618df
commit 9e2f87e7b3
7 changed files with 204 additions and 162 deletions

View file

@ -615,19 +615,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;
@ -674,19 +674,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;
@ -929,7 +929,9 @@ export class SalaryPeriodEmployeeController extends Controller {
* @param {string} type NONE-> HAFT-> FULL->1 FULLHAFT->1.5
*/
@Post("change/type")
async changeType(@Body() body: { profileId: string; type: string; isReserve: boolean }) {
async changeType(
@Body() body: { profileId: string; type: string; isReserve: boolean; remark?: string | null },
) {
const salaryProfile = await this.salaryProfileRepository.findOne({
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
where: { id: body.profileId },
@ -989,6 +991,8 @@ export class SalaryPeriodEmployeeController extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบระดับตำแหน่ง");
}
salaryProfile.type = body.type;
let _null: any = null;
salaryProfile.remark = body.remark == null ? _null : body.remark;
let type = salaryProfile.type;
if (type == "NONE") {
@ -1216,19 +1220,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;
@ -1278,19 +1282,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;
@ -1866,19 +1870,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;
@ -1927,19 +1931,19 @@ export class SalaryPeriodEmployeeController extends Controller {
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.02;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.02);
} else if (step - salaryRankAmountMax.step <= 1) {
salaryProfile.positionSalaryAmountPer = 0.04;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.04;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.04);
} else {
salaryProfile.positionSalaryAmountPer = 0.06;
salaryProfile.amountSpecial =
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
? 0
: salaryRankAmountMax.salaryMonth * 0.06;
: Math.floor(salaryRankAmountMax.salaryMonth * 0.06);
}
} else {
salaryProfile.positionSalaryAmountPer = 0;