ts-glitter 21.9.0 → 21.9.1

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.
@@ -1961,10 +1961,10 @@ class Shopping {
1961
1961
  const disValue = parseFloat(voucher.value) / (voucher.method === 'percent' ? 100 : 1);
1962
1962
  if (voucher.conditionType === 'order') {
1963
1963
  if (voucher.method === 'fixed') {
1964
- voucher.discount_total = disValue * voucher.times;
1964
+ voucher.discount_total = Math.floor(disValue * voucher.times);
1965
1965
  }
1966
1966
  if (voucher.method === 'percent') {
1967
- voucher.discount_total = voucher.bind_subtotal * disValue;
1967
+ voucher.discount_total = Math.floor(voucher.bind_subtotal * disValue);
1968
1968
  }
1969
1969
  if (voucher.bind_subtotal >= voucher.discount_total) {
1970
1970
  let remain = parseInt(`${voucher.discount_total}`, 10);
@@ -2038,6 +2038,7 @@ class Shopping {
2038
2038
  });
2039
2039
  }
2040
2040
  }
2041
+ voucher.discount_total = Math.floor(voucher.discount_total);
2041
2042
  return voucher.bind.length > 0;
2042
2043
  }
2043
2044
  function countingBindDiscount(voucher) {
@@ -4352,8 +4353,8 @@ class Shopping {
4352
4353
  async batchPostCustomerInvoice(dataArray) {
4353
4354
  let result = [];
4354
4355
  const chunk = 10;
4355
- const chunksCount = Math.ceil(dataArray.length / chunk);
4356
- for (let i = 0; i < chunksCount; i++) {
4356
+ const chunkLength = Math.ceil(dataArray.length / chunk);
4357
+ for (let i = 0; i < chunkLength; i++) {
4357
4358
  const arr = dataArray.slice(i * chunk, (i + 1) * chunk);
4358
4359
  const res = await Promise.all(arr.map(item => {
4359
4360
  return this.postCustomerInvoice(item);