tripstorekrabi-shared 1.13.35 → 1.13.37

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 +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.35",
3
+ "version": "1.13.37",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -20,6 +20,10 @@ export const EXTRA_PAYMENT_CATEGORIES = [STARTING_POINT_EXTRA_PAYMENT,
20
20
  ADD_ON_EXTRA_PAYMENT,
21
21
  OTHER_EXTRA_PAYMENT];
22
22
 
23
+ export function calculateProductSellingPrice(booking, pricing) {
24
+ return calculateProductPrice(booking, pricing, { paymentMode: SELLING_PAYMENT_MODE });
25
+ }
26
+
23
27
  export function calculateProductPartnerNetPrice(booking, pricing) {
24
28
  return calculateProductPrice(booking, pricing, { paymentMode: PARTNER_PAYMENT_MODE });
25
29
  }
@@ -160,6 +164,10 @@ export function calculatePartnerNetPrice(booking, product) {
160
164
  );
161
165
  }
162
166
 
167
+ export function calculateTotalSellingPrice(booking, product) {
168
+ return calculateTotalPrice(booking, product, options = { paymentMode: SELLING_PAYMENT_MODE });
169
+ }
170
+
163
171
  export function calculateTotalOperatorPrice(booking, product) {
164
172
  return calculateTotalPrice(booking, product, options = { paymentMode: OPERATOR_PAYMENT_MODE });
165
173
  }
@@ -168,7 +176,7 @@ export function calculateTotalPartnerNetPrice(booking, product) {
168
176
  return calculateTotalPrice(booking, product, options = { paymentMode: PARTNER_PAYMENT_MODE });
169
177
  }
170
178
 
171
- export function calculateTotalPrice(booking, product, options = { paymentMode: SELLING_PAYMENT_MODE }) {
179
+ function calculateTotalPrice(booking, product, options = { paymentMode: SELLING_PAYMENT_MODE }) {
172
180
  let total = calculateProductPrice(booking, product.pricing, options);
173
181
  total += calculateStartEndPointPrice(booking, findStartingPoint(product, booking.startingPointId, false), options);
174
182
  total += calculateStartEndPointPrice(booking, findEndPoint(product, booking.endPointId, false), options);