คำสั่งเลื่อนเงินเดือนรอบตุลาคม (gov2-08)

This commit is contained in:
Bright 2024-04-10 11:14:57 +07:00
parent 0d42cf022c
commit 11890b4231

View file

@ -2076,9 +2076,9 @@ export class ReportController extends Controller {
// } // }
/** /**
* API * API
* *
* @summary * @summary
* *
* @param {string} rootId Guid, *Id Root * @param {string} rootId Guid, *Id Root
* @param {string} salaryPeriodId Guid, *Id Period * @param {string} salaryPeriodId Guid, *Id Period
@ -2088,6 +2088,7 @@ export class ReportController extends Controller {
const salaryPeriod = await this.salaryPeriodRepository.findOne({ const salaryPeriod = await this.salaryPeriodRepository.findOne({
where: { where: {
id: salaryPeriodId, id: salaryPeriodId,
isActive: true
}, },
}); });
@ -2102,7 +2103,7 @@ export class ReportController extends Controller {
rootId: rootId, rootId: rootId,
salaryPeriodId: salaryPeriodId, salaryPeriodId: salaryPeriodId,
salaryPeriod: { salaryPeriod: {
period: "APR", period: salaryPeriod.period === "APR" ? "APR" : "OCT",
}, },
}, },
}, },
@ -2152,18 +2153,22 @@ export class ReportController extends Controller {
`${item.type === "FULL" ? "หนึ่งขั้น" : ""}\n` + `${item.type === "FULL" ? "หนึ่งขั้น" : ""}\n` +
`${item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : ""}\n` + `${item.type === "FULLHAFT" ? "หนึ่งขั้นครึ่ง" : ""}\n` +
`${item.amountSpecial > 0 ? "ได้รับค่าตอบแทนพิเศษ\n" : ""}` + `${item.amountSpecial > 0 ? "ได้รับค่าตอบแทนพิเศษ\n" : ""}` +
`${item.isNext === true ? "(ได้รับเงินเดือนสูงกว่าขั้นสูงฯ)" : ""}`, // ห `${item.isNext === true ? "(ได้รับเงินเดือนสูงกว่าขั้นสูงฯ)" : ""}`,
})); }));
return new HttpSuccess({ return new HttpSuccess({
template: "gov1-07", template: salaryPeriod.period === "APR" ? "gov1-07" : "gov2-08",
reportName: "gov1-07", reportName: salaryPeriod.period === "APR" ? "gov1-07" : "gov2-08",
data: { data: {
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))), year: Extension.ToThaiNumber(String(Extension.ToThaiYear(salaryPeriod.year))),
yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()), yearOld: Extension.ToThaiNumber((salaryPeriod.year + 542).toString()),
date: Extension.ToThaiNumber( date: salaryPeriod.period === "APR"
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)), ? Extension.ToThaiNumber(
), Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-04-01`)),
)
: Extension.ToThaiNumber(
Extension.ToThaiFullDate(new Date(`${salaryPeriod.year}-10-01`)),
),
agency: root, agency: root,
data: formattedData, data: formattedData,
}, },