taxtank-core 0.30.13 → 0.30.15
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.
|
@@ -6658,14 +6658,17 @@ class ServiceSubscription extends ServiceSubscription$1 {
|
|
|
6658
6658
|
return !!this.stripeId;
|
|
6659
6659
|
}
|
|
6660
6660
|
get price() {
|
|
6661
|
-
|
|
6661
|
+
let price = this.items.reduce((sum, item) => sum + item.total, 0);
|
|
6662
6662
|
if (!!this.stripePromoCode) {
|
|
6663
6663
|
if (this.stripePromoCode.isAmount()) {
|
|
6664
|
-
|
|
6664
|
+
price = price - this.stripePromoCode.amountOff;
|
|
6665
|
+
}
|
|
6666
|
+
else {
|
|
6667
|
+
price = price - price * (this.stripePromoCode.percentOff / 100);
|
|
6665
6668
|
}
|
|
6666
|
-
return price - price * (this.stripePromoCode.percentOff / 100);
|
|
6667
6669
|
}
|
|
6668
|
-
|
|
6670
|
+
// promo code can't make price < 0
|
|
6671
|
+
return price > 0 ? price : 0;
|
|
6669
6672
|
}
|
|
6670
6673
|
/**
|
|
6671
6674
|
* get title of subscription
|