tripstorekrabi-shared 1.22.6 → 1.22.7
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/package.json +1 -1
- package/price.js +6 -3
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -47,14 +47,17 @@ function calculateSellingPrice(commissionRate = 0, price) {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function calculateInflatedSellingPrice(price, config) {
|
|
51
|
-
if (!config || !config.inflatedPrices) {
|
|
50
|
+
export function calculateInflatedSellingPrice(price, config, forceInflation = false) {
|
|
51
|
+
if (!config || (!config.inflatedPrices && !forceInflation)) {
|
|
52
52
|
return price;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const discountRate = Number(config.discount) || 0;
|
|
56
56
|
|
|
57
|
-
if (!isFinite(discountRate))
|
|
57
|
+
if (discountRate === 0 || !isFinite(discountRate)) {
|
|
58
|
+
return price;
|
|
59
|
+
}
|
|
60
|
+
|
|
58
61
|
const denominator = 100 - discountRate;
|
|
59
62
|
|
|
60
63
|
if (denominator <= 0) {
|