tripstorekrabi-shared 1.13.1 → 1.13.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/price.js +1 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -112,9 +112,6 @@ export function countMaxPeople(pricing) {
112
112
 
113
113
  export function calculateTotalPrice(data, product, mode = "retail") {
114
114
  let total = calculateProductPrice(data, product.pricing, mode);
115
- total += calculateStartEndPointPrice(data, findStartingPoint(product, data.startingPointId, false), mode === "retail" || mode === "partner");
116
- total += calculateStartEndPointPrice(data, findEndPoint(product, data.endPointId, false), mode === "retail" || mode === "partner");
117
- total += calculateNationalParkFee(data, product);
118
115
  total += calculateExtraPayments(data, mode === "retail" || mode === "partner");
119
116
  total += calculateAddOnsPrice(data, product, mode === "retail" || mode === "partner");
120
117
  return total;
@@ -127,7 +124,7 @@ export function calculateNationalParkFee(data, product) {
127
124
  export function calculateExtraPayments(data, selling = true) {
128
125
  let total = 0;
129
126
  if (data.extraPayments) {
130
- for (const extraPayment of Object.values(data.extraPayments).filter((item) => !item.disabled && !item.category)) {
127
+ for (const extraPayment of Object.values(data.extraPayments).filter((item) => !item.disabled)) {
131
128
  total += selling ? (extraPayment.receivedAmount ? extraPayment.receivedAmount : extraPayment.price) : extraPayment.operatorPrice;
132
129
  }
133
130
  }