แก้รอบเงินเดือนเดือนลูกจ้าง

This commit is contained in:
Kittapath 2024-03-19 09:46:52 +07:00
parent a2d109ab6a
commit dba2e15403
2 changed files with 31 additions and 19 deletions

View file

@ -762,7 +762,7 @@ export class SalaryPeriodController extends Controller {
pageSize: number;
keyword?: string;
type?: any;
isRetire?: boolean | null;
isRetire?: string | null;
},
) {
const salaryOrg = await this.salaryOrgRepository.findOne({
@ -780,7 +780,13 @@ export class SalaryPeriodController extends Controller {
qb.andWhere(body.type != null && body.type != "" ? `profile.type LIKE :type` : "1=1", {
type: body.type == null ? "" : `${body.type.toUpperCase()}`,
})
.andWhere(body.isRetire != null ? `profile.isRetired = ${body.isRetire}` : "1=1")
.andWhere(
body.isRetire != null
? body.isRetire == "1"
? `profile.isRetired = true`
: `profile.isRetired = false`
: "1=1",
)
.andWhere({
salaryOrgId: salaryOrg.id,
})