taxtank-core 0.28.51 → 0.28.53

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.
@@ -11200,6 +11200,7 @@
11200
11200
  this.businessActivities = uniqBy__default["default"](businesses.mapBy('activity'), 'id');
11201
11201
  this.businessABN = soleDetails === null || soleDetails === void 0 ? void 0 : soleDetails.abn;
11202
11202
  this.businessAddress = (_a = user.address) === null || _a === void 0 ? void 0 : _a.name;
11203
+ this.businesses = businesses;
11203
11204
  this.vehicleClaimDetails = vehicleClaimDetails;
11204
11205
  }
11205
11206
  return MyTaxBusinessDetails;
@@ -11310,7 +11311,7 @@
11310
11311
  * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4644110466/Tax+Return+MyTax+-+Online+Form (section "Business income or losses")
11311
11312
  */
11312
11313
  var MyTaxBusinessLosses = /** @class */ (function () {
11313
- function MyTaxBusinessLosses(transactions, depreciations, businessLosses, currentLoss) {
11314
+ function MyTaxBusinessLosses(transactions, depreciations, businessLosses, currentLoss, taxSummary) {
11314
11315
  this.currentLoss = currentLoss;
11315
11316
  this.purchasesAndOtherCostsAmount = Math.abs(transactions.getExpenseTransactions()
11316
11317
  .filterBy('chartAccounts.id', exports.ChartAccountsListEnum.PURCHASES_STOCK_INVENTORY)
@@ -11337,14 +11338,22 @@
11337
11338
  .filterBy('chartAccounts.id', exports.ChartAccountsListEnum.INTEREST_EXPENSES_OVERSEAS)
11338
11339
  .sumBy('claimAmount'));
11339
11340
  this.kmsTravelledExpensesAmount = Math.abs(transactions
11340
- .filterBy('chartAccounts.heading.id', [exports.ChartAccountsHeadingListEnum.WORK_RELATED_CAR_EXPENSES, exports.ChartAccountsHeadingListEnum.DEPRECIATION_VEHICLES])
11341
- .sumBy('claimAmount'));
11341
+ .filterBy('chartAccounts.category', [exports.ChartAccountsListEnum.KLMS_TRAVELLED])
11342
+ .sumBy('claimAmount') +
11343
+ depreciations
11344
+ .filterBy('chartAccounts.category', [exports.ChartAccountsListEnum.KLMS_TRAVELLED])
11345
+ .sumBy('claimAmount'));
11346
+ this.logbookExpensesAmount = Math.abs(transactions.getVehicleTransactions().sumBy('claimAmount')) +
11347
+ depreciations.getVehicleDepreciations().sumBy('claimAmount');
11342
11348
  this.otherExpensesAmount = Math.abs(transactions
11343
11349
  .filterBy('chartAccounts.heading.id', exports.ChartAccountsHeadingListEnum.OTHER_EXPENSES)
11344
11350
  .sumBy('claimAmount'));
11345
11351
  this.totalNonPrimaryProductionExpensesAmount = Math.abs(transactions
11346
- .filterBy('chartAccounts.category', [exports.ChartAccountsCategoryEnum.SOLE_EXPENSE, exports.ChartAccountsCategoryEnum.SOLE_DEPRECIATION])
11347
- .sumBy('claimAmount'));
11352
+ .filterBy('chartAccounts.category', [exports.ChartAccountsCategoryEnum.SOLE_EXPENSE])
11353
+ .sumBy('claimAmount')) +
11354
+ depreciations
11355
+ .filterBy('chartAccounts.category', [exports.ChartAccountsCategoryEnum.SOLE_DEPRECIATION])
11356
+ .sumBy('claimAmount');
11348
11357
  // depreciations
11349
11358
  this.depreciationExpensesAmount = depreciations
11350
11359
  .filterBy('chartAccounts.heading.id', exports.ChartAccountsHeadingListEnum.DEPRECIATION_EXPENSES)
@@ -11355,21 +11364,14 @@
11355
11364
  this.deductionsForGeneralSmallBusinessPoolAmount = depreciations
11356
11365
  .getSBPDepreciations()
11357
11366
  .sumBy('claimAmount');
11358
- this.currentYearNetNonPrimaryIncomeOrLossesAmount = transactions.getIncomeTransactions()
11359
- .filterBy('chartAccounts.category', exports.ChartAccountsCategoryEnum.SOLE_INCOME)
11360
- .amount -
11361
- Math.abs(transactions
11362
- .filterBy('chartAccounts.category', [exports.ChartAccountsCategoryEnum.SOLE_EXPENSE, exports.ChartAccountsCategoryEnum.SOLE_DEPRECIATION])
11363
- .sumBy('claimAmount'));
11364
- this.priorYearsNonPrimaryLossesAmount = this.calculatePriorYearsOpenBalance(businessLosses);
11365
- this.netNonPrimaryIncomeOrLossesAmount = transactions.getIncomeTransactions()
11366
- .filterBy('chartAccounts.category', exports.ChartAccountsCategoryEnum.SOLE_INCOME)
11367
- .amount -
11367
+ this.currentYearNetNonPrimaryIncomeOrLossesAmount = +(transactions.sumBy('claimAmount') -
11368
+ depreciations.sumBy('claimAmount'))
11369
+ .toFixed(2);
11370
+ this.priorYearsNonPrimaryLossesAmount = businessLosses.sumBy('openBalance');
11371
+ this.netNonPrimaryIncomeOrLossesAmount = this.currentYearNetNonPrimaryIncomeOrLossesAmount -
11368
11372
  this.priorYearsNonPrimaryLossesAmount;
11373
+ this.deferredLossesAmount = taxSummary.sole.items.sumByCategoriesAndSection(TAX_RETURN_CATEGORIES.sole.lossCurrent, exports.TaxSummarySectionEnum.SOLE_TANK);
11369
11374
  }
11370
- MyTaxBusinessLosses.prototype.calculatePriorYearsOpenBalance = function (businessLosses) {
11371
- return businessLosses ? businessLosses.sumBy('openBalance') : 0;
11372
- };
11373
11375
  return MyTaxBusinessLosses;
11374
11376
  }());
