kts-component-invoice-operate 3.2.198 → 3.2.200
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().toString();
|
|
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
|
});
|
|
@@ -26595,7 +26608,13 @@ var EndowCodeDrawer = (function () {
|
|
|
26595
26608
|
return _ref.apply(this, arguments);
|
|
26596
26609
|
};
|
|
26597
26610
|
}())();
|
|
26598
|
-
}, [controller]); //
|
|
26611
|
+
}, [controller]); // React.useEffect(()=>{
|
|
26612
|
+
// const a=chain(bignumber('21.00')).divide(bignumber('10.4999999999999123341231'))
|
|
26613
|
+
// .done()
|
|
26614
|
+
// .toString()
|
|
26615
|
+
// console.log(a)
|
|
26616
|
+
// },[])
|
|
26617
|
+
// 计算赋码默认值
|
|
26599
26618
|
|
|
26600
26619
|
React.useEffect(function () {
|
|
26601
26620
|
if (visible) {
|
|
@@ -27376,7 +27395,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
27376
27395
|
}
|
|
27377
27396
|
|
|
27378
27397
|
if (good.lineAmountExcludeTax && good.quantity) {
|
|
27379
|
-
good.priceExcludeTax =
|
|
27398
|
+
good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
|
|
27380
27399
|
} //赋值商品的可用税率
|
|
27381
27400
|
|
|
27382
27401
|
|
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().toString();
|
|
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
|
});
|
|
@@ -26605,7 +26618,13 @@ var EndowCodeDrawer = (function () {
|
|
|
26605
26618
|
return _ref.apply(this, arguments);
|
|
26606
26619
|
};
|
|
26607
26620
|
}())();
|
|
26608
|
-
}, [controller]); //
|
|
26621
|
+
}, [controller]); // React.useEffect(()=>{
|
|
26622
|
+
// const a=chain(bignumber('21.00')).divide(bignumber('10.4999999999999123341231'))
|
|
26623
|
+
// .done()
|
|
26624
|
+
// .toString()
|
|
26625
|
+
// console.log(a)
|
|
26626
|
+
// },[])
|
|
26627
|
+
// 计算赋码默认值
|
|
26609
26628
|
|
|
26610
26629
|
React__default['default'].useEffect(function () {
|
|
26611
26630
|
if (visible) {
|
|
@@ -27386,7 +27405,7 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
27386
27405
|
}
|
|
27387
27406
|
|
|
27388
27407
|
if (good.lineAmountExcludeTax && good.quantity) {
|
|
27389
|
-
good.priceExcludeTax =
|
|
27408
|
+
good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
|
|
27390
27409
|
} //赋值商品的可用税率
|
|
27391
27410
|
|
|
27392
27411
|
|
package/package.json
CHANGED
|
@@ -90,7 +90,19 @@ export function countPrice(amount: string | number, quantity: string | number, c
|
|
|
90
90
|
.done()
|
|
91
91
|
.toNumber(), calculatingDigits)
|
|
92
92
|
}
|
|
93
|
-
|
|
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;
|
|
102
|
+
return chain(bignumber(amount)).divide(bignumber(quantity))
|
|
103
|
+
.done()
|
|
104
|
+
.toString()
|
|
105
|
+
}
|
|
94
106
|
|
|
95
107
|
/**
|
|
96
108
|
* 数量 = 金额/单价
|
|
@@ -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,
|
|
@@ -33,7 +33,12 @@ export default () => {
|
|
|
33
33
|
s.goodsListState.endowCode.endowcodeGoodIndex = [];
|
|
34
34
|
})();
|
|
35
35
|
}, [controller]);
|
|
36
|
-
|
|
36
|
+
// React.useEffect(()=>{
|
|
37
|
+
// const a=chain(bignumber('21.00')).divide(bignumber('10.4999999999999123341231'))
|
|
38
|
+
// .done()
|
|
39
|
+
// .toString()
|
|
40
|
+
// console.log(a)
|
|
41
|
+
// },[])
|
|
37
42
|
// 计算赋码默认值
|
|
38
43
|
React.useEffect(() => {
|
|
39
44
|
if (visible) {
|
|
@@ -488,7 +493,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
488
493
|
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
489
494
|
}
|
|
490
495
|
if (good.lineAmountExcludeTax && good.quantity) {
|
|
491
|
-
good.priceExcludeTax =
|
|
496
|
+
good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
|
|
492
497
|
}
|
|
493
498
|
|
|
494
499
|
//赋值商品的可用税率
|