fix: wrong cond

This commit is contained in:
Methapon2001 2024-06-13 16:54:42 +07:00
parent c302eafb83
commit c9d92c43f9

View file

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