kts-component-invoice-operate 3.2.100 → 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
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);
|
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);
|
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
|
}
|