ts-glitter 21.8.4 → 21.8.7

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.
Files changed (38) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/POS-setting.js +18 -6
  4. package/lowcode/cms-plugin/POS-setting.ts +22 -10
  5. package/lowcode/cms-plugin/pos-pages/payment-page.js +9 -2
  6. package/lowcode/cms-plugin/pos-pages/payment-page.ts +11 -3
  7. package/lowcode/cms-plugin/stock-stores.js +55 -0
  8. package/lowcode/cms-plugin/stock-stores.ts +59 -0
  9. package/lowcode/editor/basic-component.js +10 -0
  10. package/lowcode/editor/basic-component.ts +11 -1
  11. package/lowcode/glitterBundle/plugins/html-render.js +0 -2
  12. package/lowcode/glitterBundle/plugins/html-render.ts +0 -1
  13. package/lowcode/jspage/function-page/setting_editor.js +1 -1
  14. package/lowcode/jspage/function-page/setting_editor.ts +1 -1
  15. package/lowcode/jspage/function-page/tool-setting.js +1 -5
  16. package/lowcode/jspage/function-page/tool-setting.ts +5 -4
  17. package/lowcode/jspage/main.js +1 -6
  18. package/lowcode/jspage/main.ts +1 -6
  19. package/lowcode/modules/image-library.js +0 -1
  20. package/lowcode/modules/image-library.ts +1 -1
  21. package/lowcode/official_view_component/official/component.js +1 -1
  22. package/lowcode/official_view_component/official/component.ts +1 -1
  23. package/lowcode/public-components/banner/first-banner.js +50 -85
  24. package/lowcode/public-components/banner/first-banner.ts +59 -96
  25. package/lowcode/public-components/layout-plugin/social-links-01.js +55 -34
  26. package/lowcode/public-components/layout-plugin/social-links-01.ts +68 -43
  27. package/package.json +1 -1
  28. package/src/api-public/services/checkout-event.js +75 -40
  29. package/src/api-public/services/checkout-event.js.map +1 -1
  30. package/src/api-public/services/checkout-event.ts +82 -31
  31. package/src/api-public/services/data-analyze.d.ts +1 -1
  32. package/src/api-public/services/shopping.d.ts +1 -0
  33. package/src/api-public/services/shopping.js +60 -49
  34. package/src/api-public/services/shopping.js.map +1 -1
  35. package/src/api-public/services/shopping.ts +87 -62
  36. package/src/services/saas-table-check.js +1 -1
  37. package/src/services/saas-table-check.js.map +1 -1
  38. package/src/services/saas-table-check.ts +1 -1
@@ -33,17 +33,33 @@ export class SocialLinks01 {
33
33
  };
34
34
  const gotoTopImg = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/arrow-up-to-line-light.svg';
35
35
  gvc.addStyle(css`
36
- .floating-action-panel {
37
- position: fixed;
38
- bottom: 30px;
39
- right: 30px;
40
- display: flex;
41
- flex-direction: column; /* 垂直排列 */
42
- align-items: center;
43
- gap: 10px; /* 按鈕間距 */
44
- z-index: 1000;
36
+ @media (max-width: 768px) {
37
+ .floating-action-panel {
38
+ position: fixed;
39
+ bottom: 20px;
40
+ right: 10px;
41
+ display: flex;
42
+ flex-direction: column; /* 垂直排列 */
43
+ align-items: center;
44
+ gap: 10px; /* 按鈕間距 */
45
+ z-index: 1000;
46
+ }
47
+ }
48
+
49
+ @media (min-width: 769px) {
50
+ .floating-action-panel {
51
+ position: fixed;
52
+ bottom: 30px;
53
+ right: 30px;
54
+ display: flex;
55
+ flex-direction: column; /* 垂直排列 */
56
+ align-items: center;
57
+ gap: 10px; /* 按鈕間距 */
58
+ z-index: 1000;
59
+ }
45
60
  }
46
61
 
62
+
47
63
  .social-links {
48
64
  display: flex;
49
65
  flex-direction: column;
@@ -69,56 +85,64 @@ export class SocialLinks01 {
69
85
  border: none;
70
86
  padding: 2px;
71
87
  cursor: pointer;
88
+ width: 40px;
89
+ height: 40px;
72
90
  border-radius: 50%;
73
91
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
74
92
  }
75
93
 
76
- .component-img {
77
- width: 40px;
78
- height: 40px;
79
- object-fit: contain;
80
- }
81
94
 
82
- .component-circle:hover .component-img {
95
+
96
+ .component-circle:hover {
83
97
  opacity: 0.8;
84
98
  }
85
99
 
86
100
  .up-to-top.hidden {
87
- display: none;
101
+ display: none !important;
88
102
  }
89
103
  `);
