kts-component-invoice-operate 3.2.99 → 3.2.101
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 +14 -14
- package/dist/index.js +14 -14
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +1 -1
- package/src/Invoice/InvoiceController/fns/mergeDiscount.ts +4 -2
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +22 -24
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);
|
|
@@ -10968,22 +10969,20 @@ function ItemNameInput(props) {
|
|
|
10968
10969
|
return _context3.abrupt("return");
|
|
10969
10970
|
|
|
10970
10971
|
case 3:
|
|
10971
|
-
|
|
10972
|
+
setValue(record.itemName);
|
|
10973
|
+
setSelectLine(record);
|
|
10974
|
+
_context3.next = 7;
|
|
10972
10975
|
return controller.setEditGood({
|
|
10973
10976
|
itemName: record.itemName
|
|
10974
10977
|
});
|
|
10975
10978
|
|
|
10976
|
-
case 5:
|
|
10977
|
-
_context3.next = 7;
|
|
10978
|
-
return controller.importGoodsDrawer(record);
|
|
10979
|
-
|
|
10980
10979
|
case 7:
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10980
|
+
_context3.next = 9;
|
|
10981
|
+
return controller.importGoodsDrawer(_objectSpread2(_objectSpread2({}, record), {}, {
|
|
10982
|
+
$index: undefined
|
|
10983
|
+
}));
|
|
10985
10984
|
|
|
10986
|
-
case
|
|
10985
|
+
case 9:
|
|
10987
10986
|
case "end":
|
|
10988
10987
|
return _context3.stop();
|
|
10989
10988
|
}
|
|
@@ -11007,7 +11006,7 @@ function ItemNameInput(props) {
|
|
|
11007
11006
|
}
|
|
11008
11007
|
}, "*", props.shorthand, "*"), React.createElement(AutoComplete$1, {
|
|
11009
11008
|
onSearch: onSearch,
|
|
11010
|
-
value: value,
|
|
11009
|
+
value: props.value,
|
|
11011
11010
|
options: options.map(function (e) {
|
|
11012
11011
|
return {
|
|
11013
11012
|
value: e.$index,
|
|
@@ -11020,6 +11019,7 @@ function ItemNameInput(props) {
|
|
|
11020
11019
|
height: '100%',
|
|
11021
11020
|
border: 'none'
|
|
11022
11021
|
},
|
|
11022
|
+
value: value,
|
|
11023
11023
|
onChange: onChange,
|
|
11024
11024
|
onBlur: onBlur
|
|
11025
11025
|
})));
|
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);
|
|
@@ -10978,22 +10979,20 @@ function ItemNameInput(props) {
|
|
|
10978
10979
|
return _context3.abrupt("return");
|
|
10979
10980
|
|
|
10980
10981
|
case 3:
|
|
10981
|
-
|
|
10982
|
+
setValue(record.itemName);
|
|
10983
|
+
setSelectLine(record);
|
|
10984
|
+
_context3.next = 7;
|
|
10982
10985
|
return controller.setEditGood({
|
|
10983
10986
|
itemName: record.itemName
|
|
10984
10987
|
});
|
|
10985
10988
|
|
|
10986
|
-
case 5:
|
|
10987
|
-
_context3.next = 7;
|
|
10988
|
-
return controller.importGoodsDrawer(record);
|
|
10989
|
-
|
|
10990
10989
|
case 7:
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10990
|
+
_context3.next = 9;
|
|
10991
|
+
return controller.importGoodsDrawer(_objectSpread2(_objectSpread2({}, record), {}, {
|
|
10992
|
+
$index: undefined
|
|
10993
|
+
}));
|
|
10995
10994
|
|
|
10996
|
-
case
|
|
10995
|
+
case 9:
|
|
10997
10996
|
case "end":
|
|
10998
10997
|
return _context3.stop();
|
|
10999
10998
|
}
|
|
@@ -11017,7 +11016,7 @@ function ItemNameInput(props) {
|
|
|
11017
11016
|
}
|
|
11018
11017
|
}, "*", props.shorthand, "*"), React__default['default'].createElement(ktsXui.AutoComplete, {
|
|
11019
11018
|
onSearch: onSearch,
|
|
11020
|
-
value: value,
|
|
11019
|
+
value: props.value,
|
|
11021
11020
|
options: options.map(function (e) {
|
|
11022
11021
|
return {
|
|
11023
11022
|
value: e.$index,
|
|
@@ -11030,6 +11029,7 @@ function ItemNameInput(props) {
|
|
|
11030
11029
|
height: '100%',
|
|
11031
11030
|
border: 'none'
|
|
11032
11031
|
},
|
|
11032
|
+
value: value,
|
|
11033
11033
|
onChange: onChange,
|
|
11034
11034
|
onBlur: onBlur
|
|
11035
11035
|
})));
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
|
|
|
32
32
|
between.lineAmountExcludeTax = record.lineAmountExcludeTax;
|
|
33
33
|
between.taxRate = record.taxRate;
|
|
34
34
|
between.taxAmount = record.taxAmount;
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
// 设置编辑货物
|
|
37
37
|
const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
|
|
38
38
|
|
|
@@ -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
|
}
|
|
@@ -24,24 +24,24 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
24
24
|
}, [])
|
|
25
25
|
|
|
26
26
|
const onBlur = React.useCallback(async (searchText: any) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
try {
|
|
28
|
+
if (autoComplete.onItemNameBlur) {
|
|
29
|
+
if (!selectLine?.shorthand) {
|
|
30
|
+
const taxCategoryData: any = await autoComplete.onItemNameBlur(searchText);
|
|
31
|
+
if (taxCategoryData && taxCategoryData[0]) {
|
|
32
|
+
const params = {
|
|
33
|
+
...props.editGood,
|
|
34
|
+
taxClassificationCode: taxCategoryData[0].taxCategoryCode,
|
|
35
|
+
shorthand: taxCategoryData[0].shorthand
|
|
36
|
+
}
|
|
37
|
+
controller.importGoodsDrawer(params);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
setSelectLine(null);
|
|
38
41
|
}
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
} catch (error) {
|
|
43
|
+
throw error;
|
|
41
44
|
}
|
|
42
|
-
} catch (error) {
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
45
|
}, [autoComplete.onItemNameBlur, selectLine, props.editGood])
|
|
46
46
|
|
|
47
47
|
const onSearch = React.useCallback(async (searchText: string) => {
|
|
@@ -62,15 +62,13 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
62
62
|
const record = options.filter(e => e.$index === i.value)[0] as any;
|
|
63
63
|
if (!record) return;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
setValue(record.itemName);
|
|
66
|
+
setSelectLine(record);
|
|
66
67
|
|
|
67
|
-
await controller.
|
|
68
|
+
await controller.setEditGood({ itemName: record.itemName });
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
setSelectLine(record[0]);
|
|
71
|
-
controller.importGoodsDrawer(record);
|
|
70
|
+
await controller.importGoodsDrawer({ ...record, $index: undefined });
|
|
72
71
|
|
|
73
|
-
setOptions([]);
|
|
74
72
|
}, [options, controller])
|
|
75
73
|
|
|
76
74
|
React.useEffect(() => { setValue(props.value) }, [props.value])
|
|
@@ -80,11 +78,11 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
|
|
|
80
78
|
{props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
|
|
81
79
|
<AutoComplete
|
|
82
80
|
onSearch={onSearch}
|
|
83
|
-
value={value}
|
|
81
|
+
value={props.value}
|
|
84
82
|
options={options.map(e => ({ value: e.$index, label: e.itemName }))}
|
|
85
83
|
onSelect={onChangeAutoComplete}
|
|
86
84
|
>
|
|
87
|
-
<Input style={{ height: '100%', border: 'none' }} onChange={onChange} onBlur={onBlur} />
|
|
85
|
+
<Input style={{ height: '100%', border: 'none' }} value={value} onChange={onChange} onBlur={onBlur} />
|
|
88
86
|
</AutoComplete>
|
|
89
87
|
</div>
|
|
90
88
|
)
|