Merge branch 'develop' of github.com:Frappet/bma-ehr-salary into develop
This commit is contained in:
commit
dc8b7f815a
1 changed files with 81 additions and 2 deletions
|
|
@ -912,6 +912,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({
|
||||
template: "gov1-03",
|
||||
reportName: "gov1-03",
|
||||
|
|
@ -937,8 +1008,16 @@ export class ReportController extends Controller {
|
|||
item.amount == undefined || item.amount == null
|
||||
? "๐"
|
||||
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
|
||||
salaryIncrease1: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||
salaryIncrease2: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||
salaryIncrease1: salaryProfile1.length > 0 ?
|
||||
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, //ผลการประเมินฯ
|
||||
remark: null, //หมายเหตุ
|
||||
})),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue