kts-component-invoice-operate 3.2.104 → 3.2.106
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 +207 -149
- package/dist/index.js +207 -149
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +2 -2
- package/src/Invoice/InvoiceController/fns/mergeDetails.ts +76 -43
- package/src/Invoice/_test/endowCode/index.tsx +118 -118
- package/src/Invoice/_test/importGoods/index.tsx +68 -32
package/dist/index.js
CHANGED
|
@@ -1823,111 +1823,170 @@ function mergeDetails(_x, _x2) {
|
|
|
1823
1823
|
/** 计算单价(含税) */
|
|
1824
1824
|
|
|
1825
1825
|
function _mergeDetails() {
|
|
1826
|
-
_mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1827
|
-
var goodsList,
|
|
1828
|
-
|
|
1826
|
+
_mergeDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(state, selectedGoodIndex) {
|
|
1827
|
+
var goodsList, grouping, merge, _merge;
|
|
1828
|
+
|
|
1829
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1829
1830
|
while (1) {
|
|
1830
|
-
switch (
|
|
1831
|
+
switch (_context2.prev = _context2.next) {
|
|
1831
1832
|
case 0:
|
|
1832
|
-
|
|
1833
|
+
_merge = function _merge3() {
|
|
1834
|
+
_merge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(goodsList) {
|
|
1835
|
+
var selectedGoodIndex, sum, p;
|
|
1836
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1837
|
+
while (1) {
|
|
1838
|
+
switch (_context.prev = _context.next) {
|
|
1839
|
+
case 0:
|
|
1840
|
+
if (!(goodsList.length < 2)) {
|
|
1841
|
+
_context.next = 2;
|
|
1842
|
+
break;
|
|
1843
|
+
}
|
|
1833
1844
|
|
|
1834
|
-
|
|
1835
|
-
_context.next = 3;
|
|
1836
|
-
break;
|
|
1837
|
-
}
|
|
1845
|
+
return _context.abrupt("return");
|
|
1838
1846
|
|
|
1839
|
-
|
|
1847
|
+
case 2:
|
|
1848
|
+
selectedGoodIndex = goodsList.map(function (e) {
|
|
1849
|
+
return e.$index;
|
|
1850
|
+
});
|
|
1851
|
+
_context.prev = 3;
|
|
1852
|
+
// 创建合并后的商品对象
|
|
1853
|
+
sum = {
|
|
1854
|
+
$index: idGenerator(),
|
|
1855
|
+
lineAttribute: goodsList[0].lineAttribute
|
|
1856
|
+
}; // 存在税率不一样的明细,不能合并
|
|
1840
1857
|
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
// const goodsList = state.goodsListState.goodsList.filter(e => state.goodsListState.selectedGoodIndex.indexOf(e.$index) >= 0)
|
|
1844
|
-
goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1845
|
-
return selectedGoodIndex.indexOf(e.$index) >= 0;
|
|
1846
|
-
});
|
|
1858
|
+
_context.next = 7;
|
|
1859
|
+
return checkTaxTate(goodsList);
|
|
1847
1860
|
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
}
|
|
1861
|
+
case 7:
|
|
1862
|
+
_context.next = 9;
|
|
1863
|
+
return fillingInformationGood(goodsList, sum);
|
|
1852
1864
|
|
|
1853
|
-
|
|
1865
|
+
case 9:
|
|
1866
|
+
sum = _context.sent;
|
|
1867
|
+
_context.next = 12;
|
|
1868
|
+
return mergeQuantity(goodsList);
|
|
1854
1869
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
$index: idGenerator(),
|
|
1860
|
-
lineAttribute: LineAttributeType$1.正常
|
|
1861
|
-
}; // 存在税率不一样的明细,不能合并
|
|
1870
|
+
case 12:
|
|
1871
|
+
sum.quantity = _context.sent;
|
|
1872
|
+
_context.next = 15;
|
|
1873
|
+
return mergeLineAmountExcludeTax(goodsList);
|
|
1862
1874
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1875
|
+
case 15:
|
|
1876
|
+
sum.lineAmountExcludeTax = _context.sent;
|
|
1877
|
+
_context.next = 18;
|
|
1878
|
+
return mergeLineAmountIncludeTax(goodsList);
|
|
1865
1879
|
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1880
|
+
case 18:
|
|
1881
|
+
sum.lineAmountIncludeTax = _context.sent;
|
|
1882
|
+
_context.next = 21;
|
|
1883
|
+
return calculatePriceExcludeTax(sum, state.calculatingDigits);
|
|
1884
|
+
|
|
1885
|
+
case 21:
|
|
1886
|
+
sum.priceExcludeTax = _context.sent;
|
|
1887
|
+
_context.next = 24;
|
|
1888
|
+
return calculatePriceIncludeTax(sum, state.calculatingDigits);
|
|
1889
|
+
|
|
1890
|
+
case 24:
|
|
1891
|
+
sum.priceIncludeTax = _context.sent;
|
|
1892
|
+
// 计算税额
|
|
1893
|
+
sum.taxAmount = mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).subtract(mathjs.bignumber(sum.lineAmountExcludeTax)).done().toNumber(); // 校验数据 是否数量和金额是否同号
|
|
1894
|
+
|
|
1895
|
+
_context.next = 28;
|
|
1896
|
+
return checkSameNumber(sum);
|
|
1897
|
+
|
|
1898
|
+
case 28:
|
|
1899
|
+
p = state.goodsListState.goodsList.indexOf(goodsList[0]);
|
|
1900
|
+
state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1901
|
+
return selectedGoodIndex.indexOf(e.$index) < 0;
|
|
1902
|
+
});
|
|
1903
|
+
state.goodsListState.goodsList.splice(p, 0, sum);
|
|
1904
|
+
state.goodsListState.goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1905
|
+
return e.lineAmountExcludeTax !== 0;
|
|
1906
|
+
});
|
|
1907
|
+
state.goodsListState.goodsMap = new Map();
|
|
1908
|
+
state.goodsListState.goodsList.forEach(function (e) {
|
|
1909
|
+
state.goodsListState.goodsMap.set(e.$index, e);
|
|
1910
|
+
});
|
|
1911
|
+
state.goodsListState.selectedGoodIndex = [];
|
|
1912
|
+
_context.next = 40;
|
|
1913
|
+
break;
|
|
1869
1914
|
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1915
|
+
case 37:
|
|
1916
|
+
_context.prev = 37;
|
|
1917
|
+
_context.t0 = _context["catch"](3);
|
|
1918
|
+
showError(_context.t0);
|
|
1874
1919
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1920
|
+
case 40:
|
|
1921
|
+
case "end":
|
|
1922
|
+
return _context.stop();
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
}, _callee, null, [[3, 37]]);
|
|
1926
|
+
}));
|
|
1927
|
+
return _merge.apply(this, arguments);
|
|
1928
|
+
};
|
|
1879
1929
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
return mergeLineAmountIncludeTax(goodsList);
|
|
1930
|
+
merge = function _merge2(_x14) {
|
|
1931
|
+
return _merge.apply(this, arguments);
|
|
1932
|
+
};
|
|
1884
1933
|
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1934
|
+
grouping = function _grouping(goodsList) {
|
|
1935
|
+
var grouped = {};
|
|
1936
|
+
goodsList.forEach(function (good) {
|
|
1937
|
+
var key = function () {
|
|
1938
|
+
switch (good.lineAttribute) {
|
|
1939
|
+
case LineAttributeType$1.折让行:
|
|
1940
|
+
return LineAttributeType$1.折让行;
|
|
1889
1941
|
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
_context.next = 27;
|
|
1893
|
-
return calculatePriceIncludeTax(sum, state.calculatingDigits);
|
|
1942
|
+
case LineAttributeType$1.赠品行:
|
|
1943
|
+
return LineAttributeType$1.赠品行;
|
|
1894
1944
|
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1945
|
+
default:
|
|
1946
|
+
return LineAttributeType$1.正常;
|
|
1947
|
+
}
|
|
1948
|
+
}();
|
|
1899
1949
|
|
|
1900
|
-
|
|
1901
|
-
|
|
1950
|
+
if (!grouped[key]) {
|
|
1951
|
+
grouped[key] = [];
|
|
1952
|
+
}
|
|
1902
1953
|
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1954
|
+
grouped[key].push(_objectSpread2(_objectSpread2({}, good), {}, {
|
|
1955
|
+
lineAttribute: key
|
|
1956
|
+
}));
|
|
1957
|
+
});
|
|
1958
|
+
return Object.values(grouped);
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1961
|
+
if (!(state.goodsListState.editGood || !selectedGoodIndex || selectedGoodIndex.length < 2)) {
|
|
1962
|
+
_context2.next = 5;
|
|
1963
|
+
break;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
return _context2.abrupt("return");
|
|
1967
|
+
|
|
1968
|
+
case 5:
|
|
1969
|
+
goodsList = state.goodsListState.goodsList.filter(function (e) {
|
|
1970
|
+
return selectedGoodIndex.indexOf(e.$index) >= 0;
|
|
1915
1971
|
});
|
|
1916
|
-
state.goodsListState.selectedGoodIndex = [];
|
|
1917
|
-
_context.next = 43;
|
|
1918
|
-
break;
|
|
1919
1972
|
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1973
|
+
if (!(goodsList.length < 2)) {
|
|
1974
|
+
_context2.next = 8;
|
|
1975
|
+
break;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
return _context2.abrupt("return");
|
|
1924
1979
|
|
|
1925
|
-
case
|
|
1980
|
+
case 8:
|
|
1981
|
+
grouping(goodsList).forEach(merge);
|
|
1982
|
+
/** 分组 */
|
|
1983
|
+
|
|
1984
|
+
case 9:
|
|
1926
1985
|
case "end":
|
|
1927
|
-
return
|
|
1986
|
+
return _context2.stop();
|
|
1928
1987
|
}
|
|
1929
1988
|
}
|
|
1930
|
-
},
|
|
1989
|
+
}, _callee2);
|
|
1931
1990
|
}));
|
|
1932
1991
|
return _mergeDetails.apply(this, arguments);
|
|
1933
1992
|
}
|
|
@@ -1939,29 +1998,29 @@ function calculatePriceIncludeTax(_x3, _x4) {
|
|
|
1939
1998
|
|
|
1940
1999
|
|
|
1941
2000
|
function _calculatePriceIncludeTax() {
|
|
1942
|
-
_calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2001
|
+
_calculatePriceIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(sum, calculatingDigits) {
|
|
1943
2002
|
var value;
|
|
1944
|
-
return _regeneratorRuntime().wrap(function
|
|
2003
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1945
2004
|
while (1) {
|
|
1946
|
-
switch (
|
|
2005
|
+
switch (_context3.prev = _context3.next) {
|
|
1947
2006
|
case 0:
|
|
1948
2007
|
if (sum.quantity) {
|
|
1949
|
-
|
|
2008
|
+
_context3.next = 2;
|
|
1950
2009
|
break;
|
|
1951
2010
|
}
|
|
1952
2011
|
|
|
1953
|
-
return
|
|
2012
|
+
return _context3.abrupt("return", undefined);
|
|
1954
2013
|
|
|
1955
2014
|
case 2:
|
|
1956
2015
|
value = mathjs.chain(mathjs.bignumber(sum.lineAmountIncludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber();
|
|
1957
|
-
return
|
|
2016
|
+
return _context3.abrupt("return", format15(value, calculatingDigits) || undefined);
|
|
1958
2017
|
|
|
1959
2018
|
case 4:
|
|
1960
2019
|
case "end":
|
|
1961
|
-
return
|
|
2020
|
+
return _context3.stop();
|
|
1962
2021
|
}
|
|
1963
2022
|
}
|
|
1964
|
-
},
|
|
2023
|
+
}, _callee3);
|
|
1965
2024
|
}));
|
|
1966
2025
|
return _calculatePriceIncludeTax.apply(this, arguments);
|
|
1967
2026
|
}
|
|
@@ -1973,29 +2032,29 @@ function calculatePriceExcludeTax(_x5, _x6) {
|
|
|
1973
2032
|
|
|
1974
2033
|
|
|
1975
2034
|
function _calculatePriceExcludeTax() {
|
|
1976
|
-
_calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2035
|
+
_calculatePriceExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(sum, calculatingDigits) {
|
|
1977
2036
|
var value;
|
|
1978
|
-
return _regeneratorRuntime().wrap(function
|
|
2037
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1979
2038
|
while (1) {
|
|
1980
|
-
switch (
|
|
2039
|
+
switch (_context4.prev = _context4.next) {
|
|
1981
2040
|
case 0:
|
|
1982
2041
|
if (sum.quantity) {
|
|
1983
|
-
|
|
2042
|
+
_context4.next = 2;
|
|
1984
2043
|
break;
|
|
1985
2044
|
}
|
|
1986
2045
|
|
|
1987
|
-
return
|
|
2046
|
+
return _context4.abrupt("return", undefined);
|
|
1988
2047
|
|
|
1989
2048
|
case 2:
|
|
1990
2049
|
value = format15(mathjs.chain(mathjs.bignumber(sum.lineAmountExcludeTax)).divide(mathjs.bignumber(sum.quantity)).done().toNumber());
|
|
1991
|
-
return
|
|
2050
|
+
return _context4.abrupt("return", format15(value, calculatingDigits) || undefined);
|
|
1992
2051
|
|
|
1993
2052
|
case 5:
|
|
1994
2053
|
case "end":
|
|
1995
|
-
return
|
|
2054
|
+
return _context4.stop();
|
|
1996
2055
|
}
|
|
1997
2056
|
}
|
|
1998
|
-
},
|
|
2057
|
+
}, _callee4);
|
|
1999
2058
|
}));
|
|
2000
2059
|
return _calculatePriceExcludeTax.apply(this, arguments);
|
|
2001
2060
|
}
|
|
@@ -2007,24 +2066,24 @@ function mergeLineAmountIncludeTax(_x7) {
|
|
|
2007
2066
|
|
|
2008
2067
|
|
|
2009
2068
|
function _mergeLineAmountIncludeTax() {
|
|
2010
|
-
_mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2069
|
+
_mergeLineAmountIncludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(goodsList) {
|
|
2011
2070
|
var sum;
|
|
2012
|
-
return _regeneratorRuntime().wrap(function
|
|
2071
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2013
2072
|
while (1) {
|
|
2014
|
-
switch (
|
|
2073
|
+
switch (_context5.prev = _context5.next) {
|
|
2015
2074
|
case 0:
|
|
2016
2075
|
sum = mathjs.chain(mathjs.bignumber(0));
|
|
2017
2076
|
goodsList.forEach(function (e) {
|
|
2018
2077
|
sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
|
|
2019
2078
|
});
|
|
2020
|
-
return
|
|
2079
|
+
return _context5.abrupt("return", sum.done().toNumber());
|
|
2021
2080
|
|
|
2022
2081
|
case 3:
|
|
2023
2082
|
case "end":
|
|
2024
|
-
return
|
|
2083
|
+
return _context5.stop();
|
|
2025
2084
|
}
|
|
2026
2085
|
}
|
|
2027
|
-
},
|
|
2086
|
+
}, _callee5);
|
|
2028
2087
|
}));
|
|
2029
2088
|
return _mergeLineAmountIncludeTax.apply(this, arguments);
|
|
2030
2089
|
}
|
|
@@ -2036,24 +2095,24 @@ function mergeLineAmountExcludeTax(_x8) {
|
|
|
2036
2095
|
|
|
2037
2096
|
|
|
2038
2097
|
function _mergeLineAmountExcludeTax() {
|
|
2039
|
-
_mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2098
|
+
_mergeLineAmountExcludeTax = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(goodsList) {
|
|
2040
2099
|
var sum;
|
|
2041
|
-
return _regeneratorRuntime().wrap(function
|
|
2100
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
2042
2101
|
while (1) {
|
|
2043
|
-
switch (
|
|
2102
|
+
switch (_context6.prev = _context6.next) {
|
|
2044
2103
|
case 0:
|
|
2045
2104
|
sum = mathjs.chain(mathjs.bignumber(0));
|
|
2046
2105
|
goodsList.forEach(function (e) {
|
|
2047
2106
|
sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
|
|
2048
2107
|
});
|
|
2049
|
-
return
|
|
2108
|
+
return _context6.abrupt("return", sum.done().toNumber());
|
|
2050
2109
|
|
|
2051
2110
|
case 3:
|
|
2052
2111
|
case "end":
|
|
2053
|
-
return
|
|
2112
|
+
return _context6.stop();
|
|
2054
2113
|
}
|
|
2055
2114
|
}
|
|
2056
|
-
},
|
|
2115
|
+
}, _callee6);
|
|
2057
2116
|
}));
|
|
2058
2117
|
return _mergeLineAmountExcludeTax.apply(this, arguments);
|
|
2059
2118
|
}
|
|
@@ -2065,24 +2124,24 @@ function mergeQuantity(_x9) {
|
|
|
2065
2124
|
|
|
2066
2125
|
|
|
2067
2126
|
function _mergeQuantity() {
|
|
2068
|
-
_mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2127
|
+
_mergeQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(goodsList) {
|
|
2069
2128
|
var sum;
|
|
2070
|
-
return _regeneratorRuntime().wrap(function
|
|
2129
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2071
2130
|
while (1) {
|
|
2072
|
-
switch (
|
|
2131
|
+
switch (_context7.prev = _context7.next) {
|
|
2073
2132
|
case 0:
|
|
2074
2133
|
sum = mathjs.chain(mathjs.bignumber(0));
|
|
2075
2134
|
goodsList.forEach(function (e) {
|
|
2076
2135
|
sum = sum.add(mathjs.bignumber(e.quantity || 0));
|
|
2077
2136
|
});
|
|
2078
|
-
return
|
|
2137
|
+
return _context7.abrupt("return", sum.done().toNumber() || undefined);
|
|
2079
2138
|
|
|
2080
2139
|
case 3:
|
|
2081
2140
|
case "end":
|
|
2082
|
-
return
|
|
2141
|
+
return _context7.stop();
|
|
2083
2142
|
}
|
|
2084
2143
|
}
|
|
2085
|
-
},
|
|
2144
|
+
}, _callee7);
|
|
2086
2145
|
}));
|
|
2087
2146
|
return _mergeQuantity.apply(this, arguments);
|
|
2088
2147
|
}
|
|
@@ -2094,26 +2153,26 @@ function fillingInformationGood(_x10, _x11) {
|
|
|
2094
2153
|
|
|
2095
2154
|
|
|
2096
2155
|
function _fillingInformationGood() {
|
|
2097
|
-
_fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2156
|
+
_fillingInformationGood = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(goodsList, sum) {
|
|
2098
2157
|
var goods;
|
|
2099
|
-
return _regeneratorRuntime().wrap(function
|
|
2158
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
2100
2159
|
while (1) {
|
|
2101
|
-
switch (
|
|
2160
|
+
switch (_context8.prev = _context8.next) {
|
|
2102
2161
|
case 0:
|
|
2103
2162
|
sum = _objectSpread2({}, sum);
|
|
2104
2163
|
goods = goodsList[findMaxIndex(goodsList.map(function (e) {
|
|
2105
2164
|
return e.lineAmountIncludeTax || 0;
|
|
2106
2165
|
}))];
|
|
2107
|
-
return
|
|
2108
|
-
lineAttribute:
|
|
2166
|
+
return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, goods), {}, {
|
|
2167
|
+
lineAttribute: sum.lineAttribute
|
|
2109
2168
|
}));
|
|
2110
2169
|
|
|
2111
2170
|
case 3:
|
|
2112
2171
|
case "end":
|
|
2113
|
-
return
|
|
2172
|
+
return _context8.stop();
|
|
2114
2173
|
}
|
|
2115
2174
|
}
|
|
2116
|
-
},
|
|
2175
|
+
}, _callee8);
|
|
2117
2176
|
}));
|
|
2118
2177
|
return _fillingInformationGood.apply(this, arguments);
|
|
2119
2178
|
}
|
|
@@ -2125,23 +2184,23 @@ function checkTaxTate(_x12) {
|
|
|
2125
2184
|
|
|
2126
2185
|
|
|
2127
2186
|
function _checkTaxTate() {
|
|
2128
|
-
_checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2187
|
+
_checkTaxTate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(goodsList) {
|
|
2129
2188
|
var tax, i;
|
|
2130
|
-
return _regeneratorRuntime().wrap(function
|
|
2189
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
2131
2190
|
while (1) {
|
|
2132
|
-
switch (
|
|
2191
|
+
switch (_context9.prev = _context9.next) {
|
|
2133
2192
|
case 0:
|
|
2134
2193
|
tax = goodsList[0].taxRate;
|
|
2135
2194
|
i = 1;
|
|
2136
2195
|
|
|
2137
2196
|
case 2:
|
|
2138
2197
|
if (!(i < goodsList.length)) {
|
|
2139
|
-
|
|
2198
|
+
_context9.next = 8;
|
|
2140
2199
|
break;
|
|
2141
2200
|
}
|
|
2142
2201
|
|
|
2143
2202
|
if (!(tax !== goodsList[i].taxRate)) {
|
|
2144
|
-
|
|
2203
|
+
_context9.next = 5;
|
|
2145
2204
|
break;
|
|
2146
2205
|
}
|
|
2147
2206
|
|
|
@@ -2149,15 +2208,15 @@ function _checkTaxTate() {
|
|
|
2149
2208
|
|
|
2150
2209
|
case 5:
|
|
2151
2210
|
i++;
|
|
2152
|
-
|
|
2211
|
+
_context9.next = 2;
|
|
2153
2212
|
break;
|
|
2154
2213
|
|
|
2155
2214
|
case 8:
|
|
2156
2215
|
case "end":
|
|
2157
|
-
return
|
|
2216
|
+
return _context9.stop();
|
|
2158
2217
|
}
|
|
2159
2218
|
}
|
|
2160
|
-
},
|
|
2219
|
+
}, _callee9);
|
|
2161
2220
|
}));
|
|
2162
2221
|
return _checkTaxTate.apply(this, arguments);
|
|
2163
2222
|
}
|
|
@@ -2169,23 +2228,23 @@ function checkSameNumber(_x13) {
|
|
|
2169
2228
|
|
|
2170
2229
|
|
|
2171
2230
|
function _checkSameNumber() {
|
|
2172
|
-
_checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2231
|
+
_checkSameNumber = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(good) {
|
|
2173
2232
|
var content, _content;
|
|
2174
2233
|
|
|
2175
|
-
return _regeneratorRuntime().wrap(function
|
|
2234
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
2176
2235
|
while (1) {
|
|
2177
|
-
switch (
|
|
2236
|
+
switch (_context10.prev = _context10.next) {
|
|
2178
2237
|
case 0:
|
|
2179
2238
|
if (good.quantity) {
|
|
2180
|
-
|
|
2239
|
+
_context10.next = 2;
|
|
2181
2240
|
break;
|
|
2182
2241
|
}
|
|
2183
2242
|
|
|
2184
|
-
return
|
|
2243
|
+
return _context10.abrupt("return");
|
|
2185
2244
|
|
|
2186
2245
|
case 2:
|
|
2187
2246
|
if (!(!good.lineAmountExcludeTax && good.lineAmountExcludeTax !== 0)) {
|
|
2188
|
-
|
|
2247
|
+
_context10.next = 6;
|
|
2189
2248
|
break;
|
|
2190
2249
|
}
|
|
2191
2250
|
|
|
@@ -2198,11 +2257,11 @@ function _checkSameNumber() {
|
|
|
2198
2257
|
|
|
2199
2258
|
case 6:
|
|
2200
2259
|
if (!(good.quantity >= 0 && good.lineAmountExcludeTax >= 0 || good.lineAmountExcludeTax === 0 || good.quantity < 0 && good.lineAmountExcludeTax < 0)) {
|
|
2201
|
-
|
|
2260
|
+
_context10.next = 10;
|
|
2202
2261
|
break;
|
|
2203
2262
|
}
|
|
2204
2263
|
|
|
2205
|
-
return
|
|
2264
|
+
return _context10.abrupt("return");
|
|
2206
2265
|
|
|
2207
2266
|
case 10:
|
|
2208
2267
|
_content = '合并失败,合并后“数量”和“金额”必须同时为正数或同时为负数。';
|
|
@@ -2214,10 +2273,10 @@ function _checkSameNumber() {
|
|
|
2214
2273
|
|
|
2215
2274
|
case 13:
|
|
2216
2275
|
case "end":
|
|
2217
|
-
return
|
|
2276
|
+
return _context10.stop();
|
|
2218
2277
|
}
|
|
2219
2278
|
}
|
|
2220
|
-
},
|
|
2279
|
+
}, _callee10);
|
|
2221
2280
|
}));
|
|
2222
2281
|
return _checkSameNumber.apply(this, arguments);
|
|
2223
2282
|
}
|
|
@@ -9315,27 +9374,26 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
|
|
|
9315
9374
|
}));
|
|
9316
9375
|
} else {
|
|
9317
9376
|
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
9318
|
-
}
|
|
9377
|
+
} // s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
9319
9378
|
|
|
9320
|
-
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
9321
9379
|
|
|
9322
9380
|
if (!s.goodsListState.isTaxIncluded) {
|
|
9323
|
-
_context.next =
|
|
9381
|
+
_context.next = 29;
|
|
9324
9382
|
break;
|
|
9325
9383
|
}
|
|
9326
9384
|
|
|
9327
|
-
_context.next =
|
|
9385
|
+
_context.next = 27;
|
|
9328
9386
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
9329
9387
|
|
|
9330
|
-
case
|
|
9331
|
-
_context.next =
|
|
9388
|
+
case 27:
|
|
9389
|
+
_context.next = 31;
|
|
9332
9390
|
break;
|
|
9333
9391
|
|
|
9334
|
-
case
|
|
9335
|
-
_context.next =
|
|
9392
|
+
case 29:
|
|
9393
|
+
_context.next = 31;
|
|
9336
9394
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
9337
9395
|
|
|
9338
|
-
case
|
|
9396
|
+
case 31:
|
|
9339
9397
|
case "end":
|
|
9340
9398
|
return _context.stop();
|
|
9341
9399
|
}
|
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
|
|
|
@@ -64,7 +64,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
67
|
+
// s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
68
68
|
s.goodsListState.isTaxIncluded
|
|
69
69
|
? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
70
70
|
: await updateUnitPriceTax(controller, s.goodsListState.form, record)
|