taxtank-core 0.30.100 → 0.30.101

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.
@@ -10,11 +10,11 @@ import { plainToClass, Type, Transform, Exclude, Expose, classToPlain } from 'cl
10
10
  import { JwtHelperService } from '@auth0/angular-jwt';
11
11
  import { __decorate } from 'tslib';
12
12
  import get from 'lodash/get';
13
+ import round from 'lodash/round';
13
14
  import flatten from 'lodash/flatten';
14
15
  import hasIn from 'lodash/hasIn';
15
16
  import first from 'lodash/first';
16
17
  import last from 'lodash/last';
17
- import round from 'lodash/round';
18
18
  import uniqBy from 'lodash/uniqBy';
19
19
  import differenceBy from 'lodash/differenceBy';
20
20
  import moment from 'moment';
@@ -433,10 +433,10 @@ class TransactionBase extends ObservableModel {
433
433
  return !this.isPropertyTank() && !this.isSoleTank();
434
434
  }
435
435
  get amountWithGst() {
436
- return this.isGST ? this.amount * ChartAccounts.GSTCoefficient : this.amount;
436
+ return this.isGST ? round(this.amount * ChartAccounts.GSTCoefficient, 2) : this.amount;
437
437
  }
438
438
  get gstAmount() {
439
- return +(this.amountWithGst - this.amount);
439
+ return round(this.amountWithGst - this.amount, 2);
440
440
  }
441
441
  get gstClaimAmount() {
442
442
  return this.gstAmount * this.claimRatio;
@@ -4271,6 +4271,48 @@ class TransactionReceipt extends TransactionReceipt$1 {
4271
4271
  }
4272
4272
  }
4273
4273
 
4274
+ /**
4275
+ * Income sources chart data
4276
+ */
4277
+ class IncomeSourceChartData {
4278
+ constructor(forecastedIncomeAmount, transactions) {
4279
+ this.forecastedIncomeAmount = forecastedIncomeAmount;
4280
+ this.transactions = transactions;
4281
+ }
4282
+ /**
4283
+ * Get prepared data for income sources chart
4284
+ */
4285
+ get() {
4286
+ const chartData = [{
4287
+ id: 'actualIncome',
4288
+ name: 'Actual Income',
4289
+ data: [],
4290
+ // display future actual incomes with dash line and past actual incomes with solid line
4291
+ zones: [{
4292
+ // line style after current month
4293
+ value: new FinancialYear().getMonthDate(new Date().getMonth()).getTime(),
4294
+ dashStyle: 'Solid'
4295
+ }, {
4296
+ // default line style
4297
+ dashStyle: 'Dash'
4298
+ }]
4299
+ }, {
4300
+ id: 'forecastedIncome',
4301
+ name: 'Forecasted Income',
4302
+ data: [],
4303
+ }];
4304
+ for (const key in MonthNameShortEnum) {
4305
+ if (MonthNameShortEnum.hasOwnProperty(key)) {
4306
+ // transaction collection for provided month
4307
+ const monthTransactionCollection = this.transactions.getByMonth(+MonthNumberEnum[key]);
4308
+ chartData[0].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), monthTransactionCollection.amount]);
4309
+ chartData[1].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), this.forecastedIncomeAmount / 12]);
4310
+ }
4311
+ }
4312
+ return chartData;
4313
+ }
4314
+ }
4315
+
4274
4316
  class TransactionMetaField extends TransactionMetaField$1 {
4275
4317
  }
4276
4318
  __decorate([
@@ -8906,48 +8948,6 @@ class ClientPortfolioChartData {
8906
8948
  class ClientPortfolioReport extends AbstractModel {
8907
8949
  }
8908
8950
 
8909
- /**
8910
- * Income sources chart data
8911
- */
8912
- class IncomeSourceChartData {
8913
- constructor(forecastedIncomeAmount, transactions) {
8914
- this.forecastedIncomeAmount = forecastedIncomeAmount;
8915
- this.transactions = transactions;
8916
- }
8917
- /**
8918
- * Get prepared data for income sources chart
8919
- */
8920
- get() {
8921
- const chartData = [{
8922
- id: 'actualIncome',
8923
- name: 'Actual Income',
8924
- data: [],
8925
- // display future actual incomes with dash line and past actual incomes with solid line
8926
- zones: [{
8927
- // line style after current month
8928
- value: new FinancialYear().getMonthDate(new Date().getMonth()).getTime(),
8929
- dashStyle: 'Solid'
8930
- }, {
8931
- // default line style
8932
- dashStyle: 'Dash'
8933
- }]
8934
- }, {
8935
- id: 'forecastedIncome',
8936
- name: 'Forecasted Income',
8937
- data: [],
8938
- }];
8939
- for (const key in MonthNameShortEnum) {
8940
- if (MonthNameShortEnum.hasOwnProperty(key)) {
8941
- // transaction collection for provided month
8942
- const monthTransactionCollection = this.transactions.getByMonth(+MonthNumberEnum[key]);
8943
- chartData[0].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), monthTransactionCollection.amount]);
8944
- chartData[1].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), this.forecastedIncomeAmount / 12]);
8945
- }
8946
- }
8947
- return chartData;
8948
- }
8949
- }
8950
-
8951
8951
  const NAME_TOKEN = 'token';
8952
8952
  const NAME_REFRESH_TOKEN = 'refreshToken';
8953
8953
  class JwtService extends JwtHelperService {