kts-component-invoice-operate 3.2.73 → 3.2.75

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
@@ -10706,8 +10706,6 @@ function ItemNameInput(props) {
10706
10706
  while (1) {
10707
10707
  switch (_context2.prev = _context2.next) {
10708
10708
  case 0:
10709
- // const good = options.filter(e=>e.itemName === itemName)[0];
10710
- // good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
10711
10709
  record = options.filter(function (e) {
10712
10710
  return e.itemName === itemName;
10713
10711
  })[0];
@@ -10726,51 +10724,10 @@ function ItemNameInput(props) {
10726
10724
  });
10727
10725
 
10728
10726
  case 5:
10729
- controller.importGoodsDrawer(record); // controller.run(async s => {
10730
- // Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
10731
- // // 没用 被编辑的货物 和 form 就退出
10732
- // if (!s.goodsListState.editGood || !s.goodsListState.form) return;
10733
- // // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
10734
- // record.quantity = undefined;
10735
- // record.lineAmountExcludeTax = undefined;
10736
- // record.lineAmountIncludeTax = undefined;
10737
- // // 中间数据
10738
- // const between = { ...record };
10739
- // between.itemName = record.itemName;
10740
- // between.itemNameOther = record.itemName;
10741
- // // 设置编辑货物
10742
- // const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
10743
- // if (editGood.taxRate) {
10744
- // editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
10745
- // }
10746
- // if (`${editGood.priceIncludeTax}` === '0') {
10747
- // editGood.priceIncludeTax = undefined;
10748
- // editGood.priceExcludeTax = undefined;
10749
- // } else {
10750
- // editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
10751
- // }
10752
- // if (editGood.quantity && editGood.priceIncludeTax) {
10753
- // editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
10754
- // }
10755
- // // 导入FORM里
10756
- // if (s.goodsListState.isMyShow) {
10757
- // s.goodsListState.form.setFieldsValue({
10758
- // ...editGood,
10759
- // itemName: editGood.itemNameSelf,
10760
- // itemModelName: editGood.itemModelNameSelf,
10761
- // });
10762
- // } else {
10763
- // s.goodsListState.form.setFieldsValue({
10764
- // ...editGood,
10765
- // });
10766
- // }
10767
- // s.goodsListState.importGoods.isVisibleDrawer = false;
10768
- // s.goodsListState.isTaxIncluded
10769
- // ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
10770
- // : await updateUnitPriceTax(controller, s.goodsListState.form, record)
10771
- // })
10727
+ controller.importGoodsDrawer(record);
10728
+ setOptions([]);
10772
10729
 
10773
- case 6:
10730
+ case 7:
10774
10731
  case "end":
10775
10732
  return _context2.stop();
10776
10733
  }
@@ -12575,10 +12532,6 @@ var useColumns = (function (form) {
12575
12532
  return onChangeItemCode(controller, form, record);
12576
12533
 
12577
12534
  case 2:
12578
- _context2.next = 4;
12579
- return onChangeLineAmountIncludeTax(controller, form, record);
12580
-
12581
- case 4:
12582
12535
  case "end":
12583
12536
  return _context2.stop();
12584
12537
  }
package/dist/index.js CHANGED
@@ -10716,8 +10716,6 @@ function ItemNameInput(props) {
10716
10716
  while (1) {
10717
10717
  switch (_context2.prev = _context2.next) {
10718
10718
  case 0:
10719
- // const good = options.filter(e=>e.itemName === itemName)[0];
10720
- // good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
10721
10719
  record = options.filter(function (e) {
10722
10720
  return e.itemName === itemName;
10723
10721
  })[0];
@@ -10736,51 +10734,10 @@ function ItemNameInput(props) {
10736
10734
  });
10737
10735
 
10738
10736
  case 5:
10739
- controller.importGoodsDrawer(record); // controller.run(async s => {
10740
- // Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
10741
- // // 没用 被编辑的货物 和 form 就退出
10742
- // if (!s.goodsListState.editGood || !s.goodsListState.form) return;
10743
- // // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
10744
- // record.quantity = undefined;
10745
- // record.lineAmountExcludeTax = undefined;
10746
- // record.lineAmountIncludeTax = undefined;
10747
- // // 中间数据
10748
- // const between = { ...record };
10749
- // between.itemName = record.itemName;
10750
- // between.itemNameOther = record.itemName;
10751
- // // 设置编辑货物
10752
- // const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
10753
- // if (editGood.taxRate) {
10754
- // editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
10755
- // }
10756
- // if (`${editGood.priceIncludeTax}` === '0') {
10757
- // editGood.priceIncludeTax = undefined;
10758
- // editGood.priceExcludeTax = undefined;
10759
- // } else {
10760
- // editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
10761
- // }
10762
- // if (editGood.quantity && editGood.priceIncludeTax) {
10763
- // editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
10764
- // }
10765
- // // 导入FORM里
10766
- // if (s.goodsListState.isMyShow) {
10767
- // s.goodsListState.form.setFieldsValue({
10768
- // ...editGood,
10769
- // itemName: editGood.itemNameSelf,
10770
- // itemModelName: editGood.itemModelNameSelf,
10771
- // });
10772
- // } else {
10773
- // s.goodsListState.form.setFieldsValue({
10774
- // ...editGood,
10775
- // });
10776
- // }
10777
- // s.goodsListState.importGoods.isVisibleDrawer = false;
10778
- // s.goodsListState.isTaxIncluded
10779
- // ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
10780
- // : await updateUnitPriceTax(controller, s.goodsListState.form, record)
10781
- // })
10737
+ controller.importGoodsDrawer(record);
10738
+ setOptions([]);
10782
10739
 
10783
- case 6:
10740
+ case 7:
10784
10741
  case "end":
10785
10742
  return _context2.stop();
10786
10743
  }
@@ -12585,10 +12542,6 @@ var useColumns = (function (form) {
12585
12542
  return onChangeItemCode(controller, form, record);
12586
12543
 
12587
12544
  case 2:
12588
- _context2.next = 4;
12589
- return onChangeLineAmountIncludeTax(controller, form, record);
12590
-
12591
- case 4:
12592
12545
  case "end":
12593
12546
  return _context2.stop();
12594
12547
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.73",
3
+ "version": "3.2.75",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -134,157 +134,76 @@ for (let i = 0; i <= 10000; i++) {
134
134
 
135
135
  const lines: any[] = [
136
136
  {
137
- "buyersItemCode": null,
138
- "buyersItemModelName": "GN-G32Z104",
139
- "buyersItemName": "*配电控制设备*公牛(BULL)",
140
- "buyersItemUnit": null,
141
- "discount": 5010.04,
142
- "discountGroup": "31b6d887-4877-4926-abe8-ab49ef6902da",
143
- "dispatchDocumentReference": null,
144
- "dispatchLineReference": null,
145
- "favouredPolicyMark": "0",
146
- "favouredPolicyName": null,
147
- "id": "40823568750477313",
148
- "itemModelName": "GN-G32Z104",
149
- "itemName": "*配电控制设备*公牛(BULL)",
150
- "lineAmountExcludeTax": 443365.88,
151
- "lineAmountIncludeTax": 501003.53,
152
- "lineAttribute": 0,
153
- "lineDiscountExcludeTax": 4433.66,
154
- "lineDiscountRate": null,
155
- "lineId": "1740823580142206976",
156
- "lineOrder": 1,
157
- "materialCode": null,
158
- "noticeCodeNo": null,
159
- "noticeLineId": null,
160
- "orderLineId": null,
161
- "orderLineReference": null,
162
- "orderNo": null,
163
- "orderReference": null,
164
- "priceExcludeTax": 827.17518997,
165
- "priceIncludeTax": 934.70796467,
166
- "quantity": 536,
167
- "receiptDocumentReference": null,
168
- "receiptLineReference": null,
169
- "reconciliationDocumentReference": null,
170
- "reconciliationSheetLineReference": null,
171
- "relationReferences": null,
172
- "requisitionLineNo": null,
173
- "sellersItemCode": null,
174
- "sellersItemModelName": null,
175
- "sellersItemName": "*配电控制设备*1",
176
- "sellersItemUnit": null,
177
- "specialManagement": null,
178
- "statementCode": null,
179
- "statementLineId": null,
180
- "taxAmount": 57637.65,
181
- "taxClassificationCode": "1090407030000000000",
182
- "taxDiscount": 576.38,
183
- "taxRate": 13,
184
- "unit": "件",
185
- "zeroTaxRateFlag": 'dddddd'
137
+ "serialNumber": "1714491422279110656",
138
+ "lineNumber": 1,
139
+ "taxCode": "3070401000000000000",
140
+ "taxName": "信息技术服务",
141
+ "specification": null,
142
+ "itemName": "技术服务费",
143
+ "itemCode": "",
144
+ "unit": "套",
145
+ "quantity": 1.0000000000001,
146
+ "taxRate": 0.06,
147
+ "priceExcludeTax": 5,
148
+ "priceIncludeTax": 5.3,
149
+ "amountTax": 0.3,
150
+ "lineAmountExcludeTax": 5,
151
+ "lineAmountIncludeTax": 5.3,
152
+ "lineAttribute": LineAttributeType.被折扣行,
153
+ "discountGroup": "1714491422291693568",
154
+ "favouredPolicyMark": false,
155
+ "favouredPolicyName": null,
156
+ "zeroTaxRateFlag": null,
157
+ "referenceLines": null,
158
+ "version": 0
186
159
  },
187
160
  {
188
- "buyersItemCode": null,
189
- "buyersItemModelName": "GN-G32Z104",
190
- "buyersItemName": "*配电控制设备*公牛(BULL)",
191
- "buyersItemUnit": null,
192
- "discount": null,
193
- "discountGroup": "31b6d887-4877-4926-abe8-ab49ef6902da",
194
- "dispatchDocumentReference": null,
195
- "dispatchLineReference": null,
196
- "favouredPolicyMark": "0",
197
- "favouredPolicyName": null,
198
- "id": "40823568750477313",
199
- "itemModelName": "",
200
- "itemName": "*配电控制设备*公牛(BULL)",
201
- "lineAmountExcludeTax": -4433.66,
202
- "lineAmountIncludeTax": -5010.04,
203
- "lineAttribute": 0,
204
- "lineDiscountExcludeTax": null,
205
- "lineDiscountRate": null,
206
- "lineId": "1740823580142206976",
207
- "lineOrder": 2,
208
- "materialCode": null,
209
- "noticeCodeNo": null,
210
- "noticeLineId": null,
211
- "orderLineId": null,
212
- "orderLineReference": null,
213
- "orderNo": null,
214
- "orderReference": null,
215
- "priceExcludeTax": null,
216
- "priceIncludeTax": null,
217
- "quantity": null,
218
- "receiptDocumentReference": null,
219
- "receiptLineReference": null,
220
- "reconciliationDocumentReference": null,
221
- "reconciliationSheetLineReference": null,
222
- "relationReferences": null,
223
- "requisitionLineNo": null,
224
- "sellersItemCode": null,
225
- "sellersItemModelName": null,
226
- "sellersItemName": "*配电控制设备*1",
227
- "sellersItemUnit": null,
228
- "specialManagement": null,
229
- "statementCode": null,
230
- "statementLineId": null,
231
- "taxAmount": -576.38,
232
- "taxClassificationCode": "1090407030000000000",
233
- "taxDiscount": null,
234
- "taxRate": 13,
235
- "unit": "",
236
- "zeroTaxRateFlag": null
161
+ "serialNumber": "1714491422279110656",
162
+ "lineNumber": 2,
163
+ "taxCode": "3070401000000000000",
164
+ "taxName": "信息技术服务",
165
+ "specification": "",
166
+ "itemName": "技术服务费",
167
+ "itemCode": "",
168
+ "unit": "",
169
+ "quantity": null,
170
+ "taxRate": 0.06,
171
+ "priceExcludeTax": null,
172
+ "priceIncludeTax": null,
173
+ "amountTax": -0.06,
174
+ "lineAmountExcludeTax": 5,
175
+ "lineAmountIncludeTax": 5.3,
176
+ "lineAttribute": LineAttributeType.折扣行,
177
+ "discountGroup": "1714491422291693568",
178
+ "favouredPolicyMark": false,
179
+ "favouredPolicyName": null,
180
+ "zeroTaxRateFlag": null,
181
+ "referenceLines": null,
182
+ "version": 0
237
183
  },
238
184
  {
239
- "buyersItemCode": null,
240
- "buyersItemModelName": "GN-G32Z104",
241
- "buyersItemName": "打折",
242
- "buyersItemUnit": null,
243
- "discount": null,
244
- "discountGroup": "31b6d887-4877-4926-abe8-ab49ef6902da",
245
- "dispatchDocumentReference": null,
246
- "dispatchLineReference": null,
247
- "favouredPolicyMark": "0",
248
- "favouredPolicyName": null,
249
- "id": "40823568750477313",
250
- "itemModelName": "",
251
- "itemName": "打折",
252
- "lineAmountExcludeTax": 100,
253
- "lineAmountIncludeTax": 100,
254
- "lineAttribute": 4,
255
- "lineDiscountExcludeTax": null,
256
- "lineDiscountRate": null,
257
- "lineId": "1740823580142206976",
258
- "lineOrder": 2,
259
- "materialCode": null,
260
- "noticeCodeNo": null,
261
- "noticeLineId": null,
262
- "orderLineId": null,
263
- "orderLineReference": null,
264
- "orderNo": null,
265
- "orderReference": null,
266
- "priceExcludeTax": null,
267
- "priceIncludeTax": null,
268
- "quantity": null,
269
- "receiptDocumentReference": null,
270
- "receiptLineReference": null,
271
- "reconciliationDocumentReference": null,
272
- "reconciliationSheetLineReference": null,
273
- "relationReferences": null,
274
- "requisitionLineNo": null,
275
- "sellersItemCode": null,
276
- "sellersItemModelName": null,
277
- "sellersItemName": "*配电控制设备*1",
278
- "sellersItemUnit": null,
279
- "specialManagement": null,
280
- "statementCode": null,
281
- "statementLineId": null,
282
- "taxAmount": -576.38,
283
- "taxClassificationCode": "1090407030000000000",
284
- "taxDiscount": null,
285
- "taxRate": 0,
286
- "unit": "",
287
- "zeroTaxRateFlag": null
185
+ "serialNumber": "1714491422279110656",
186
+ "lineNumber": 3,
187
+ "taxCode": "3070401000000000000",
188
+ "taxName": "信息技术服务",
189
+ "specification": null,
190
+ "itemName": "技术服务费",
191
+ "itemCode": null,
192
+ "unit": "套",
193
+ "quantity": 1,
194
+ "taxRate": 0.06,
195
+ "priceExcludeTax": 2,
196
+ "priceIncludeTax": 2.12,
197
+ "amountTax": 0.12,
198
+ "lineAmountExcludeTax": 5,
199
+ "lineAmountIncludeTax": 5.3,
200
+ "lineAttribute": LineAttributeType.正常,
201
+ "discountGroup": null,
202
+ "favouredPolicyMark": false,
203
+ "favouredPolicyName": null,
204
+ "zeroTaxRateFlag": null,
205
+ "referenceLines": null,
206
+ "version": 0
288
207
  }
289
208
  ]
290
209
 
@@ -56,14 +56,7 @@ class MyInvoiceController extends InvoiceController {
56
56
  "shorthand": "发电",
57
57
  "taxRate": 2
58
58
  },
59
- {
60
- "itemName": "苹果",
61
- "taxClassificationCode": "1010115010100000000",
62
- "itemModelName": null,
63
- "shorthand": "水果",
64
- "taxRate": 3
65
- }
66
- ] as any
59
+ ].slice() as any
67
60
  }
68
61
  }
69
62
 
@@ -115,7 +115,7 @@ export default (form: WrappedFormUtils) => {
115
115
  <ItemCodeInput
116
116
  onChange={async () => {
117
117
  await onChangeItemCode(controller, form, record);
118
- await onChangeLineAmountIncludeTax(controller, form, record);
118
+ // await onChangeLineAmountIncludeTax(controller, form, record);
119
119
  }}
120
120
  />
121
121
  )}
@@ -24,7 +24,7 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
24
24
  const onSearch = React.useCallback(async (searchText: string) => {
25
25
  try {
26
26
  if (autoComplete.onItemNameSearch) {
27
- setOptions(await autoComplete.onItemNameSearch(searchText))
27
+ setOptions(await autoComplete.onItemNameSearch(searchText));
28
28
  }
29
29
  } catch (error) {
30
30
  setOptions([])
@@ -33,67 +33,14 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
33
33
  }, [autoComplete.onItemNameSearch])
34
34
 
35
35
  const onChangeAutoComplete = React.useCallback(async itemName => {
36
- // const good = options.filter(e=>e.itemName === itemName)[0];
37
- // good && controller.state.goodsListState.form?.setFieldsValue(removeNullUndefined(good));
38
-
39
36
  const record = options.filter(e => e.itemName === itemName)[0] as any;
40
37
  if (!record) return;
41
38
 
42
39
  await controller.setEditGood({ itemName: record.itemName });
43
40
 
44
41
  controller.importGoodsDrawer(record);
45
- // controller.run(async s => {
46
- // Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
47
-
48
- // // 没用 被编辑的货物 和 form 就退出
49
- // if (!s.goodsListState.editGood || !s.goodsListState.form) return;
50
-
51
- // // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
52
- // record.quantity = undefined;
53
- // record.lineAmountExcludeTax = undefined;
54
- // record.lineAmountIncludeTax = undefined;
55
-
56
- // // 中间数据
57
- // const between = { ...record };
58
- // between.itemName = record.itemName;
59
- // between.itemNameOther = record.itemName;
60
-
61
- // // 设置编辑货物
62
- // const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
63
-
64
- // if (editGood.taxRate) {
65
- // editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood)
66
- // }
67
-
68
- // if (`${editGood.priceIncludeTax}` === '0') {
69
- // editGood.priceIncludeTax = undefined;
70
- // editGood.priceExcludeTax = undefined;
71
- // } else {
72
- // editGood.priceExcludeTax = getPriceExcludeTax(editGood, record, s.calculatingDigits) as number;
73
- // }
74
-
75
- // if (editGood.quantity && editGood.priceIncludeTax) {
76
- // editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax, s.calculatingDigits);
77
- // }
78
-
79
- // // 导入FORM里
80
- // if (s.goodsListState.isMyShow) {
81
- // s.goodsListState.form.setFieldsValue({
82
- // ...editGood,
83
- // itemName: editGood.itemNameSelf,
84
- // itemModelName: editGood.itemModelNameSelf,
85
- // });
86
- // } else {
87
- // s.goodsListState.form.setFieldsValue({
88
- // ...editGood,
89
- // });
90
- // }
91
-
92
- // s.goodsListState.importGoods.isVisibleDrawer = false;
93
- // s.goodsListState.isTaxIncluded
94
- // ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
95
- // : await updateUnitPriceTax(controller, s.goodsListState.form, record)
96
- // })
42
+
43
+ setOptions([]);
97
44
  }, [options, controller])
98
45
 
99
46
  return (