@freedom_sky/feige-lib 4.51.3 → 4.51.4
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.js +4 -3
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -169,10 +169,11 @@ function calcReceivablePrice(order, processArr, noTax) {
|
|
|
169
169
|
var rate_1 = -(10 - process.value) / 10;
|
|
170
170
|
var volume_1 = 0;
|
|
171
171
|
order.content.forEach(function (orderContentItem) {
|
|
172
|
+
var _a;
|
|
172
173
|
if (orderContentItem.dishSnapshot.noFullOrderDiscount) {
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
|
-
var dishTotalPrice = orderContentItem
|
|
176
|
+
var dishTotalPrice = calcContentPrice({ orderContentItem: orderContentItem, buffetItem: (_a = order.buffet) === null || _a === void 0 ? void 0 : _a.snapshot, orderType: order.type, adultNum: order.adultNum, childNum: order.childNum, contents: order.content });
|
|
176
177
|
totalDiscountPrice += dishTotalPrice;
|
|
177
178
|
volume_1 += dishTotalPrice * rate_1;
|
|
178
179
|
});
|
|
@@ -210,12 +211,12 @@ function calcReceivablePrice(order, processArr, noTax) {
|
|
|
210
211
|
var taxObj = {};
|
|
211
212
|
if (order.taxType === tax_enum_1.TaxTypeEnum.PriceNoTaxBindDish && !noTax) {
|
|
212
213
|
order.content.forEach(function (orderContentItem) {
|
|
213
|
-
var _a;
|
|
214
|
+
var _a, _b;
|
|
214
215
|
if (!orderContentItem.dishSnapshot.taxes || orderContentItem.dishSnapshot.taxes.length === 0) {
|
|
215
216
|
return;
|
|
216
217
|
}
|
|
217
218
|
var discountValue = (_a = sortedProcessArr.find(function (process) { return process.type === const_1.CONST.RECEIVABLE_PROCESSING_TYPE.DISCOUNT.TYPE; })) === null || _a === void 0 ? void 0 : _a.value;
|
|
218
|
-
var dishTotalPrice = orderContentItem
|
|
219
|
+
var dishTotalPrice = calcContentPrice({ orderContentItem: orderContentItem, buffetItem: (_b = order.buffet) === null || _b === void 0 ? void 0 : _b.snapshot, orderType: order.type, adultNum: order.adultNum, childNum: order.childNum, contents: order.content });
|
|
219
220
|
if (discountValue && !orderContentItem.dishSnapshot.noFullOrderDiscount) {
|
|
220
221
|
var rate = -(10 - discountValue) / 10;
|
|
221
222
|
dishTotalPrice += dishTotalPrice * rate;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -198,7 +198,7 @@ export function calcReceivablePrice(
|
|
|
198
198
|
if (orderContentItem.dishSnapshot.noFullOrderDiscount) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
const dishTotalPrice = orderContentItem.
|
|
201
|
+
const dishTotalPrice = calcContentPrice({orderContentItem, buffetItem:order.buffet?.snapshot, orderType: order.type, adultNum:order.adultNum,childNum:order.childNum, contents: order.content})
|
|
202
202
|
totalDiscountPrice += dishTotalPrice;
|
|
203
203
|
volume += dishTotalPrice * rate;
|
|
204
204
|
});
|
|
@@ -240,7 +240,7 @@ export function calcReceivablePrice(
|
|
|
240
240
|
const discountValue = sortedProcessArr.find(
|
|
241
241
|
(process) => process.type === CONST.RECEIVABLE_PROCESSING_TYPE.DISCOUNT.TYPE,
|
|
242
242
|
)?.value;
|
|
243
|
-
let dishTotalPrice = orderContentItem.
|
|
243
|
+
let dishTotalPrice = calcContentPrice({orderContentItem, buffetItem:order.buffet?.snapshot, orderType: order.type, adultNum:order.adultNum,childNum:order.childNum, contents: order.content});
|
|
244
244
|
if (discountValue && !orderContentItem.dishSnapshot.noFullOrderDiscount) {
|
|
245
245
|
const rate = -(10 - discountValue) / 10;
|
|
246
246
|
dishTotalPrice += dishTotalPrice * rate;
|