diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index f3ae545..22be2bf 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -2276,7 +2276,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["NONE"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2532,6 +2532,7 @@ export class ReportController extends Controller { relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { type: In(["HAFT", "FULL", "FULLHAFT"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2767,7 +2768,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["HAFT", "FULL", "FULLHAFT"]), + isNext: true, salaryOrg: { snapshot: "SNAP2", rootId: rootId, @@ -2806,9 +2807,17 @@ export class ReportController extends Controller { posLevel: `${profile.posTypeShort} ${profile.posLevel}`, posNumber: profile.orgShortName + Extension.ToThaiNumber(profile.posMasterNo.toLocaleString()), - amount: profile.amount ? Extension.ToThaiNumber(profile.amount.toLocaleString()) : null, - precentTwo: null, //ร้อยละ 2 - precentFour: null, //ร้อยละ 4 + amount: profile.positionSalaryAmount + ? Extension.ToThaiNumber(profile.positionSalaryAmount.toLocaleString()) + : null, + precentTwo: + profile.positionSalaryAmountPer == 0.2 + ? profile.positionSalaryAmount * profile.positionSalaryAmountPer + : null, //ร้อยละ 2 + precentFour: + profile.positionSalaryAmountPer == 0.4 + ? profile.positionSalaryAmount * profile.positionSalaryAmountPer + : null, //ร้อยละ 4 reason: null, // หมายเหตุ }; }); @@ -2842,7 +2851,7 @@ export class ReportController extends Controller { const _salaryPeriod = await this.salaryProfileEmployeeRepository.find({ relations: ["salaryOrg", "salaryOrg.salaryPeriod"], where: { - type: In(["NONE"]), + isNext: false, salaryOrg: { snapshot: "SNAP2", rootId: rootId,