@softwear/latestcollectioncore 1.0.129 → 1.0.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/edifact.js CHANGED
@@ -68,7 +68,7 @@ const pricatToCsv = function (pricat) {
68
68
  if (!pricat || pricat.length == 0)
69
69
  return '';
70
70
  const env = pricat[0];
71
- const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, env.InterchangeReference, 0, '"FUEB 5.00"', null, null, null, null, null];
71
+ const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, `"${env.InterchangeReference}"`, 0, '"FUEB 5.00"', null, null, null, null, null];
72
72
  const envString = envValues.join(',') + '\n';
73
73
  const hdr = pricat[1];
74
74
  const hdrValues = [
@@ -337,7 +337,7 @@ const ordRspToCsv = function (order) {
337
337
  if (!order || order.length == 0)
338
338
  return '';
339
339
  const env = order[0];
340
- const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, env.InterchangeReference, 0, '"FUEB 5.00"', null, null, null, null, null];
340
+ const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, `"${env.InterchangeReference}"`, 0, '"FUEB 5.00"', null, null, null, null, null];
341
341
  const envString = envValues.join(',') + '\n';
342
342
  const hdr = order[1];
343
343
  const hdrValues = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.129",
3
+ "version": "1.0.130",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/edifact.ts CHANGED
@@ -62,7 +62,7 @@ const skusToPricat = function (skus: MarkedSkuI[], fromGLN: string, toGLN: strin
62
62
  const pricatToCsv = function (pricat: any): string {
63
63
  if (!pricat || pricat.length == 0) return ''
64
64
  const env = pricat[0]
65
- const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, env.InterchangeReference, 0, '"FUEB 5.00"', null, null, null, null, null]
65
+ const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, `"${env.InterchangeReference}"`, 0, '"FUEB 5.00"', null, null, null, null, null]
66
66
  const envString = envValues.join(',') + '\n'
67
67
 
68
68
  const hdr = pricat[1]
@@ -339,7 +339,7 @@ const itemsToOrdRsp = function (
339
339
  const ordRspToCsv = function (order: any): string {
340
340
  if (!order || order.length == 0) return ''
341
341
  const env = order[0]
342
- const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, env.InterchangeReference, 0, '"FUEB 5.00"', null, null, null, null, null]
342
+ const envValues = ['"ENV"', env.SenderGLN, env.RecipientGLN, `"${env.InterchangeReference}"`, 0, '"FUEB 5.00"', null, null, null, null, null]
343
343
  const envString = envValues.join(',') + '\n'
344
344
 
345
345
  const hdr = order[1]
@@ -89,7 +89,7 @@ describe('edifact pricat', () => {
89
89
  const pricat = skusToPricat(primadonnaSkus, '1234567890123', '3210987654321', '1122334455667', 12345, '20240315')
90
90
  const csv = pricatToCsv(pricat).split('\n')
91
91
  expect(pricatToCsv([])).to.be.deep.equal('')
92
- expect(csv[0]).to.be.deep.equal('"ENV",1234567890123,3210987654321,12345,0,"FUEB 5.00",,,,,')
92
+ expect(csv[0]).to.be.deep.equal('"ENV",1234567890123,3210987654321,"12345",0,"FUEB 5.00",,,,,')
93
93
  expect(csv[1]).to.be.deep.equal('"HDR","9",,"Via LatestCollection:primadonna","9",20240315,,,,,,"EUR",,,,1122334455667,,,,,,,,,,,,,,,,,3210987654321,,,,,,,,,,,,,,')
94
94
  expect(csv[2]).to.be.deep.equal('"GRP","3",,"91",')
95
95
  expect(csv[3]).to.be.deep.equal(
@@ -192,7 +192,7 @@ describe('edifact ordrsp', () => {
192
192
  const order = itemsToOrdRsp(testOrderItems, '1234567890123', '3210987654321', '1122334455667', '1231231231231', 12345, '20240315', 'ORD-12345')
193
193
  const csv = ordRspToCsv(order).split('\n')
194
194
  expect(ordRspToCsv([])).to.be.deep.equal('')
195
- expect(csv[0]).to.be.deep.equal('"ENV",1234567890123,3210987654321,12345,0,"FUEB 5.00",,,,,')
195
+ expect(csv[0]).to.be.deep.equal('"ENV",1234567890123,3210987654321,"12345",0,"FUEB 5.00",,,,,')
196
196
  expect(csv[1]).to.be.deep.equal(
197
197
  '"HDR","231","29","12345",20240315,,,,,,,,"ORD-12345",,,,,,,,,"EUR",1122334455667,,,,,,,,,3210987654321,,,,,,,,,1231231231231,,,,,,,,,,,,,,,,,,1231231231231,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'
198
198
  )