104
+
90
105
  return gvc.bindView({
91
106
  bind:vm.id,
92
107
  view:()=>{
93
108
  return html`
94
- <div class="floating-action-panel">
95
- <div class="social-links">
96
- ${socialList
97
- .map(socialLink => {
98
- const imgSrc = supportSocial.includes(socialLink.social_type)
99
- ? socialIMG[socialLink.social_type]
100
- : socialIMG.other;
101
- return html`
102
- <a href="${socialLink.link}" class="component-circle">
103
- <img src="${socialLink.icon??imgSrc}" alt="Go to top" class="component-img" />
104
- </a>
105
- `;
106
- })
107
- .join('')}
108
- </div>
109
- <button
110
- class="component-circle up-to-top hidden"
111
- onclick="${gvc.event(() => {
112
- scrollToTop();
113
- })}"
114
- >
115
- <img src="${gotoTopImg}" alt="Go to top" class="component-img" />
116
- </button>
117
- </div>
118
- `;
109
+ <div class="floating-action-panel">
110
+ <div class="social-links">
111
+ ${socialList
112
+ .map(socialLink => {
113
+ if(socialLink.icon==='https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'){
114
+ (socialLink.icon as any) = undefined;
115
+ }
116
+ const imgSrc = supportSocial.includes(socialLink.social_type)
117
+ ? socialIMG[socialLink.social_type]
118
+ : socialIMG.other;
119
+ return html`
120
+ <div onclick="${
121
+ gvc.event(()=>{
122
+ gvc.glitter.href = socialLink.link;
123
+ })
124
+ }" class="component-circle" style="overflow: hidden;
125
+ background-image: url('${socialLink.icon??imgSrc}');background-size: cover;background-position: center;"
126
+ >
127
+ </div>
128
+ `;
129
+ })
130
+ .join('')}
131
+ </div>
132
+ <button
133
+ class="component-circle up-to-top hidden rounded-circle align-items-center justify-content-center"
134
+ style="overflow: hidden; background-color: white;display: flex; "
135
+ onclick="${gvc.event(() => {
136
+ scrollToTop();
137
+ })}"
138
+ >
139
+ <i class="fa-solid fa-angle-up fs-3"></i>
140
+ </button>
141
+ </div>
142
+ `;
119
143
  },divCreate:{}
120
144
  ,onInitial:()=>{
121
- (window as any).onscroll = function() {
145
+ window.addEventListener('scroll', function() {
122
146
  const scrollPosition = window.scrollY;
123
147
 
124
148
  const threshold = window.innerHeight / 2;
@@ -130,7 +154,8 @@ export class SocialLinks01 {
130
154
  } else {
131
155
  panel!.classList.add('hidden');
132
156
  }
133
- };
157
+ });
158
+
134
159
  }
135
160
  })
136
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "21.8.4",
3
+ "version": "21.8.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -58,7 +58,7 @@ class CheckoutEvent {
58
58
  return JSON.parse(JSON.stringify((0, glitter_finance_js_1.onlinePayArray)()));
59
59
  }
60
60
  async toCheckout(data, type = 'add', replace_order_id) {
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
62
62
  try {
63
63
  const utTimer = new ut_timer_js_1.UtTimer('TO-CHECKOUT');
64
64
  const checkPoint = utTimer.checkPoint;
@@ -313,8 +313,9 @@ class CheckoutEvent {
313
313
  }
314
314
  }
315
315
  const store_info = await userClass.getConfigV2({ key: 'store-information', user_id: 'manager' });
316
+ const store_manager = (_z = (await userClass.getConfigV2({ key: 'store_manager', user_id: 'manager' })).list) !== null && _z !== void 0 ? _z : [];
316
317
  data.line_items = await Promise.all(data.line_items.map(async (item) => {
317
- var _a, _b, _c, _d, _e;
318
+ var _a, _b, _c;
318
319
  const getProductData = (await this.shopping.getProduct({
319
320
  page: 0,
320
321
  limit: 1,
@@ -336,7 +337,20 @@ class CheckoutEvent {
336
337
  const isUnderstockingVisible = variant.show_understocking !== 'false';
337
338
  const isManualType = type === 'manual' || type === 'manual-preview';
338
339
  if (isPOS && isUnderstockingVisible && !data.isExhibition) {
339
- variant.stock = ((_b = (_a = variant.stockList) === null || _a === void 0 ? void 0 : _a[data.pos_store]) === null || _b === void 0 ? void 0 : _b.count) || 0;
340
+ variant.stock =
341
+ store_manager
342
+ .filter((dd) => {
343
+ var _a;
344
+ return (dd.id === data.pos_store ||
345
+ ((_a = store_manager.find((dd) => {
346
+ return dd.id === data.pos_store;
347
+ }).support_store) !== null && _a !== void 0 ? _a : []).includes(dd.id));
348
+ })
349
+ .map((d1) => {
350
+ var _a, _b;
351
+ return (_b = (_a = variant.stockList) === null || _a === void 0 ? void 0 : _a[d1.id]) === null || _b === void 0 ? void 0 : _b.count;
352
+ })
353
+ .reduce((acc, val) => acc + val, 0) || 0;
340
354
  }
341
355
  if (variant.stock < item.count && isUnderstockingVisible && !isManualType) {
342
356
  if (isPOS || isPreOrderStore) {
@@ -378,7 +392,7 @@ class CheckoutEvent {
378
392
  show_understocking: variant.show_understocking,
379
393
  stockList: variant.stockList,
380
394
  weight: parseInt(variant.weight || '0', 10),
381
- designated_logistics: (_c = content.designated_logistics) !== null && _c !== void 0 ? _c : { type: 'all', list: [] },
395
+ designated_logistics: (_a = content.designated_logistics) !== null && _a !== void 0 ? _a : { type: 'all', list: [] },
382
396
  product_customize_tag: content.product_customize_tag || [],
383
397
  });
384
398
  const shipmentValue = (() => {
@@ -403,8 +417,8 @@ class CheckoutEvent {
403
417
  if (!scheduledData) {
404
418
  const sql = `WHERE JSON_CONTAINS(content->'$.pending_order', '"${data.temp_cart_id}"'`;
405
419
  const scheduledDataQuery = `
406
- SELECT *
407
- FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
420
+ SELECT *
421
+ FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
408
422
  `;
409
423
  scheduledData = (await database_js_1.default.query(scheduledDataQuery, []))[0];
410
424
  if (scheduledData) {
@@ -439,15 +453,35 @@ class CheckoutEvent {
439
453
  }
440
454
  }
441
455
  else {
442
- variant.deduction_log = { [data.pos_store]: item.count };
443
- variant.stockList[data.pos_store].count -= item.count;
456
+ const refer = JSON.parse(JSON.stringify(variant.stockList));
457
+ Object.keys(refer).forEach(key => {
458
+ var _a;
459
+ if ((key !== data.pos_store) &&
460
+ (!((_a = store_manager.find((dd) => {
461
+ return dd.id === data.pos_store;
462
+ }).support_store) !== null && _a !== void 0 ? _a : []).includes(key))) {
463
+ delete refer[key];
464
+ }
465
+ });
466
+ const returnData = new stock_js_1.Stock(this.app, this.token).allocateStock(refer, item.count);
467
+ variant.stockList = Object.assign(Object.assign({}, variant.stockList), refer);
468
+ variant.deduction_log = Object.assign(Object.assign({}, variant.deduction_log), returnData.deductionLog);
444
469
  item.deduction_log = variant.deduction_log;
470
+ console.log(`item.deduction_log===>`, item.deduction_log);
471
+ console.log(`variant.stockList===>`, variant.stockList);
472
+ console.log(`variant.deduction_log===>`, variant.deduction_log);
473
+ content.variants.forEach((d1, index) => {
474
+ console.log(`update-content-pos->`, d1.stockList);
475
+ });
445
476
  }
446
477
  }
447
478
  else {
448
479
  const returnData = new stock_js_1.Stock(this.app, this.token).allocateStock(variant.stockList, item.count);
449
480
  variant.deduction_log = returnData.deductionLog;
450
481
  item.deduction_log = returnData.deductionLog;
482
+ content.variants.forEach((d1, index) => {
483
+ console.log(`update-content-web->`, d1.stockList);
484
+ });
451
485
  }
452
486
  saveStockArray.push(() => new Promise(async (resolve, reject) => {
453
487
  var _a;
@@ -456,8 +490,8 @@ class CheckoutEvent {
456
490
  if (!scheduledData) {
457
491
  const sql = `WHERE JSON_CONTAINS(content->'$.pending_order', '"${data.temp_cart_id}"'`;
458
492
  const scheduledDataQuery = `
459
- SELECT *
460
- FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
493
+ SELECT *
494
+ FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
461
495
  `;
462
496
  scheduledData = (await database_js_1.default.query(scheduledDataQuery, []))[0];
463
497
  }
@@ -492,11 +526,12 @@ class CheckoutEvent {
492
526
  item.deduction_log = { [store_config.list[0].id]: item.count };
493
527
  }
494
528
  else {
495
- await this.shopping.updateVariantsWithSpec(variant, item.id, item.spec);
529
+ content.variants.forEach((d1, index) => {
530
+ console.log(`update-content->`, d1.stockList);
531
+ });
532
+ await this.shopping.postVariantsAndPriceValue(content);
496
533
  }
497
- await database_js_1.default.query(`UPDATE \`${this.app}\`.\`t_manager_post\`
498
- SET ?
499
- WHERE id = ${getProductData.id}`, [{ content: JSON.stringify(content) }]);
534
+ console.log(`post-variants===>`, content);
500
535
  }
