kts-component-invoice-operate 3.2.203 → 3.2.205

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
@@ -22275,9 +22275,9 @@ var useColumns$1 = (function (form) {
22275
22275
  var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
22276
22276
 
22277
22277
  if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
22278
- var total = lineAmountExcludeTax * taxRate / 100;
22278
+ var total = bignumber(lineAmountExcludeTax * taxRate / 100); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
22279
22279
 
22280
- if (Number(Math.abs(total - Number(value)).toFixed(2)) <= 0.01) {
22280
+ if (chain$1(total).subtract(bignumber(value)).done().toNumber() <= 0.01) {
22281
22281
  callback();
22282
22282
  } else {
22283
22283
  callback('税额填写错误,请重新输入');
package/dist/index.js CHANGED
@@ -22285,9 +22285,9 @@ var useColumns$1 = (function (form) {
22285
22285
  var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
22286
22286
 
22287
22287
  if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
22288
- var total = lineAmountExcludeTax * taxRate / 100;
22288
+ var total = mathjs.bignumber(lineAmountExcludeTax * taxRate / 100); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
22289
22289
 
22290
- if (Number(Math.abs(total - Number(value)).toFixed(2)) <= 0.01) {
22290
+ if (mathjs.chain(total).subtract(mathjs.bignumber(value)).done().toNumber() <= 0.01) {
22291
22291
  callback();
22292
22292
  } else {
22293
22293
  callback('税额填写错误,请重新输入');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.203",
3
+ "version": "3.2.205",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -7,6 +7,7 @@ import { AutoComplete, Select, Button, Input, Spin, Tooltip, InputProps } from '
7
7
  import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
8
8
  import { getItemNameWithShorthand } from '../../../../../tools/itemName';
9
9
  import { IGood, LineAttributeType } from '../../../../../InvoiceController';
10
+ import { chain, bignumber } from 'mathjs';
10
11
  import Invoice from '../../../../..';
11
12
  import TitleText from './ui/TitleText';
12
13
  import ItemNameInput from './ui/ItemNameInput';
@@ -524,8 +525,9 @@ export default (form: WrappedFormUtils) => {
524
525
  const lineAmountExcludeTax = lineAmountIncludeTax - value;
525
526
  const taxRate = editGood?.taxRate;
526
527
  if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
527
- const total = lineAmountExcludeTax * taxRate / 100;
528
- if (Number(Math.abs(total - Number(value)).toFixed(2)) <= 0.01) {
528
+ const total = bignumber(lineAmountExcludeTax * taxRate / 100);
529
+ // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
530
+ if (chain(total).subtract(bignumber(value)).done().toNumber() <= 0.01) {
529
531
  callback();
530
532
  } else {
531
533
  callback('税额填写错误,请重新输入')