ts-glitter 21.8.9 → 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.
@@ -2820,10 +2820,10 @@ export class Shopping {
2820
2820
 
2821
2821
  if (voucher.conditionType === 'order') {
2822
2822
  if (voucher.method === 'fixed') {
2823
- voucher.discount_total = disValue * voucher.times;
2823
+ voucher.discount_total = Math.floor(disValue * voucher.times);
2824
2824
  }
2825
2825
  if (voucher.method === 'percent') {
2826
- voucher.discount_total = voucher.bind_subtotal * disValue;
2826
+ voucher.discount_total = Math.floor(voucher.bind_subtotal * disValue);
2827
2827
  }
2828
2828
  if (voucher.bind_subtotal >= voucher.discount_total) {
2829
2829
  let remain = parseInt(`${voucher.discount_total}`, 10);
@@ -2897,6 +2897,7 @@ export class Shopping {
2897
2897
  }
2898
2898
  }
2899
2899
 
2900
+ voucher.discount_total = Math.floor(voucher.discount_total);
2900
2901
  return voucher.bind.length > 0;
2901
2902
  }
2902
2903
 
@@ -5875,9 +5876,9 @@ export class Shopping {
5875
5876
  async batchPostCustomerInvoice(dataArray: InvoiceData[]) {
5876
5877
  let result: any = [];
5877
5878
  const chunk = 10;
5878
- const chunksCount = Math.ceil(dataArray.length / chunk);
5879
+ const chunkLength = Math.ceil(dataArray.length / chunk);
5879
5880
 
5880
- for (let i = 0; i < chunksCount; i++) {
5881
+ for (let i = 0; i < chunkLength; i++) {
5881
5882
  const arr = dataArray.slice(i * chunk, (i + 1) * chunk);
5882
5883
  const res = await Promise.all(
5883
5884
  arr.map(item => {