11375
11377
 
@@ -19386,7 +19388,7 @@
19386
19388
  __extends(MyTaxBusinessDetailsForm, _super);
19387
19389
  function MyTaxBusinessDetailsForm(businessDetails) {
19388
19390
  var _this = this;
19389
- var _a, _b;
19391
+ var _a;
19390
19392
  _this = _super.call(this, {
19391
19393
  vehicleClaimMethod: new forms.FormControl({
19392
19394
  value: (_a = businessDetails.vehicleClaimDetails) === null || _a === void 0 ? void 0 : _a.method,
@@ -19395,11 +19397,10 @@
19395
19397
  businessType: new forms.FormControl({ value: exports.BusinessTypeEnum.SOLE_TRADER, disabled: true }),
19396
19398
  // business details
19397
19399
  mainBusinessActivity: new forms.FormControl(businessDetails.businessActivities[0]),
19398
- mainBusinessName: new forms.FormControl({ value: (_b = businessDetails.businesses) === null || _b === void 0 ? void 0 : _b.first.name, disabled: true }),
19400
+ mainBusinessName: new forms.FormControl({ value: businessDetails.businesses.first.name, disabled: true }),
19399
19401
  mainBusinessABN: new forms.FormControl({ value: businessDetails.businessABN, disabled: true }),
19400
19402
  mainBusinessAddress: new forms.FormControl({ value: businessDetails.businessAddress, disabled: true }),
19401
- // By default, we show it as 1, but user can change it
19402
- numberOfBusinessActivities: new forms.FormControl(1)
19403
+ numberOfBusinessActivities: new forms.FormControl(businessDetails.businessActivities.length)
19403
19404
  }) || this;
19404
19405
  _this.businessDetails = businessDetails;
19405
19406
  _this.listenEvents();
@@ -19540,6 +19541,10 @@
19540
19541
  value: businessLosses.kmsTravelledExpensesAmount,
19541
19542
  disabled: true
19542
19543
  }),
19544
+ logbookExpensesAmount: new forms.FormControl({
19545
+ value: businessLosses.logbookExpensesAmount,
19546
+ disabled: true
19547
+ }),
19543
19548
  otherExpensesAmount: new forms.FormControl({
19544
19549
  value: businessLosses.otherExpensesAmount,
19545
19550
  disabled: true