501
536
  resolve(true);
502
537
  }
@@ -511,8 +546,8 @@ class CheckoutEvent {
511
546
  is_hidden: content.visible === 'false',
512
547
  is_gift: content.productType.giveaway,
513
548
  sale_price: content.productType.giveaway ? 0 : item.sale_price,
514
- min_qty: (_d = content.min_qty) !== null && _d !== void 0 ? _d : item.min_qty,
515
- max_qty: (_e = content.max_qty) !== null && _e !== void 0 ? _e : item.max_qty,
549
+ min_qty: (_b = content.min_qty) !== null && _b !== void 0 ? _b : item.min_qty,
550
+ max_qty: (_c = content.max_qty) !== null && _c !== void 0 ? _c : item.max_qty,
516
551
  });
517
552
  item.is_add_on_items && add_on_items.push(item);
518
553
  item.is_gift && gift_product.push(item);
@@ -530,24 +565,24 @@ class CheckoutEvent {
530
565
  }
531
566
  if (hasMaxProduct && data.email !== 'no-email') {
532
567
  const cartTokenSQL = `
533
- SELECT cart_token
534
- FROM \`${this.app}\`.t_checkout
535
- WHERE email IN (${[-99, (_z = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _z === void 0 ? void 0 : _z.email, (_0 = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _0 === void 0 ? void 0 : _0.phone]
568
+ SELECT cart_token
569
+ FROM \`${this.app}\`.t_checkout
570
+ WHERE email IN (${[-99, (_0 = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _0 === void 0 ? void 0 : _0.email, (_1 = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _1 === void 0 ? void 0 : _1.phone]
536
571
  .filter(Boolean)
537
572
  .map(item => database_js_1.default.escape(item))
538
573
  .join(',')})
539
- AND order_status <> '-1'
574
+ AND order_status <> '-1'
540
575
  `;
541
576
  const soldHistory = await database_js_1.default.query(`
542
- SELECT *
543
- FROM \`${this.app}\`.t_products_sold_history
544
- WHERE product_id IN (${[...maxProductMap.keys()].join(',')})
545
- AND order_id IN (${cartTokenSQL})
577
+ SELECT *
578
+ FROM \`${this.app}\`.t_products_sold_history
579
+ WHERE product_id IN (${[...maxProductMap.keys()].join(',')})
580
+ AND order_id IN (${cartTokenSQL})
546
581
  `, []);
547
582
  const purchaseHistory = new Map();
548
583
  for (const history of soldHistory) {
549
584
  const pid = Number(history.product_id);
550
- purchaseHistory.set(pid, ((_1 = purchaseHistory.get(pid)) !== null && _1 !== void 0 ? _1 : 0) + history.count);
585
+ purchaseHistory.set(pid, ((_2 = purchaseHistory.get(pid)) !== null && _2 !== void 0 ? _2 : 0) + history.count);
551
586
  }
552
587
  for (const item of data.line_items) {
553
588
  if (maxProductMap.has(item.id)) {
@@ -556,13 +591,13 @@ class CheckoutEvent {
556
591
  }
557
592
  }
558
593
  checkPoint('set max product');
559
- carData.select_shipment_setting = ((_2 = data === null || data === void 0 ? void 0 : data.user_info) === null || _2 === void 0 ? void 0 : _2.shipment)
594
+ carData.select_shipment_setting = ((_3 = data === null || data === void 0 ? void 0 : data.user_info) === null || _3 === void 0 ? void 0 : _3.shipment)
560
595
  ? await userClass.getConfigV2({
561
596
  key: 'shipment_config_' + data.user_info.shipment,
562
597
  user_id: 'manager',
563
598
  })
564
599
  : {};
565
- const freeShipmnetNum = (_5 = (_4 = (_3 = carData.select_shipment_setting) === null || _3 === void 0 ? void 0 : _3.cartSetting) === null || _4 === void 0 ? void 0 : _4.freeShipmnetTarget) !== null && _5 !== void 0 ? _5 : 0;
600
+ const freeShipmnetNum = (_6 = (_5 = (_4 = carData.select_shipment_setting) === null || _4 === void 0 ? void 0 : _4.cartSetting) === null || _5 === void 0 ? void 0 : _5.freeShipmnetTarget) !== null && _6 !== void 0 ? _6 : 0;
566
601
  const isFreeShipment = freeShipmnetNum > 0 && carData.total >= freeShipmnetNum;
567
602
  carData.shipment_fee = isFreeShipment
568
603
  ? 0
@@ -620,7 +655,7 @@ class CheckoutEvent {
620
655
  await this.shopping.checkVoucher(carData);
621
656
  checkPoint('check voucher');
622
657
  let can_add_gift = [];
623
- (_6 = carData.voucherList) === null || _6 === void 0 ? void 0 : _6.filter(dd => dd.reBackType === 'giveaway').forEach(dd => can_add_gift.push(dd.add_on_products));
658
+ (_7 = carData.voucherList) === null || _7 === void 0 ? void 0 : _7.filter(dd => dd.reBackType === 'giveaway').forEach(dd => can_add_gift.push(dd.add_on_products));
624
659
  gift_product.forEach(dd => {
625
660
  const max_count = can_add_gift.filter(d1 => d1.includes(dd.id)).length;
626
661
  if (max_count) {
@@ -632,7 +667,7 @@ class CheckoutEvent {
632
667
  }
633
668
  });
634
669
  for (const giveawayData of carData.voucherList.filter(dd => dd.reBackType === 'giveaway')) {
635
- if (!((_7 = giveawayData.add_on_products) === null || _7 === void 0 ? void 0 : _7.length))
670
+ if (!((_8 = giveawayData.add_on_products) === null || _8 === void 0 ? void 0 : _8.length))
636
671
  continue;
637
672
  const productPromises = giveawayData.add_on_products
638
673
  .map(async (id) => {
@@ -660,7 +695,7 @@ class CheckoutEvent {
660
695
  appName: this.app,
661
696
  key: 'glitter_finance',
662
697
  });
663
- const keyData = (_8 = configData[0]) === null || _8 === void 0 ? void 0 : _8.value;
698
+ const keyData = (_9 = configData[0]) === null || _9 === void 0 ? void 0 : _9.value;
664
699
  if (keyData) {
665
700
  carData.payment_info_custom = keyData.payment_info_custom;
666
701
  }
@@ -690,10 +725,10 @@ class CheckoutEvent {
690
725
  }
691
726
  });
692
727
  checkPoint('set payment');
693
- keyData.cash_on_delivery = (_9 = keyData.cash_on_delivery) !== null && _9 !== void 0 ? _9 : { shipmentSupport: [] };
728
+ keyData.cash_on_delivery = (_10 = keyData.cash_on_delivery) !== null && _10 !== void 0 ? _10 : { shipmentSupport: [] };
694
729
  carData.payment_info_line_pay = keyData.payment_info_line_pay;
695
730
  carData.payment_info_atm = keyData.payment_info_atm;
696
- keyData.cash_on_delivery.shipmentSupport = (_10 = keyData.cash_on_delivery.shipmentSupport) !== null && _10 !== void 0 ? _10 : [];
731
+ keyData.cash_on_delivery.shipmentSupport = (_11 = keyData.cash_on_delivery.shipmentSupport) !== null && _11 !== void 0 ? _11 : [];
697
732
  await this.setPaymentSetting({ carData: carData, checkoutPayment: checkoutPayment, keyData: keyData });
698
733
  let subtotal = 0;
699
734
  carData.lineItems.map(item => {
@@ -715,7 +750,7 @@ class CheckoutEvent {
715
750
  const excludedValuesByTotal = new Set(['UNIMARTC2C', 'FAMIC2C', 'HILIFEC2C', 'OKMARTC2C']);
716
751
  const excludedValuesByWeight = new Set(['normal', 'black_cat']);
717
752
  const logisticsGroupResult = await userClass.getConfig({ key: 'logistics_group', user_id: 'manager' });
718
- const logisticsGroup = (_12 = (_11 = logisticsGroupResult[0]) === null || _11 === void 0 ? void 0 : _11.value) !== null && _12 !== void 0 ? _12 : [];
753
+ const logisticsGroup = (_13 = (_12 = logisticsGroupResult[0]) === null || _12 === void 0 ? void 0 : _12.value) !== null && _13 !== void 0 ? _13 : [];
719
754
  const isExcludedByTotal = (dd) => {
720
755
  return carData.total > 20000 && excludedValuesByTotal.has(dd.value);
721
756
  };
@@ -822,7 +857,7 @@ class CheckoutEvent {
822
857
  carData.discount = data.discount;
823
858
  carData.voucherList = [tempVoucher];
824
859
  carData.customer_info = data.customer_info;
825
- carData.total = (_13 = data.total) !== null && _13 !== void 0 ? _13 : 0;
860
+ carData.total = (_14 = data.total) !== null && _14 !== void 0 ? _14 : 0;
826
861
  carData.rebate = tempVoucher.rebate_total;
827
862
  if (tempVoucher.reBackType == 'shipment_free' || type == 'split') {
828
863
  carData.shipment_fee = 0;
@@ -867,7 +902,7 @@ class CheckoutEvent {
867
902
  if (checkOutType === 'POS' && Array.isArray(data.voucherList)) {
868
903
  const manualVoucher = data.voucherList.find((item) => item.id === 0);
869
904
  if (manualVoucher) {
870
- manualVoucher.discount = (_14 = manualVoucher.discount_total) !== null && _14 !== void 0 ? _14 : 0;
905
+ manualVoucher.discount = (_15 = manualVoucher.discount_total) !== null && _15 !== void 0 ? _15 : 0;
871
906
  carData.total -= manualVoucher.discount;
872
907
  carData.discount += manualVoucher.discount;
873
908
  carData.voucherList.push(manualVoucher);
@@ -899,15 +934,15 @@ class CheckoutEvent {
899
934
  console.error(e);
900
935
  }
901
936
  }
937
+ await trans.commit();
938
+ await trans.release();
939
+ await Promise.all(saveStockArray.map(dd => dd()));
902
940
  await order_event_js_1.OrderEvent.insertOrder({
903
941
  cartData: carData,
904
942
  status: data.pay_status,
905
943
  app: this.app,
906
944
  });
907
- await trans.commit();
908
- await trans.release();
909
- await Promise.all(saveStockArray.map(dd => dd()));
910
- await this.shopping.releaseCheckout((_15 = data.pay_status) !== null && _15 !== void 0 ? _15 : 0, carData.orderID);
945
+ await this.shopping.releaseCheckout((_16 = data.pay_status) !== null && _16 !== void 0 ? _16 : 0, carData.orderID);
911
946
  checkPoint('release pos checkout');
912
947
  for (const email of new Set([carData.customer_info, carData.user_info].map(dd => {
913
948
  return dd && dd.email;
@@ -961,7 +996,7 @@ class CheckoutEvent {
961
996
  appName: this.app,
962
997
  key: 'glitter_finance',
963
998
  }))[0].value;
964
- let kd = (_16 = keyData[carData.customer_info.payment_select]) !== null && _16 !== void 0 ? _16 : {
999
+ let kd = (_17 = keyData[carData.customer_info.payment_select]) !== null && _17 !== void 0 ? _17 : {
965
1000
  ReturnURL: '',
966
1001
  NotifyURL: '',
967
1002
  };