fix: fixed branch no digit
This commit is contained in:
parent
8a1354ac2b
commit
88ac8c4b81
1 changed files with 3 additions and 3 deletions
|
|
@ -345,10 +345,10 @@ export class EmployeeController extends Controller {
|
||||||
async (tx) => {
|
async (tx) => {
|
||||||
const last = await tx.runningNo.upsert({
|
const last = await tx.runningNo.upsert({
|
||||||
where: {
|
where: {
|
||||||
key: `EMPLOYEE_${customerBranch.customer.code}-${customerBranch.branchNo}-${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")}`,
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
key: `EMPLOYEE_${customerBranch.customer.code}-${customerBranch.branchNo}-${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")}`,
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
update: { value: { increment: 1 } },
|
update: { value: { increment: 1 } },
|
||||||
|
|
@ -369,7 +369,7 @@ export class EmployeeController extends Controller {
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
...rest,
|
...rest,
|
||||||
code: `${customerBranch.customer.code}-${customerBranch.branchNo}-${new Date().getFullYear().toString().slice(-2).padStart(2, "0")}${last.value.toString().padStart(4, "0")}`,
|
code: `${customerBranch.customer.code}-${customerBranch.branchNo.toString().padStart(2, "0")}-${new Date().getFullYear().toString().slice(-2).padStart(2, "0")}${last.value.toString().padStart(4, "0")}`,
|
||||||
employeeWork: {
|
employeeWork: {
|
||||||
createMany: {
|
createMany: {
|
||||||
data: employeeWork || [],
|
data: employeeWork || [],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue