turf-common 1.1.1-beta.51 → 1.1.1-beta.52

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.
@@ -18,7 +18,9 @@ export declare class SubscribedPricingPlanModel extends PricingPlanModel {
18
18
  getGrossAmount(config?: {
19
19
  roundDown: boolean;
20
20
  }): number;
21
- getNetAmount(): number;
21
+ getNetAmount(config?: {
22
+ roundDown: boolean;
23
+ }): number;
22
24
  getBillingDiscount(): number;
23
25
  getMonthDifference(that: SubscribedPricingPlanModel): number;
24
26
  getGrossAmountByMonth(month: number): number;
@@ -37,7 +37,7 @@ var SubscribedPricingPlanModel = /** @class */ (function (_super) {
37
37
  return this.selectedPitchSlabBasePrice;
38
38
  };
39
39
  SubscribedPricingPlanModel.prototype.getGrossAmount = function (config) {
40
- if (config === void 0) { config = { roundDown: true }; }
40
+ if (config === void 0) { config = { roundDown: false }; }
41
41
  var roundDown = config.roundDown;
42
42
  if (!roundDown) {
43
43
  return Math.round(this.selectedPitchSlabBasePrice *
@@ -46,18 +46,29 @@ var SubscribedPricingPlanModel = /** @class */ (function (_super) {
46
46
  this.selectedBillingCycle.to);
47
47
  }
48
48
  else {
49
- return (Math.floor(this.selectedPitchSlabBasePrice *
49
+ return Math.floor(this.selectedPitchSlabBasePrice *
50
50
  this.pitchCount *
51
51
  this.hourInMonth *
52
- this.selectedBillingCycle.to));
52
+ this.selectedBillingCycle.to);
53
53
  }
54
54
  };
55
- SubscribedPricingPlanModel.prototype.getNetAmount = function () {
56
- return Math.round(this.selectedPitchSlabBasePrice *
57
- (1 - this.getBillingDiscount() / 100) *
58
- this.pitchCount *
59
- this.hourInMonth *
60
- this.selectedBillingCycle.to);
55
+ SubscribedPricingPlanModel.prototype.getNetAmount = function (config) {
56
+ if (config === void 0) { config = { roundDown: false }; }
57
+ var roundDown = config.roundDown;
58
+ if (!roundDown) {
59
+ return Math.round(this.selectedPitchSlabBasePrice *
60
+ (1 - this.getBillingDiscount() / 100) *
61
+ this.pitchCount *
62
+ this.hourInMonth *
63
+ this.selectedBillingCycle.to);
64
+ }
65
+ else {
66
+ return Math.floor(this.selectedPitchSlabBasePrice *
67
+ (1 - this.getBillingDiscount() / 100) *
68
+ this.pitchCount *
69
+ this.hourInMonth *
70
+ this.selectedBillingCycle.to);
71
+ }
61
72
  };
62
73
  SubscribedPricingPlanModel.prototype.getBillingDiscount = function () {
63
74
  return this.selectedBillingCycle.getDiscount();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.1.1-beta.51",
3
+ "version": "1.1.1-beta.52",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",