diff --git a/src/services/flowaccount.ts b/src/services/flowaccount.ts index 6f131fe..df40d27 100644 --- a/src/services/flowaccount.ts +++ b/src/services/flowaccount.ts @@ -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}`), ),