kts-component-invoice-operate 3.0.17 → 3.0.18

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.
@@ -41,6 +41,10 @@ export default class GoodsListState {
41
41
  goodsMap: Map<string, IGood>;
42
42
  /** 货物菜单扩展 */
43
43
  goodsMenuExpand: ((index: string, controller: InvoiceController) => React.ReactNode)[];
44
+ /** 金额含税(受控,输入后不再自动计算) */
45
+ amountIncludeTax?: number;
46
+ /** 金额不含税(受控,输入后不再自动计算) */
47
+ amountExcludeTax?: number;
44
48
  /** 列表选中的货物索引列表 */
45
49
  selectedGoodIndex: string[];
46
50
  /** 准备添加折扣的货物索引列表 */
package/dist/index.esm.js CHANGED
@@ -1001,6 +1001,8 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1001
1001
  this.goodsList = [];
1002
1002
  this.goodsMap = new Map();
1003
1003
  this.goodsMenuExpand = [];
1004
+ this.amountIncludeTax = void 0;
1005
+ this.amountExcludeTax = void 0;
1004
1006
  this.selectedGoodIndex = [];
1005
1007
  this.discountGoodIndex = [];
1006
1008
  this.endowCode = new EndowCode();
@@ -1948,6 +1950,10 @@ var Statistics = (function () {
1948
1950
  var lineAmountIncludeTax = controller.useMemo(function (s) {
1949
1951
  var _s$goodsListState$for, _s$goodsListState$for2;
1950
1952
 
1953
+ if (typeof s.goodsListState.amountIncludeTax === 'number') {
1954
+ return s.goodsListState.amountIncludeTax;
1955
+ }
1956
+
1951
1957
  var sum = chain$1(bignumber(0));
1952
1958
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1953
1959
 
@@ -1968,6 +1974,10 @@ var Statistics = (function () {
1968
1974
  var lineAmountExcludeTax = controller.useMemo(function (s) {
1969
1975
  var _s$goodsListState$for3, _s$goodsListState$for4;
1970
1976
 
1977
+ if (typeof s.goodsListState.amountExcludeTax === 'number') {
1978
+ return s.goodsListState.amountExcludeTax;
1979
+ }
1980
+
1971
1981
  var sum = chain$1(bignumber(0));
1972
1982
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1973
1983
 
@@ -13374,9 +13384,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13374
13384
  endowCodeGood.forEach(function (good) {
13375
13385
  if (!good) return;
13376
13386
  good.itemName = setShorthand(good.itemName, values.shorthand);
13377
- good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13378
- // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
13379
-
13387
+ good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
13380
13388
  good.taxClassificationCode = values.taxClassificationCode;
13381
13389
  good.taxRate = values.taxRate;
13382
13390
  good.taxFreeType = values.taxFreeType;
@@ -13387,41 +13395,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13387
13395
  var lineAmountExcludeTax = chain$1(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
13388
13396
  var priceExcludeTax = good.priceIncludeTax ? chain$1(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
13389
13397
  good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
13390
- good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined; // if (s.goodsListState.isTaxIncluded) {
13391
- // const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
13392
- // const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
13393
- // good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
13394
- // good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
13395
- // } else {
13396
- // const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
13397
- // const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
13398
- // good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
13399
- // good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
13400
- // }
13401
-
13398
+ good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
13402
13399
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
13403
- }); //截取名称
13404
- // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
13405
- // await (() => new Promise<void>(resolve => {
13406
- // confirm({
13407
- // title: '温馨提示',
13408
- // content: '商品名称长度过长,是否截取名称',
13409
- // okText: '确定',
13410
- // cancelText: '取消',
13411
- // onOk() {
13412
- // endowCodeGood.forEach(e => {
13413
- // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
13414
- // })
13415
- // message.success('商品名称截取成功!')
13416
- // resolve()
13417
- // },
13418
- // onCancel() {
13419
- // resolve()
13420
- // },
13421
- // });
13422
- // }))()
13423
- // }
13424
-
13400
+ });
13425
13401
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
13426
13402
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
13427
13403
 
package/dist/index.js CHANGED
@@ -1011,6 +1011,8 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
1011
1011
  this.goodsList = [];
1012
1012
  this.goodsMap = new Map();
1013
1013
  this.goodsMenuExpand = [];
1014
+ this.amountIncludeTax = void 0;
1015
+ this.amountExcludeTax = void 0;
1014
1016
  this.selectedGoodIndex = [];
1015
1017
  this.discountGoodIndex = [];
1016
1018
  this.endowCode = new EndowCode();
@@ -1958,6 +1960,10 @@ var Statistics = (function () {
1958
1960
  var lineAmountIncludeTax = controller.useMemo(function (s) {
1959
1961
  var _s$goodsListState$for, _s$goodsListState$for2;
1960
1962
 
1963
+ if (typeof s.goodsListState.amountIncludeTax === 'number') {
1964
+ return s.goodsListState.amountIncludeTax;
1965
+ }
1966
+
1961
1967
  var sum = mathjs.chain(mathjs.bignumber(0));
1962
1968
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1963
1969
 
@@ -1978,6 +1984,10 @@ var Statistics = (function () {
1978
1984
  var lineAmountExcludeTax = controller.useMemo(function (s) {
1979
1985
  var _s$goodsListState$for3, _s$goodsListState$for4;
1980
1986
 
1987
+ if (typeof s.goodsListState.amountExcludeTax === 'number') {
1988
+ return s.goodsListState.amountExcludeTax;
1989
+ }
1990
+
1981
1991
  var sum = mathjs.chain(mathjs.bignumber(0));
1982
1992
  var editGood = s.goodsListState.editGood; // 正在编辑的货物
1983
1993
 
@@ -13384,9 +13394,7 @@ var DrawerBody$3 = function DrawerBody(props) {
13384
13394
  endowCodeGood.forEach(function (good) {
13385
13395
  if (!good) return;
13386
13396
  good.itemName = setShorthand(good.itemName, values.shorthand);
13387
- good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
13388
- // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
13389
-
13397
+ good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
13390
13398
  good.taxClassificationCode = values.taxClassificationCode;
13391
13399
  good.taxRate = values.taxRate;
13392
13400
  good.taxFreeType = values.taxFreeType;
@@ -13397,41 +13405,9 @@ var DrawerBody$3 = function DrawerBody(props) {
13397
13405
  var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
13398
13406
  var priceExcludeTax = good.priceIncludeTax ? mathjs.chain(mathjs.bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
13399
13407
  good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
13400
- good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined; // if (s.goodsListState.isTaxIncluded) {
13401
- // const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
13402
- // const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
13403
- // good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
13404
- // good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
13405
- // } else {
13406
- // const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
13407
- // const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
13408
- // good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
13409
- // good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
13410
- // }
13411
-
13408
+ good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
13412
13409
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
13413
- }); //截取名称
13414
- // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
13415
- // await (() => new Promise<void>(resolve => {
13416
- // confirm({
13417
- // title: '温馨提示',
13418
- // content: '商品名称长度过长,是否截取名称',
13419
- // okText: '确定',
13420
- // cancelText: '取消',
13421
- // onOk() {
13422
- // endowCodeGood.forEach(e => {
13423
- // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
13424
- // })
13425
- // message.success('商品名称截取成功!')
13426
- // resolve()
13427
- // },
13428
- // onCancel() {
13429
- // resolve()
13430
- // },
13431
- // });
13432
- // }))()
13433
- // }
13434
-
13410
+ });
13435
13411
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
13436
13412
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
13437
13413
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.0.17",
3
+ "version": "3.0.18",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -56,6 +56,12 @@ export default class GoodsListState {
56
56
  /** 货物菜单扩展 */
57
57
  goodsMenuExpand: ((index: string, controller: InvoiceController) => React.ReactNode)[] = [];
58
58
 
59
+ /** 金额含税(受控,输入后不再自动计算) */
60
+ amountIncludeTax?: number;
61
+
62
+ /** 金额不含税(受控,输入后不再自动计算) */
63
+ amountExcludeTax?: number;
64
+
59
65
  /** 列表选中的货物索引列表 */
60
66
  selectedGoodIndex: string[] = [];
61
67
 
@@ -293,9 +293,6 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
293
293
  good.itemName = setShorthand(good.itemName, values.shorthand);
294
294
  good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
295
295
 
296
- // const name = getItemName(good.itemName, values.shorthand);
297
- // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
298
-
299
296
  good.taxClassificationCode = values.taxClassificationCode;
300
297
  good.taxRate = values.taxRate;
301
298
  good.taxFreeType = values.taxFreeType;
@@ -311,45 +308,9 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
311
308
  good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
312
309
  good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
313
310
 
314
- // if (s.goodsListState.isTaxIncluded) {
315
- // const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
316
- // const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
317
-
318
- // good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
319
- // good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
320
- // } else {
321
- // const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
322
- // const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
323
-
324
- // good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
325
- // good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
326
- // }
327
-
328
311
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
329
312
  });
330
313
 
331
- //截取名称
332
- // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
333
- // await (() => new Promise<void>(resolve => {
334
- // confirm({
335
- // title: '温馨提示',
336
- // content: '商品名称长度过长,是否截取名称',
337
- // okText: '确定',
338
- // cancelText: '取消',
339
- // onOk() {
340
- // endowCodeGood.forEach(e => {
341
- // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
342
- // })
343
- // message.success('商品名称截取成功!')
344
- // resolve()
345
- // },
346
- // onCancel() {
347
- // resolve()
348
- // },
349
- // });
350
- // }))()
351
- // }
352
-
353
314
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
354
315
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
355
316
  })();
@@ -14,6 +14,10 @@ export default () => {
14
14
 
15
15
  /** 金额(含税) */
16
16
  const lineAmountIncludeTax = controller.useMemo((s) => {
17
+ if (typeof s.goodsListState.amountIncludeTax === 'number') {
18
+ return s.goodsListState.amountIncludeTax
19
+ }
20
+
17
21
  let sum = chain(bignumber(0));
18
22
  const editGood = s.goodsListState.editGood; // 正在编辑的货物
19
23
  const err = s.goodsListState.form?.getFieldsError() ?? {};
@@ -32,6 +36,10 @@ export default () => {
32
36
 
33
37
  /** 金额(不含税) */
34
38
  const lineAmountExcludeTax = controller.useMemo((s) => {
39
+ if (typeof s.goodsListState.amountExcludeTax === 'number') {
40
+ return s.goodsListState.amountExcludeTax
41
+ }
42
+
35
43
  let sum = chain(bignumber(0));
36
44
  const editGood = s.goodsListState.editGood; // 正在编辑的货物
37
45
  const err = s.goodsListState.form?.getFieldsError() ?? {};