kts-component-invoice-operate 3.2.206 → 3.2.208
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 +5 -4
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +1 -0
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +1 -1
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +4 -3
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -14354,7 +14354,7 @@ var useColumns = (function (form) {
|
|
|
14354
14354
|
style: {
|
|
14355
14355
|
padding: '0 10px'
|
|
14356
14356
|
}
|
|
14357
|
-
}, isDutyFree(record) ? '***' : parseFloat(value).toFixed(2));
|
|
14357
|
+
}, isDutyFree(record) ? '***' : value ? parseFloat(value).toFixed(2) : '');
|
|
14358
14358
|
}
|
|
14359
14359
|
}
|
|
14360
14360
|
}, {
|
|
@@ -22270,15 +22270,16 @@ var useColumns$1 = (function (form) {
|
|
|
22270
22270
|
validator: function validator(rule, value, callback) {
|
|
22271
22271
|
//含税金额
|
|
22272
22272
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
22273
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
22273
22274
|
|
|
22274
|
-
var lineAmountExcludeTax = chain$1(bignumber(lineAmountIncludeTax)).subtract(bignumber(value));
|
|
22275
|
+
var lineAmountExcludeTax = chain$1(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
22275
22276
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
22276
22277
|
|
|
22277
22278
|
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
22278
22279
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
22279
|
-
var total = lineAmountExcludeTax.multiply(bignumber(taxRate)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
22280
|
+
var total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
22280
22281
|
|
|
22281
|
-
if (Math.abs(total.subtract(bignumber(value)).done().toNumber()) <= 0.01) {
|
|
22282
|
+
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
22282
22283
|
callback();
|
|
22283
22284
|
} else {
|
|
22284
22285
|
callback('税额填写错误,请重新输入');
|
package/dist/index.js
CHANGED
|
@@ -14364,7 +14364,7 @@ var useColumns = (function (form) {
|
|
|
14364
14364
|
style: {
|
|
14365
14365
|
padding: '0 10px'
|
|
14366
14366
|
}
|
|
14367
|
-
}, isDutyFree(record) ? '***' : parseFloat(value).toFixed(2));
|
|
14367
|
+
}, isDutyFree(record) ? '***' : value ? parseFloat(value).toFixed(2) : '');
|
|
14368
14368
|
}
|
|
14369
14369
|
}
|
|
14370
14370
|
}, {
|
|
@@ -22280,15 +22280,16 @@ var useColumns$1 = (function (form) {
|
|
|
22280
22280
|
validator: function validator(rule, value, callback) {
|
|
22281
22281
|
//含税金额
|
|
22282
22282
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
22283
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
22283
22284
|
|
|
22284
|
-
var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(lineAmountIncludeTax)).subtract(mathjs.bignumber(value));
|
|
22285
|
+
var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(lineAmountIncludeTax || 0)).subtract(mathjs.bignumber(value || 0));
|
|
22285
22286
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
22286
22287
|
|
|
22287
22288
|
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
22288
22289
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
22289
|
-
var total = lineAmountExcludeTax.multiply(mathjs.bignumber(taxRate)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
22290
|
+
var total = lineAmountExcludeTax.multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
22290
22291
|
|
|
22291
|
-
if (Math.abs(total.subtract(mathjs.bignumber(value)).done().toNumber()) <= 0.01) {
|
|
22292
|
+
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
22292
22293
|
callback();
|
|
22293
22294
|
} else {
|
|
22294
22295
|
callback('税额填写错误,请重新输入');
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ export default () => {
|
|
|
6
6
|
const callback = (e: any) => {
|
|
7
7
|
console.log(e.target.checked)
|
|
8
8
|
}
|
|
9
|
+
console.log(chain(bignumber(null)))
|
|
9
10
|
console.log(chain(bignumber(5.01)).multiply(bignumber(5)).divide(bignumber(100)).done().toNumber())
|
|
10
11
|
console.log(Math.abs(chain(bignumber(5.01)).multiply(bignumber(5)).divide(bignumber(100)).subtract(bignumber(0.24)).done().toNumber()))
|
|
11
12
|
const controller = React.useMemo(() => new Invoice.InvoiceController(), [])
|
|
@@ -546,7 +546,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
546
546
|
rules: getReplenishRules('taxAmount'),
|
|
547
547
|
})(<MyDiv loading={isCipher(changeField, 'taxAmount')} />);
|
|
548
548
|
} else {
|
|
549
|
-
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : parseFloat(value).toFixed(2)}</span>;
|
|
549
|
+
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : value ? parseFloat(value).toFixed(2) : ''}</span>;
|
|
550
550
|
}
|
|
551
551
|
},
|
|
552
552
|
},
|
|
@@ -522,13 +522,14 @@ export default (form: WrappedFormUtils) => {
|
|
|
522
522
|
//含税金额
|
|
523
523
|
const lineAmountIncludeTax = editGood?.lineAmountIncludeTax || 0;
|
|
524
524
|
//不含税金额
|
|
525
|
-
const lineAmountExcludeTax =
|
|
525
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
526
|
+
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax||0)).subtract(bignumber(value||0));
|
|
526
527
|
const taxRate = editGood?.taxRate;
|
|
527
528
|
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
528
529
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
529
|
-
const total = lineAmountExcludeTax.multiply(bignumber(taxRate)).divide(bignumber(100));
|
|
530
|
+
const total = lineAmountExcludeTax.multiply(bignumber(taxRate||0)).divide(bignumber(100));
|
|
530
531
|
// if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
531
|
-
if (Math.abs(total.subtract(bignumber(value)).done().toNumber()) <= 0.01) {
|
|
532
|
+
if (Math.abs(total.subtract(bignumber(value||0)).done().toNumber()) <= 0.01) {
|
|
532
533
|
callback();
|
|
533
534
|
} else {
|
|
534
535
|
callback('税额填写错误,请重新输入')
|