kts-component-invoice-operate 3.2.100 → 3.2.102
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
|
@@ -2246,7 +2246,7 @@ function mergeDiscount(_x) {
|
|
|
2246
2246
|
|
|
2247
2247
|
function _mergeDiscount() {
|
|
2248
2248
|
_mergeDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
|
|
2249
|
-
var goodsList, i, good, sum, zk;
|
|
2249
|
+
var goodsList, i, good, sum, zk, calculatingDigits;
|
|
2250
2250
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2251
2251
|
while (1) {
|
|
2252
2252
|
switch (_context.prev = _context.next) {
|
|
@@ -2277,8 +2277,9 @@ function _mergeDiscount() {
|
|
|
2277
2277
|
sum.quantity = good.quantity;
|
|
2278
2278
|
|
|
2279
2279
|
if (sum.quantity) {
|
|
2280
|
-
|
|
2281
|
-
sum.
|
|
2280
|
+
calculatingDigits = state.calculatingDigits;
|
|
2281
|
+
sum.priceExcludeTax = format15(chain$1(bignumber(sum.lineAmountExcludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
2282
|
+
sum.priceIncludeTax = format15(chain$1(bignumber(sum.lineAmountIncludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
2282
2283
|
}
|
|
2283
2284
|
|
|
2284
2285
|
goodsList.splice(i, 2, sum);
|
|
@@ -14813,7 +14814,7 @@ var DrawerBody = decorator(Form.create())(function (props) {
|
|
|
14813
14814
|
return;
|
|
14814
14815
|
}
|
|
14815
14816
|
|
|
14816
|
-
if (parseFloat(value) > lineAmountSum || parseFloat(value)
|
|
14817
|
+
if (parseFloat(value) > lineAmountSum || parseFloat(value) <= 0) {
|
|
14817
14818
|
callback('请输入大于0小于金额合计的数字');
|
|
14818
14819
|
}
|
|
14819
14820
|
|
package/dist/index.js
CHANGED
|
@@ -2256,7 +2256,7 @@ function mergeDiscount(_x) {
|
|
|
2256
2256
|
|
|
2257
2257
|
function _mergeDiscount() {
|
|
2258
2258
|
_mergeDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
|
|
2259
|
-
var goodsList, i, good, sum, zk;
|
|
2259
|
+
var goodsList, i, good, sum, zk, calculatingDigits;
|
|
2260
2260
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2261
2261
|
while (1) {
|
|
2262
2262
|
switch (_context.prev = _context.next) {
|
|
@@ -2287,8 +2287,9 @@ function _mergeDiscount() {
|
|
|
2287
2287
|
sum.quantity = good.quantity;
|
|
2288
2288
|
|
|
2289
2289
|
if (sum.quantity) {
|
|
2290
|
-
|
|
2291
|
-
sum.
|
|
2290
|
+
calculatingDigits = state.calculatingDigits;
|
|
2291
|
+
sum.priceExcludeTax = format15(mathjs.chain(mathjs.bignumber(sum.lineAmountExcludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
2292
|
+
sum.priceIncludeTax = format15(mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
2292
2293
|
}
|
|
2293
2294
|
|
|
2294
2295
|
goodsList.splice(i, 2, sum);
|
|
@@ -14823,7 +14824,7 @@ var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
|
|
|
14823
14824
|
return;
|
|
14824
14825
|
}
|
|
14825
14826
|
|
|
14826
|
-
if (parseFloat(value) > lineAmountSum || parseFloat(value)
|
|
14827
|
+
if (parseFloat(value) > lineAmountSum || parseFloat(value) <= 0) {
|
|
14827
14828
|
callback('请输入大于0小于金额合计的数字');
|
|
14828
14829
|
}
|
|
14829
14830
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { IGood, InvoiceControllerState, LineAttributeType } from '..';
|
|
4
|
+
import { format15 } from '../../tools/calculate';
|
|
4
5
|
import { chain, bignumber } from 'mathjs';
|
|
5
6
|
import idGenerator from '../../tools/idGenerator';
|
|
6
7
|
|
|
@@ -19,8 +20,9 @@ export default async function mergeDiscount(state: InvoiceControllerState) {
|
|
|
19
20
|
sum.taxAmount = chain(bignumber(sum.lineAmountIncludeTax)).subtract(bignumber(sum.lineAmountExcludeTax)).done().toNumber();
|
|
20
21
|
sum.quantity = good.quantity;
|
|
21
22
|
if (sum.quantity) {
|
|
22
|
-
|
|
23
|
-
sum.
|
|
23
|
+
const calculatingDigits = state.calculatingDigits;
|
|
24
|
+
sum.priceExcludeTax = format15(chain(bignumber(sum.lineAmountExcludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
25
|
+
sum.priceIncludeTax = format15(chain(bignumber(sum.lineAmountIncludeTax)).divide(bignumber(sum.quantity)).done().toNumber(), calculatingDigits) || 0;
|
|
24
26
|
}
|
|
25
27
|
goodsList.splice(i, 2, sum);
|
|
26
28
|
}
|
package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx
CHANGED
|
@@ -221,7 +221,7 @@ const DrawerBody = decorator<{}, FormComponentProps>(Form.create())((props) => {
|
|
|
221
221
|
validator: (_, value: string, callback) => {
|
|
222
222
|
if (!value) { callback(); return; }
|
|
223
223
|
if (!value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)?.length) { callback(); return; }
|
|
224
|
-
if (parseFloat(value) > lineAmountSum || parseFloat(value)
|
|
224
|
+
if (parseFloat(value) > lineAmountSum || parseFloat(value) <= 0) { callback('请输入大于0小于金额合计的数字'); }
|
|
225
225
|
callback();
|
|
226
226
|
},
|
|
227
227
|
},
|