fix: code always update on customer type CORP
This commit is contained in:
parent
bd425554a1
commit
be8f8d462f
1 changed files with 5 additions and 1 deletions
|
|
@ -582,7 +582,11 @@ export class EmployeeController extends Controller {
|
||||||
const record = await prisma.$transaction(async (tx) => {
|
const record = await prisma.$transaction(async (tx) => {
|
||||||
let code: string | undefined;
|
let code: string | undefined;
|
||||||
|
|
||||||
if (customerBranch && customerBranch.id !== employee.customerBranchId) {
|
if (
|
||||||
|
customerBranchId !== undefined &&
|
||||||
|
customerBranch &&
|
||||||
|
customerBranch.id !== employee.customerBranchId
|
||||||
|
) {
|
||||||
const last = await tx.runningNo.upsert({
|
const last = await tx.runningNo.upsert({
|
||||||
where: {
|
where: {
|
||||||
key: `EMPLOYEE_${customerBranch.customer.code}-${customerBranch.branchNo.toString().padStart(2, "0")}-${new Date().getFullYear().toString().slice(-2).padStart(2, "0")}`,
|
key: `EMPLOYEE_${customerBranch.customer.code}-${customerBranch.branchNo.toString().padStart(2, "0")}-${new Date().getFullYear().toString().slice(-2).padStart(2, "0")}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue