tripstorekrabi-shared 1.12.8 → 1.12.9

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 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.12.8",
3
+ "version": "1.12.9",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -128,7 +128,7 @@ export function calculateExtraPayments(data, selling = true) {
128
128
  let total = 0;
129
129
  if (data.extraPayments) {
130
130
  for (const extraPayment of Object.values(data.extraPayments)) {
131
- total += selling ? extraPayment.receivedAmount : extraPayment.operatorPrice;
131
+ total += selling ? (extraPayment.receivedAmount ? extraPayment.receivedAmount : extraPayment.price) : extraPayment.operatorPrice;
132
132
  }
133
133
  }
134
134
  return total;