lazywait-calcs 1.1.1 → 1.1.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.
- package/lib/cjs/Calcs.js +3 -2
- package/lib/esm/Calcs.js +2 -2
- package/package.json +1 -1
package/lib/cjs/Calcs.js
CHANGED
|
@@ -208,11 +208,12 @@ function Deliveries(order_deliveries) {
|
|
|
208
208
|
let sum = 0;
|
|
209
209
|
if (order_deliveries) {
|
|
210
210
|
(order_deliveries || []).forEach((d) => {
|
|
211
|
+
var _a, _b;
|
|
211
212
|
if ((d === null || d === void 0 ? void 0 : d.delivery_type) === 'RADIUS') {
|
|
212
|
-
sum += (d.delivery_fee
|
|
213
|
+
sum += ((_a = d === null || d === void 0 ? void 0 : d.delivery_fee) !== null && _a !== void 0 ? _a : 0) * (d.delivery_radius || 1);
|
|
213
214
|
}
|
|
214
215
|
else {
|
|
215
|
-
sum += d.delivery_fee
|
|
216
|
+
sum += (_b = d === null || d === void 0 ? void 0 : d.delivery_fee) !== null && _b !== void 0 ? _b : 0;
|
|
216
217
|
}
|
|
217
218
|
});
|
|
218
219
|
}
|
package/lib/esm/Calcs.js
CHANGED
|
@@ -184,10 +184,10 @@ export function Deliveries(order_deliveries) {
|
|
|
184
184
|
if (order_deliveries) {
|
|
185
185
|
(order_deliveries || []).forEach((d) => {
|
|
186
186
|
if (d?.delivery_type === 'RADIUS') {
|
|
187
|
-
sum += (d
|
|
187
|
+
sum += (d?.delivery_fee ?? 0) * (d.delivery_radius || 1);
|
|
188
188
|
}
|
|
189
189
|
else {
|
|
190
|
-
sum += d
|
|
190
|
+
sum += d?.delivery_fee ?? 0;
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
}
|
package/package.json
CHANGED