From d606ec966cc42339c71ed968c2cddc86d34c9e4b Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 11 Apr 2024 17:22:20 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=88=E0=B8=B3?= =?UTF-8?q?=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B8=9C=E0=B8=B4=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index fd6a6c6..917e416 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -3855,15 +3855,18 @@ export class ReportController extends Controller { octSnap2.salaryProfiles.forEach((profile: any) => { switch (profile.type) { case "FULLHAFT": - fullHaftTotalAmount += profile.amount ?? 0; + // fullHaftTotalAmount += profile.amount ?? 0; + fullHaftTotalAmount += profile.amountUse > 0 ? profile.amountUse : 0; fullHaftCount++; break; case "FULL": - fullTotalAmount += profile.amount ?? 0; + // fullTotalAmount += profile.amount ?? 0; + fullTotalAmount += profile.amountUse > 0 ? profile.amountUse : 0; fullCount++; break; case "HAFT": - haftTotalAmount += profile.amount ?? 0; + // haftTotalAmount += profile.amount ?? 0; + haftTotalAmount += profile.amountUse > 0 ? profile.amountUse : 0; haftCount++; break; case "NONE": @@ -3908,9 +3911,11 @@ export class ReportController extends Controller { sixPercent: octSnap1 == null ? "" : Extension.ToThaiNumber(octSnap1.sixPercentAmount.toLocaleString()), remainingAmountApr: - aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.useAmount.toLocaleString()), //จำนวนเงินที่ใช้เลื่อนขั้นค่าจ้างไปแล้วในวันที่ 1 เม.ย. + // aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.useAmount.toLocaleString()), //จำนวนเงินที่ใช้เลื่อนขั้นค่าจ้างไปแล้วในวันที่ 1 เม.ย. + aprSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()), remainingAmountOct: - octSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()), //เหลือเงินใช้เลื่อนขั้นค่าจ้างในวันที่ 1 ต.ค. + //octSnap2 == null ? "" : Extension.ToThaiNumber(octSnap2.spentAmount.toLocaleString()), //เหลือเงินใช้เลื่อนขั้นค่าจ้างในวันที่ 1 ต.ค. + octSnap2 == null ? "" : Extension.ToThaiNumber((octSnap2.sixPercentAmount - octSnap2.spentAmount).toLocaleString()), totalOld: aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.total.toLocaleString()), //จำนวน(คน)(โควตาเลื่อนขั้นค่าจ้าง) fifteenPercentOld: aprSnap2 == null ? "" : Extension.ToThaiNumber(aprSnap2.fifteenPercent.toLocaleString()),