kts-component-invoice-operate 3.2.102 → 3.2.103

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/index.esm.js CHANGED
@@ -2282,7 +2282,7 @@ function _mergeDiscount() {
2282
2282
  sum.priceIncludeTax = format15(chain$1(bignumber(sum.lineAmountIncludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
2283
2283
  }
2284
2284
 
2285
- goodsList.splice(i, 2, sum);
2285
+ sum.lineAmountIncludeTax === 0 ? goodsList.splice(i, 2) : goodsList.splice(i, 2, sum);
2286
2286
  }
2287
2287
  }
2288
2288
 
package/dist/index.js CHANGED
@@ -2292,7 +2292,7 @@ function _mergeDiscount() {
2292
2292
  sum.priceIncludeTax = format15(mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
2293
2293
  }
2294
2294
 
2295
- goodsList.splice(i, 2, sum);
2295
+ sum.lineAmountIncludeTax === 0 ? goodsList.splice(i, 2) : goodsList.splice(i, 2, sum);
2296
2296
  }
2297
2297
  }
2298
2298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.102",
3
+ "version": "3.2.103",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -14,7 +14,7 @@ export default async function mergeDiscount(state: InvoiceControllerState) {
14
14
  if (good.lineAttribute * 1 === LineAttributeType.被折扣行) {
15
15
  const sum: IGood = { ...good, $index: idGenerator(), lineAttribute: LineAttributeType.正常, discountGroup: undefined };
16
16
  const zk = goodsList[i + 1];
17
-
17
+
18
18
  sum.lineAmountExcludeTax = chain(bignumber(good.lineAmountExcludeTax)).subtract(bignumber(Math.abs(zk.lineAmountExcludeTax || 0))).done().toNumber();
19
19
  sum.lineAmountIncludeTax = chain(bignumber(good.lineAmountIncludeTax)).subtract(bignumber(Math.abs(zk.lineAmountIncludeTax || 0))).done().toNumber();
20
20
  sum.taxAmount = chain(bignumber(sum.lineAmountIncludeTax)).subtract(bignumber(sum.lineAmountExcludeTax)).done().toNumber();
@@ -24,7 +24,11 @@ export default async function mergeDiscount(state: InvoiceControllerState) {
24
24
  sum.priceExcludeTax = format15(chain(bignumber(sum.lineAmountExcludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
25
25
  sum.priceIncludeTax = format15(chain(bignumber(sum.lineAmountIncludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
26
26
  }
27
- goodsList.splice(i, 2, sum);
27
+
28
+ sum.lineAmountIncludeTax === 0
29
+ ? goodsList.splice(i, 2)
30
+ : goodsList.splice(i, 2, sum)
31
+
28
32
  }
29
33
  }
30
34
  state.goodsListState.goodsList = goodsList;