From c9d92c43f9368e65c2b1d52300a8093de00c3803 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:54:42 +0700 Subject: [PATCH] fix: wrong cond --- src/controllers/employee-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/employee-controller.ts b/src/controllers/employee-controller.ts index 5b98bda..ed3df82 100644 --- a/src/controllers/employee-controller.ts +++ b/src/controllers/employee-controller.ts @@ -518,7 +518,7 @@ export class EmployeeController extends Controller { const record = await prisma.$transaction(async (tx) => { let code: string | undefined; - if (customerBranch && customerBranch.id !== customerBranchId) { + if (customerBranch && customerBranch.id !== employee.customerBranchId) { const last = await tx.runningNo.upsert({ where: { key: `EMPLOYEE_${customerBranch.customer.code}-${customerBranch.branchNo.toString().padStart(2, "0")}-${new Date().getFullYear().toString().slice(-2).padStart(2, "0")}`,