เลื่อนเงินเดือนปีก่อนหน้า
This commit is contained in:
parent
3d6ceb2229
commit
0dcc5c0ac0
1 changed files with 81 additions and 2 deletions
|
|
@ -534,6 +534,77 @@ export class ReportController extends Controller {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//รอบปีก่อนๆ
|
||||||
|
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: {
|
||||||
|
period: "APR",
|
||||||
|
year: salaryPeriod.year - 2,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const salaryPeriodIncrease1_OCT = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: {
|
||||||
|
period: "OCT",
|
||||||
|
year: salaryPeriod.year - 2,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const salaryOrg1_APR = await this.salaryOrgRepository.findOne({
|
||||||
|
where: {
|
||||||
|
salaryPeriodId: salaryPeriodIncrease1_APR?.id,
|
||||||
|
rootId: rootId,
|
||||||
|
snapshot: "SNAP2",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const salaryOrg1_OCT = await this.salaryOrgRepository.findOne({
|
||||||
|
where: {
|
||||||
|
salaryPeriodId: salaryPeriodIncrease1_OCT?.id,
|
||||||
|
rootId: rootId,
|
||||||
|
snapshot: "SNAP2",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const salaryProfile1 = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In([salaryOrg1_APR?.id, salaryOrg1_OCT?.id]),
|
||||||
|
type: "FULL",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//รอบปีก่อนหน้า
|
||||||
|
const salaryPeriodIncrease2_APR = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: {
|
||||||
|
period: "APR",
|
||||||
|
year: salaryPeriod.year - 1,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const salaryPeriodIncrease2_OCT = await this.salaryPeriodRepository.findOne({
|
||||||
|
where: {
|
||||||
|
period: "OCT",
|
||||||
|
year: salaryPeriod.year - 1,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const salaryOrg2_APR = await this.salaryOrgRepository.findOne({
|
||||||
|
where: {
|
||||||
|
salaryPeriodId: salaryPeriodIncrease2_APR?.id,
|
||||||
|
rootId: rootId,
|
||||||
|
snapshot: "SNAP2",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const salaryOrg2_OCT = await this.salaryOrgRepository.findOne({
|
||||||
|
where: {
|
||||||
|
salaryPeriodId: salaryPeriodIncrease2_OCT?.id,
|
||||||
|
rootId: rootId,
|
||||||
|
snapshot: "SNAP2",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const salaryProfile2 = await this.salaryProfileRepository.find({
|
||||||
|
where: {
|
||||||
|
salaryOrgId: In([salaryOrg2_APR?.id, salaryOrg2_OCT?.id]),
|
||||||
|
type: "FULL",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: "gov1-03",
|
template: "gov1-03",
|
||||||
reportName: "gov1-03",
|
reportName: "gov1-03",
|
||||||
|
|
@ -555,8 +626,16 @@ export class ReportController extends Controller {
|
||||||
item.amount == undefined || item.amount == null
|
item.amount == undefined || item.amount == null
|
||||||
? "๐"
|
? "๐"
|
||||||
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
|
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
|
||||||
salaryIncrease1: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
salaryIncrease1: salaryProfile1.length > 0 ?
|
||||||
salaryIncrease2: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
salaryProfile1
|
||||||
|
.filter(profile => profile.citizenId === item.citizenId)
|
||||||
|
.map(profile => profile.amount)
|
||||||
|
: "๐", //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||||
|
salaryIncrease2: salaryProfile2.length > 0 ?
|
||||||
|
salaryProfile2
|
||||||
|
.filter(profile => profile.citizenId === item.citizenId)
|
||||||
|
.map(profile => profile.amount)
|
||||||
|
: "๐", //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||||
score: null, //ผลการประเมินฯ
|
score: null, //ผลการประเมินฯ
|
||||||
remark: null, //หมายเหตุ
|
remark: null, //หมายเหตุ
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue