turf-common 1.2.1-beta.25 → 1.2.1-beta.26
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/build/models/charge-model.js +10 -0
- package/package.json +1 -1
|
@@ -145,7 +145,11 @@ var ChargesModel = /** @class */ (function () {
|
|
|
145
145
|
return newChargeModel;
|
|
146
146
|
};
|
|
147
147
|
ChargesModel.prototype.modifyReduce = function (oldBookingCode, newBookingCode, cancellationUnit) {
|
|
148
|
+
var newTotalBookingHours = this.totalBookingHours -
|
|
149
|
+
oldBookingCode.getTotalTime("hr") +
|
|
150
|
+
(newBookingCode ? newBookingCode.getTotalTime("hr") : 0);
|
|
148
151
|
var newChargeModel = this.clone();
|
|
152
|
+
newChargeModel.totalBookingHours = newTotalBookingHours;
|
|
149
153
|
newChargeModel.couponCode = "";
|
|
150
154
|
var costDifference = oldBookingCode.getCost() - newBookingCode.getCost();
|
|
151
155
|
// console.log(`costDifference ${costDifference}`);
|
|
@@ -167,7 +171,11 @@ var ChargesModel = /** @class */ (function () {
|
|
|
167
171
|
return newChargeModel;
|
|
168
172
|
};
|
|
169
173
|
ChargesModel.prototype.modifyMove = function (oldBookingCode, newBookingCode, cancellationUnit) {
|
|
174
|
+
var newTotalBookingHours = this.totalBookingHours -
|
|
175
|
+
oldBookingCode.getTotalTime("hr") +
|
|
176
|
+
(newBookingCode ? newBookingCode.getTotalTime("hr") : 0);
|
|
170
177
|
var newChargeModel = this.clone();
|
|
178
|
+
newChargeModel.totalBookingHours = newTotalBookingHours;
|
|
171
179
|
var costDifference = newBookingCode.getCost() - oldBookingCode.getCost();
|
|
172
180
|
if (costDifference === 0) {
|
|
173
181
|
return newChargeModel;
|
|
@@ -197,7 +205,9 @@ var ChargesModel = /** @class */ (function () {
|
|
|
197
205
|
return that;
|
|
198
206
|
};
|
|
199
207
|
ChargesModel.prototype.modifyDelete = function (bookingCode, cancellationUnit) {
|
|
208
|
+
var newTotalBookingHours = this.totalBookingHours - bookingCode.getTotalTime("hr");
|
|
200
209
|
var newChargeModel = this.clone();
|
|
210
|
+
newChargeModel.totalBookingHours = newTotalBookingHours;
|
|
201
211
|
newChargeModel.couponCode = "";
|
|
202
212
|
var costDifference = bookingCode.getCost();
|
|
203
213
|
newChargeModel.cancelledBookingGrossAmount += costDifference;
|