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")}`,