This commit is contained in:
AdisakKanthawilang 2024-02-29 15:33:17 +07:00
parent 43a8c8c8f0
commit 8b81afe00d

View file

@ -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);
}