diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 67883db..c749880 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -150,7 +150,7 @@ export class SalaryPeriodController extends Controller { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขอเงินเดือนผู้ใช้งานนี้ในระบบ"); } - await this.salaryProfileRepository.remove(salaryProfile); + // await this.salaryProfileRepository.remove(salaryProfile); // หาจำนวน Quota คงเหลือ if (salaryProfile.salaryOrg.snapshot == "SNAP1") { @@ -175,7 +175,7 @@ export class SalaryPeriodController extends Controller { }) .getRawOne(); const calRemainAmount = salaryProfile?.salaryOrg.sixPercentAmount - sumAmountUse.totalAmount; - salaryProfile.salaryOrg.useAmount = sumAmountUse; + salaryProfile.salaryOrg.useAmount = sumAmountUse.totalAmount; salaryProfile.salaryOrg.remainingAmount = calRemainAmount; await this.salaryOrgRepository.save(salaryProfile?.salaryOrg); } @@ -309,7 +309,7 @@ export class SalaryPeriodController extends Controller { }) .getRawOne(); const calRemainAmount = salaryProfile?.salaryOrg.sixPercentAmount - sumAmountUse.totalAmount; - salaryProfile.salaryOrg.useAmount = sumAmountUse; + salaryProfile.salaryOrg.useAmount = sumAmountUse.totalAmount; salaryProfile.salaryOrg.remainingAmount = calRemainAmount; await this.salaryOrgRepository.save(salaryProfile?.salaryOrg); } @@ -366,7 +366,7 @@ export class SalaryPeriodController extends Controller { }) .getRawOne(); const calRemainAmount = salaryOrg.sixPercentAmount - sumAmountUse.totalAmount; - salaryOrg.useAmount = sumAmountUse; + salaryOrg.useAmount = sumAmountUse.totalAmount; salaryOrg.remainingAmount = calRemainAmount; await this.salaryOrgRepository.save(salaryOrg); } @@ -711,7 +711,7 @@ export class SalaryPeriodController extends Controller { }) .getRawOne(); const calRemainAmount = salaryOrg.sixPercentAmount - sumAmountUse.totalAmount; - salaryOrg.useAmount = sumAmountUse; + salaryOrg.useAmount = sumAmountUse.totalAmount; salaryOrg.remainingAmount = calRemainAmount; await this.salaryOrgRepository.save(salaryOrg); }