@osovitny/anatoly 3.19.27 → 3.19.29
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.
|
@@ -4313,7 +4313,6 @@ class PaymentsService {
|
|
|
4313
4313
|
this.discountCode = null;
|
|
4314
4314
|
this.discountPercentage = null;
|
|
4315
4315
|
this.discountAmount = null;
|
|
4316
|
-
this.total = 0;
|
|
4317
4316
|
this.currency = 'USD';
|
|
4318
4317
|
//Private Streams
|
|
4319
4318
|
this._discountCodeApplied = new Subject();
|
|
@@ -4347,7 +4346,6 @@ class PaymentsService {
|
|
|
4347
4346
|
this.discountCode = null;
|
|
4348
4347
|
this.discountPercentage = null;
|
|
4349
4348
|
this.discountAmount = null;
|
|
4350
|
-
this.total = 0;
|
|
4351
4349
|
}
|
|
4352
4350
|
getTotal() {
|
|
4353
4351
|
let subtotal = this.subtotal;
|
|
@@ -4358,6 +4356,9 @@ class PaymentsService {
|
|
|
4358
4356
|
subtotal = subtotal - (subtotal * (this.discountPercentage / 100));
|
|
4359
4357
|
subtotal = +subtotal.toFixed(2);
|
|
4360
4358
|
}
|
|
4359
|
+
// Round to nearest whole number
|
|
4360
|
+
subtotal = Math.round(subtotal);
|
|
4361
|
+
// Ensure non-negative total
|
|
4361
4362
|
return subtotal > 0 ? subtotal : 0;
|
|
4362
4363
|
}
|
|
4363
4364
|
//DiscountCode
|