fix: customer code should not have company code
This commit is contained in:
parent
06d4647462
commit
3a8bb7a82d
2 changed files with 4 additions and 4 deletions
|
|
@ -390,8 +390,8 @@ export class CustomerBranchController extends Controller {
|
|||
},
|
||||
data: {
|
||||
...rest,
|
||||
code: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${`${last.value - 1}`.padStart(2, "0")}`,
|
||||
codeCustomer: runningKey.replace("CUSTOMER_BRANCH_", ""),
|
||||
code: `${runningKey.replace(`CUSTOMER_BRANCH_${company}_`, "")}-${`${last.value - 1}`.padStart(2, "0")}`,
|
||||
codeCustomer: runningKey.replace(`CUSTOMER_BRANCH_${company}_`, ""),
|
||||
customer: { connect: { id: customerId } },
|
||||
province: { connect: provinceId ? { id: provinceId } : undefined },
|
||||
district: { connect: districtId ? { id: districtId } : undefined },
|
||||
|
|
|
|||
|
|
@ -298,8 +298,8 @@ export class CustomerController extends Controller {
|
|||
branch: {
|
||||
create: branch.map((v, i) => ({
|
||||
...v,
|
||||
code: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${`${last.value - branch.length + i}`.padStart(2, "0")}`,
|
||||
codeCustomer: runningKey.replace("CUSTOMER_BRANCH_", ""),
|
||||
code: `${runningKey.replace(`CUSTOMER_BRANCH_${company}_`, "")}-${`${last.value - branch.length + i}`.padStart(2, "0")}`,
|
||||
codeCustomer: runningKey.replace(`CUSTOMER_BRANCH_${company}_`, ""),
|
||||
province: connectOrNot(v.provinceId),
|
||||
provinceId: undefined,
|
||||
district: connectOrNot(v.districtId),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue