เก็บเงินพิเศษลูกจ้าง
This commit is contained in:
parent
9449a1f989
commit
f4c6831c0b
4 changed files with 167 additions and 29 deletions
|
|
@ -931,14 +931,14 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
relations: ["salaryProfiles"],
|
relations: ["salaryProfiles"],
|
||||||
});
|
});
|
||||||
if(salaryPeriod.period === 'APR'){
|
if (salaryPeriod.period === "APR") {
|
||||||
const salaryProfile = await this.salaryProfileRepository.find({
|
const salaryProfile = await this.salaryProfileRepository.find({
|
||||||
where: {
|
where: {
|
||||||
salaryOrgId: salaryOrg?.id,
|
salaryOrgId: salaryOrg?.id,
|
||||||
type: "FULL", //หนึ่งขั้น
|
type: "FULL", //หนึ่งขั้น
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
//รอบปีก่อนๆ
|
//รอบปีก่อนๆ
|
||||||
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1010,13 +1010,21 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const year = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)));
|
const year = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)));
|
||||||
const yearIncrease1 = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year-2)));
|
const yearIncrease1 = Extension.ToThaiNumber(
|
||||||
const yearIncrease2 = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year-1)));
|
String(Extension.ToThaiYear(salaryPeriod.year - 2)),
|
||||||
const fifteenPercent = salaryOrg?.fifteenPercent == undefined || salaryOrg?.fifteenPercent == null ?
|
);
|
||||||
"๐" : Extension.ToThaiNumber(String(salaryOrg?.fifteenPercent));
|
const yearIncrease2 = Extension.ToThaiNumber(
|
||||||
const fifteenPoint = salaryOrg?.fifteenPoint == undefined || salaryOrg?.fifteenPoint == null ?
|
String(Extension.ToThaiYear(salaryPeriod.year - 1)),
|
||||||
".๐๐" : "." + Extension.ToThaiNumber(String(salaryOrg?.fifteenPoint));
|
);
|
||||||
|
const fifteenPercent =
|
||||||
|
salaryOrg?.fifteenPercent == undefined || salaryOrg?.fifteenPercent == null
|
||||||
|
? "๐"
|
||||||
|
: Extension.ToThaiNumber(String(salaryOrg?.fifteenPercent));
|
||||||
|
const fifteenPoint =
|
||||||
|
salaryOrg?.fifteenPoint == undefined || salaryOrg?.fifteenPoint == null
|
||||||
|
? ".๐๐"
|
||||||
|
: "." + Extension.ToThaiNumber(String(salaryOrg?.fifteenPoint));
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: "gov1-03",
|
template: "gov1-03",
|
||||||
reportName: "gov1-03",
|
reportName: "gov1-03",
|
||||||
|
|
@ -1025,7 +1033,7 @@ export class ReportController extends Controller {
|
||||||
yearIncrease1: yearIncrease1,
|
yearIncrease1: yearIncrease1,
|
||||||
yearIncrease2: yearIncrease2,
|
yearIncrease2: yearIncrease2,
|
||||||
yearIncreaseSlice: yearIncrease2.slice(-2),
|
yearIncreaseSlice: yearIncrease2.slice(-2),
|
||||||
yearSlice: year.slice(-2),
|
yearSlice: year.slice(-2),
|
||||||
point: fifteenPercent + fifteenPoint,
|
point: fifteenPercent + fifteenPoint,
|
||||||
root: salaryProfile[0]?.root,
|
root: salaryProfile[0]?.root,
|
||||||
profile: salaryProfile.map((item, index) => ({
|
profile: salaryProfile.map((item, index) => ({
|
||||||
|
|
@ -1064,8 +1072,7 @@ export class ReportController extends Controller {
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
} else if (salaryPeriod.period === "OCT") {
|
||||||
else if(salaryPeriod.period === 'OCT'){
|
|
||||||
//find period APR
|
//find period APR
|
||||||
const salaryPeriod_APR = await this.salaryPeriodRepository.findOne({
|
const salaryPeriod_APR = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1079,23 +1086,23 @@ export class ReportController extends Controller {
|
||||||
salaryPeriodId: salaryPeriod_APR?.id,
|
salaryPeriodId: salaryPeriod_APR?.id,
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const salaryProfile_APR = await this.salaryProfileRepository.find({
|
const salaryProfile_APR = await this.salaryProfileRepository.find({
|
||||||
where: {
|
where: {
|
||||||
salaryOrgId: salaryOrg_APR?.id,
|
salaryOrgId: salaryOrg_APR?.id,
|
||||||
type: In(["HAFT","FULL"]),
|
type: In(["HAFT", "FULL"]),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
//end period APR
|
//end period APR
|
||||||
|
|
||||||
const salaryProfile = await this.salaryProfileRepository.find({
|
const salaryProfile = await this.salaryProfileRepository.find({
|
||||||
where: {
|
where: {
|
||||||
salaryOrgId: salaryOrg?.id,
|
salaryOrgId: salaryOrg?.id,
|
||||||
type: In(["FULLHAFT","FULL"]),
|
type: In(["FULLHAFT", "FULL"]),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
//รอบปีก่อนๆ
|
//รอบปีก่อนๆ
|
||||||
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1167,13 +1174,21 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const year = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)));
|
const year = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year)));
|
||||||
const yearIncrease1 = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year-2)));
|
const yearIncrease1 = Extension.ToThaiNumber(
|
||||||
const yearIncrease2 = Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year-1)));
|
String(Extension.ToThaiYear(salaryPeriod.year - 2)),
|
||||||
const fifteenPercent = salaryOrg?.fifteenPercent == undefined || salaryOrg?.fifteenPercent == null ?
|
);
|
||||||
"๐" : Extension.ToThaiNumber(String(salaryOrg?.fifteenPercent));
|
const yearIncrease2 = Extension.ToThaiNumber(
|
||||||
const fifteenPoint = salaryOrg?.fifteenPoint == undefined || salaryOrg?.fifteenPoint == null ?
|
String(Extension.ToThaiYear(salaryPeriod.year - 1)),
|
||||||
".๐๐" : "." + Extension.ToThaiNumber(String(salaryOrg?.fifteenPoint));
|
);
|
||||||
|
const fifteenPercent =
|
||||||
|
salaryOrg?.fifteenPercent == undefined || salaryOrg?.fifteenPercent == null
|
||||||
|
? "๐"
|
||||||
|
: Extension.ToThaiNumber(String(salaryOrg?.fifteenPercent));
|
||||||
|
const fifteenPoint =
|
||||||
|
salaryOrg?.fifteenPoint == undefined || salaryOrg?.fifteenPoint == null
|
||||||
|
? ".๐๐"
|
||||||
|
: "." + Extension.ToThaiNumber(String(salaryOrg?.fifteenPoint));
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: "gov2-03",
|
template: "gov2-03",
|
||||||
reportName: "gov2-03",
|
reportName: "gov2-03",
|
||||||
|
|
@ -1182,7 +1197,7 @@ export class ReportController extends Controller {
|
||||||
yearIncrease1: yearIncrease1,
|
yearIncrease1: yearIncrease1,
|
||||||
yearIncrease2: yearIncrease2,
|
yearIncrease2: yearIncrease2,
|
||||||
yearIncreaseSlice: yearIncrease2.slice(-2),
|
yearIncreaseSlice: yearIncrease2.slice(-2),
|
||||||
yearSlice: year.slice(-2),
|
yearSlice: year.slice(-2),
|
||||||
point: fifteenPercent + fifteenPoint,
|
point: fifteenPercent + fifteenPoint,
|
||||||
root: salaryProfile[0]?.root,
|
root: salaryProfile[0]?.root,
|
||||||
profile: salaryProfile.map((item, index) => ({
|
profile: salaryProfile.map((item, index) => ({
|
||||||
|
|
@ -1219,8 +1234,8 @@ export class ReportController extends Controller {
|
||||||
salaryIncreaseAPR:
|
salaryIncreaseAPR:
|
||||||
salaryProfile_APR.length > 0
|
salaryProfile_APR.length > 0
|
||||||
? salaryProfile_APR
|
? salaryProfile_APR
|
||||||
.filter((profile) => profile.citizenId === item.citizenId)
|
.filter((profile) => profile.citizenId === item.citizenId)
|
||||||
.map((profile) => profile.amount)
|
.map((profile) => profile.amount)
|
||||||
: "๐", //การเลื่อนเงินเดือนรอบเมษา
|
: "๐", //การเลื่อนเงินเดือนรอบเมษา
|
||||||
Type: item.type === "FULL" ? "หนึ่งขั้น" : "หนึ่งขั้นครึ่ง",
|
Type: item.type === "FULL" ? "หนึ่งขั้น" : "หนึ่งขั้นครึ่ง",
|
||||||
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
||||||
|
|
@ -1935,6 +1950,7 @@ export class ReportController extends Controller {
|
||||||
const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({
|
const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
|
type: "FULL",
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP1",
|
snapshot: "SNAP1",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
|
|
@ -1982,6 +1998,7 @@ export class ReportController extends Controller {
|
||||||
posNumber:
|
posNumber:
|
||||||
profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()),
|
||||||
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null,
|
||||||
|
score: null,
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -2023,6 +2040,7 @@ export class ReportController extends Controller {
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
||||||
|
isNext: false,
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
|
|
@ -2100,6 +2118,7 @@ export class ReportController extends Controller {
|
||||||
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
relations: ["salaryOrg", "salaryOrg.salaryPeriod"],
|
||||||
where: {
|
where: {
|
||||||
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
type: In(["HAFT", "FULL", "FULLHAFT"]),
|
||||||
|
isNext: true,
|
||||||
salaryOrg: {
|
salaryOrg: {
|
||||||
snapshot: "SNAP2",
|
snapshot: "SNAP2",
|
||||||
rootId: rootId,
|
rootId: rootId,
|
||||||
|
|
@ -2142,6 +2161,10 @@ export class ReportController extends Controller {
|
||||||
positionSalaryAmount: profile.positionSalaryAmount
|
positionSalaryAmount: profile.positionSalaryAmount
|
||||||
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString())
|
||||||
: null,
|
: null,
|
||||||
|
amountSpecial:
|
||||||
|
profile.amountSpecial > 0
|
||||||
|
? "(" + Extension.ToThaiNumber(profile.amountSpecial.toString()) + ")"
|
||||||
|
: "",
|
||||||
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
|
score: null, //สรุปผลการประเมินฯ ระดับและคะแนน
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -346,16 +346,48 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
||||||
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
||||||
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
||||||
|
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
||||||
|
if (salaryRankAmountMax != null) {
|
||||||
|
if (step - salaryRankAmountMax.step <= 0.5) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.2;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.2;
|
||||||
|
} else if (step - salaryRankAmountMax.step <= 1) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.4;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.4;
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.6;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.6;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse = salaryRanks.salaryMonth - salaryProfile.amount;
|
salaryProfile.amountUse = salaryRanks.salaryMonth - salaryProfile.amount;
|
||||||
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
||||||
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
||||||
salaryProfile.groupNew = group;
|
salaryProfile.groupNew = group;
|
||||||
salaryProfile.salaryLevelNew = step;
|
salaryProfile.salaryLevelNew = step;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse = 0;
|
salaryProfile.amountUse = 0;
|
||||||
salaryProfile.positionSalaryAmount = salaryProfile.amount;
|
salaryProfile.positionSalaryAmount = salaryProfile.amount;
|
||||||
|
salaryProfile.positionSalaryDayAmount = 0;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
||||||
|
|
@ -644,18 +676,49 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
||||||
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
||||||
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
||||||
|
if (salaryRankAmountMax != null) {
|
||||||
|
if (step - salaryRankAmountMax.step <= 0.5) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.2;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.2;
|
||||||
|
} else if (step - salaryRankAmountMax.step <= 1) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.4;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.4;
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.6;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.6;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse =
|
salaryProfile.amountUse =
|
||||||
salaryRanks.salaryMonth - (salaryProfile.amount == null ? 0 : salaryProfile.amount);
|
salaryRanks.salaryMonth - (salaryProfile.amount == null ? 0 : salaryProfile.amount);
|
||||||
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
||||||
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
||||||
salaryProfile.groupNew = group;
|
salaryProfile.groupNew = group;
|
||||||
salaryProfile.salaryLevelNew = step;
|
salaryProfile.salaryLevelNew = step;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse = 0;
|
salaryProfile.amountUse = 0;
|
||||||
salaryProfile.positionSalaryAmount =
|
salaryProfile.positionSalaryAmount =
|
||||||
salaryProfile.amount == null ? 0 : salaryProfile.amount;
|
salaryProfile.amount == null ? 0 : salaryProfile.amount;
|
||||||
|
salaryProfile.positionSalaryDayAmount = 0;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
||||||
|
|
@ -1000,18 +1063,49 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
salaryRankAmountMax == null ? 0 : salaryRankAmountMax.salaryDay;
|
||||||
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
salaryProfile.groupNew = salaryFormula.salaryEmployee.group;
|
||||||
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
salaryProfile.salaryLevelNew = salaryRankAmountMax == null ? 0 : salaryRankAmountMax.step;
|
||||||
|
if (salaryRankAmountMax != null) {
|
||||||
|
if (step - salaryRankAmountMax.step <= 0.5) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.2;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.2;
|
||||||
|
} else if (step - salaryRankAmountMax.step <= 1) {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.4;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.4;
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0.6;
|
||||||
|
salaryProfile.amountSpecial =
|
||||||
|
salaryRankAmountMax == null || salaryRankAmountMax.salaryMonth == null
|
||||||
|
? 0
|
||||||
|
: salaryRankAmountMax.salaryMonth * 0.6;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse =
|
salaryProfile.amountUse =
|
||||||
salaryRanks.salaryMonth - (salaryProfile.amount == null ? 0 : salaryProfile.amount);
|
salaryRanks.salaryMonth - (salaryProfile.amount == null ? 0 : salaryProfile.amount);
|
||||||
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
salaryProfile.positionSalaryAmount = salaryRanks.salaryMonth;
|
||||||
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
salaryProfile.positionSalaryDayAmount = salaryRanks.salaryDay;
|
||||||
salaryProfile.groupNew = group;
|
salaryProfile.groupNew = group;
|
||||||
salaryProfile.salaryLevelNew = step;
|
salaryProfile.salaryLevelNew = step;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
salaryProfile.isNext = false;
|
||||||
salaryProfile.amountUse = 0;
|
salaryProfile.amountUse = 0;
|
||||||
salaryProfile.positionSalaryAmount =
|
salaryProfile.positionSalaryAmount =
|
||||||
salaryProfile.amount == null ? 0 : salaryProfile.amount;
|
salaryProfile.amount == null ? 0 : salaryProfile.amount;
|
||||||
|
salaryProfile.positionSalaryDayAmount = 0;
|
||||||
|
salaryProfile.positionSalaryAmountPer = 0;
|
||||||
|
salaryProfile.amountSpecial = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ประเภทการเลื่อนขึ้นเงินเดือนไม่ถูกต้อง");
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,13 @@ export class SalaryProfileEmployee extends EntityBase {
|
||||||
})
|
})
|
||||||
positionSalaryAmount: number;
|
positionSalaryAmount: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "double",
|
||||||
|
comment: "เปอร์เซ็นเงินพิเศษ",
|
||||||
|
default: 0,
|
||||||
|
})
|
||||||
|
positionSalaryAmountPer: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "double",
|
type: "double",
|
||||||
comment: "เงินเดือนหลังเลื่อน(รายวัน)",
|
comment: "เงินเดือนหลังเลื่อน(รายวัน)",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableProfileemployeeAddGroupNew21711081845764 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableProfileemployeeAddGroupNew21711081845764'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` ADD \`positionSalaryAmountPer\` double NOT NULL COMMENT 'เปอร์เซ็นเงินพิเศษ' DEFAULT '0'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` DROP COLUMN \`positionSalaryAmountPer\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue