refactor: flowaccount move product code to front for product name
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s

This commit is contained in:
HAM 2025-09-19 16:09:21 +07:00
parent a9201f715a
commit 334fb57b46

View file

@ -461,7 +461,6 @@ const flowAccount = {
const commonBody = {
productStructureType: null,
type: 3,
code: `${code}`,
name: body.name,
sellDescription: body.detail,
sellVatType: 3,
@ -505,9 +504,9 @@ const flowAccount = {
};
const [sellId, agentId] = await Promise.all([
createProduct(`${body.name}`, body.price, /true/.test(`${body.vatIncluded}`)),
createProduct(`${code} ${body.name}`, body.price, /true/.test(`${body.vatIncluded}`)),
createProduct(
`${body.name} (ราคาตัวแทน)`,
`${code} ${body.name} (ราคาตัวแทน)`,
body.agentPrice,
/true/.test(`${body.agentPriceVatIncluded}`),
),
@ -573,10 +572,15 @@ const flowAccount = {
};
await Promise.all([
editProduct(sellPriceId, `${body.name}`, body.price, /true/.test(`${body.vatIncluded}`)),
editProduct(
sellPriceId,
`${body.code} ${body.name}`,
body.price,
/true/.test(`${body.vatIncluded}`),
),
editProduct(
agentPriceId,
`${body.name} (ราคาตัวแทน)`,
`${body.code} ${body.name} (ราคาตัวแทน)`,
body.agentPrice,
/true/.test(`${body.agentPriceVatIncluded}`),
),