kts-component-invoice-operate 3.2.198 → 3.2.199

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.
@@ -31,6 +31,13 @@ export declare function countTaxAmount(amountIncludeTax: string | number, deduct
31
31
  * @returns 单价
32
32
  */
33
33
  export declare function countPrice(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '';
34
+ /**
35
+ * 单价 = 金额/数量 不做小数限制
36
+ * @param amount 金额
37
+ * @param quantity 数量
38
+ * @returns 单价
39
+ */
40
+ export declare function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '';
34
41
  /**
35
42
  * 数量 = 金额/单价
36
43
  * @param amount 金额
package/dist/index.esm.js CHANGED
@@ -1651,6 +1651,18 @@ function countPrice(amount, quantity, calculatingDigits) {
1651
1651
  if (!quantity && quantity !== 0) return undefined;
1652
1652
  return format15(chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toNumber(), calculatingDigits);
1653
1653
  }
1654
+ /**
1655
+ * 单价 = 金额/数量 不做小数限制
1656
+ * @param amount 金额
1657
+ * @param quantity 数量
1658
+ * @returns 单价
1659
+ */
1660
+
1661
+ function countPriceNoLimit(amount, quantity, calculatingDigits) {
1662
+ if (!amount && amount !== 0) return undefined;
1663
+ if (!quantity && quantity !== 0) return undefined;
1664
+ return chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toNumber();
1665
+ }
1654
1666
  /**
1655
1667
  * 数量 = 金额/单价
1656
1668
  * @param amount 金额
@@ -1703,6 +1715,7 @@ var calculator = /*#__PURE__*/Object.freeze({
1703
1715
  countAmountExcludeTax: countAmountExcludeTax,
1704
1716
  countTaxAmount: countTaxAmount,
1705
1717
  countPrice: countPrice,
1718
+ countPriceNoLimit: countPriceNoLimit,
1706
1719
  countQuantity: countQuantity,
1707
1720
  nonScientificNotation: nonScientificNotation
1708
1721
  });
@@ -27376,7 +27389,7 @@ var DrawerBody$3 = function DrawerBody(props) {
27376
27389
  }
27377
27390
 
27378
27391
  if (good.lineAmountExcludeTax && good.quantity) {
27379
- good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27392
+ good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27380
27393
  } //赋值商品的可用税率
27381
27394
 
27382
27395
 
package/dist/index.js CHANGED
@@ -1661,6 +1661,18 @@ function countPrice(amount, quantity, calculatingDigits) {
1661
1661
  if (!quantity && quantity !== 0) return undefined;
1662
1662
  return format15(mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toNumber(), calculatingDigits);
1663
1663
  }
1664
+ /**
1665
+ * 单价 = 金额/数量 不做小数限制
1666
+ * @param amount 金额
1667
+ * @param quantity 数量
1668
+ * @returns 单价
1669
+ */
1670
+
1671
+ function countPriceNoLimit(amount, quantity, calculatingDigits) {
1672
+ if (!amount && amount !== 0) return undefined;
1673
+ if (!quantity && quantity !== 0) return undefined;
1674
+ return mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toNumber();
1675
+ }
1664
1676
  /**
1665
1677
  * 数量 = 金额/单价
1666
1678
  * @param amount 金额
@@ -1713,6 +1725,7 @@ var calculator = /*#__PURE__*/Object.freeze({
1713
1725
  countAmountExcludeTax: countAmountExcludeTax,
1714
1726
  countTaxAmount: countTaxAmount,
1715
1727
  countPrice: countPrice,
1728
+ countPriceNoLimit: countPriceNoLimit,
1716
1729
  countQuantity: countQuantity,
1717
1730
  nonScientificNotation: nonScientificNotation
1718
1731
  });
@@ -27386,7 +27399,7 @@ var DrawerBody$3 = function DrawerBody(props) {
27386
27399
  }
27387
27400
 
27388
27401
  if (good.lineAmountExcludeTax && good.quantity) {
27389
- good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27402
+ good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27390
27403
  } //赋值商品的可用税率
27391
27404
 
27392
27405
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.198",
3
+ "version": "3.2.199",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -90,7 +90,20 @@ export function countPrice(amount: string | number, quantity: string | number, c
90
90
  .done()
91
91
  .toNumber(), calculatingDigits)
92
92
  }
93
+ /**
94
+ * 单价 = 金额/数量 不做小数限制
95
+ * @param amount 金额
96
+ * @param quantity 数量
97
+ * @returns 单价
98
+ */
99
+ export function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '' {
100
+ if (!amount && amount !== 0) return undefined;
101
+ if (!quantity && quantity !== 0) return undefined;
93
102
 
103
+ return chain(bignumber(amount)).divide(bignumber(quantity))
104
+ .done()
105
+ .toNumber()
106
+ }
94
107
 
95
108
  /**
96
109
  * 数量 = 金额/单价
@@ -6,7 +6,7 @@ import { Input, NumberPicker } from '@formily/antd-components';
6
6
  import { format15 } from '../GoodsList/hook/useColumns/autoFillFn';
7
7
  import { LineAttributeType } from '../../../InvoiceController';
8
8
  import IGood from '../../../InvoiceController/InvoiceControllerState/GoodsListState/IGood';
9
- import { countTaxAmount, countAmountExcludeTax, countPrice } from '../../../tools/calculate';
9
+ import { countTaxAmount, countAmountExcludeTax, countPrice,countPriceNoLimit } from '../../../tools/calculate';
10
10
  import { bytesLnegth, cutStr } from '../../../tools/strringFn';
11
11
  import {
12
12
  SchemaForm,
@@ -488,7 +488,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
488
488
  good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
489
489
  }
490
490
  if (good.lineAmountExcludeTax && good.quantity) {
491
- good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
491
+ good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
492
492
  }
493
493
 
494
494
  //赋值商品的可用税率