taxtank-core 2.1.30 → 2.1.32

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.
@@ -5861,6 +5861,12 @@ class SoleBusiness extends SoleBusiness$1 {
5861
5861
  }
5862
5862
  return this.abn;
5863
5863
  }
5864
+ getAddress(soleDetails) {
5865
+ if (!this.isTaxFree) {
5866
+ return soleDetails.address;
5867
+ }
5868
+ return this.address;
5869
+ }
5864
5870
  getIsGST(soleDetails) {
5865
5871
  if (!this.isTaxFree) {
5866
5872
  return soleDetails.isGST;
@@ -5904,6 +5910,9 @@ __decorate([
5904
5910
  __decorate([
5905
5911
  Type(() => AppFile)
5906
5912
  ], SoleBusiness.prototype, "file", void 0);
5913
+ __decorate([
5914
+ Type(() => Address)
5915
+ ], SoleBusiness.prototype, "address", void 0);
5907
5916
 
5908
5917
  class SoleBusinessActivity extends SoleBusinessActivity$1 {
5909
5918
  }
@@ -5961,6 +5970,9 @@ __decorate([
5961
5970
  __decorate([
5962
5971
  Type(() => Date)
5963
5972
  ], BasReport.prototype, "dateTo", void 0);
5973
+ __decorate([
5974
+ Type(() => SoleBusiness)
5975
+ ], BasReport.prototype, "businesses", void 0);
5964
5976
 
5965
5977
  class SoleContactItem {
5966
5978
  }
@@ -13447,7 +13459,7 @@ class BankTransactionService extends RestService$1 {
13447
13459
  formData.append('file', file);
13448
13460
  return this.http.post(`${this.environment.apiV2}/bank-accounts/${bankAccountId}/bank-transaction-imports`, formData)
13449
13461
  .pipe(map((response) => {
13450
- const result = response
13462
+ const result = response.bankTransactions
13451
13463
  .map((baseTransaction) => plainToClass(BankTransaction, baseTransaction))
13452
13464
  // we are interesting only current fin year bank transactions
13453
13465
  .filter((bankTransaction) => new FinancialYear().includes(bankTransaction.date));
@@ -16759,11 +16771,14 @@ var BasReportMessagesEnum;
16759
16771
  BasReportMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this BAS report?";
16760
16772
  })(BasReportMessagesEnum || (BasReportMessagesEnum = {}));
16761
16773
 
16762
- class BasReportService extends RestService {
16774
+ class BasReportService extends RestService$1 {
16763
16775
  constructor() {
16764
16776
  super(...arguments);
16765
16777
  this.modelClass = BasReport;
16766
- this.url = 'bas-reports';
16778
+ this.collectionClass = Collection;
16779
+ this.endpointUri = 'bas-reports';
16780
+ this.roles = [UserRolesEnum.SOLE_TANK];
16781
+ this.useBackendError = true;
16767
16782
  }
16768
16783
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: BasReportService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
16769
16784
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: BasReportService, providedIn: 'root' }); }
@@ -24826,6 +24841,7 @@ class SoleBusinessForm extends AbstractForm {
24826
24841
  isTaxFree: new FormControl(business.isTaxFree),
24827
24842
  abn: new FormControl(business.abn, requiredLengthValidator(11)),
24828
24843
  isGST: new FormControl(business.isGST),
24844
+ address: new FormControl(business.address),
24829
24845
  }, business);
24830
24846
  this.business = business;
24831
24847
  // User have to create income source with new business.
@@ -25188,25 +25204,31 @@ class SoleInvoiceTemplateForm extends AbstractForm {
25188
25204
  class BasReportForm extends AbstractForm {
25189
25205
  constructor(report, transactions, depreciations) {
25190
25206
  super({
25191
- dateFrom: new UntypedFormControl(report.dateFrom, Validators.required),
25192
- dateTo: new UntypedFormControl(report.dateTo, Validators.required),
25193
- income: new UntypedFormControl({ value: report.income, disabled: true }),
25194
- incomeGST: new UntypedFormControl({ value: report.incomeGST, disabled: true }, Validators.required),
25195
- expenseGST: new UntypedFormControl({ value: report.expenseGST, disabled: true }, Validators.required),
25196
- salary: new UntypedFormControl(report.salary, Validators.required),
25197
- taxWithheldSalary: new UntypedFormControl(report.taxWithheldSalary, Validators.required),
25198
- taxWithheldNoABN: new UntypedFormControl(report.taxWithheldNoABN, Validators.required),
25199
- taxWithheldTotal: new UntypedFormControl({ value: report.taxWithheldTotal, disabled: true }),
25200
- paygTaxInstalment: new UntypedFormControl(report.paygTaxInstalment, Validators.required),
25201
- fuelTaxCredit: new UntypedFormControl(report.fuelTaxCredit, Validators.required),
25202
- gst: new UntypedFormControl({ value: report.gst, disabled: true }),
25207
+ businesses: new FormControl(report.businesses, Validators.required),
25208
+ dateFrom: new FormControl(report.dateFrom, Validators.required),
25209
+ dateTo: new FormControl(report.dateTo, Validators.required),
25210
+ income: new FormControl({ value: report.income, disabled: true }),
25211
+ incomeGST: new FormControl({ value: report.incomeGST, disabled: true }, Validators.required),
25212
+ expenseGST: new FormControl({ value: report.expenseGST, disabled: true }, Validators.required),
25213
+ salary: new FormControl(report.salary, Validators.required),
25214
+ taxWithheldSalary: new FormControl(report.taxWithheldSalary, Validators.required),
25215
+ taxWithheldNoABN: new FormControl(report.taxWithheldNoABN, Validators.required),
25216
+ taxWithheldTotal: new FormControl({ value: report.taxWithheldTotal, disabled: true }),
25217
+ paygTaxInstalment: new FormControl(report.paygTaxInstalment, Validators.required),
25218
+ fuelTaxCredit: new FormControl(report.fuelTaxCredit, Validators.required),
25219
+ gst: new FormControl({ value: report.gst, disabled: true }),
25203
25220
  }, report);
25204
25221
  this.includeDisabledFields = true;
25205
25222
  // prefill income/expense data based on transactions/depreciations filtered by specified date
25206
- combineLatest([this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
25207
- .subscribe(([dateFrom, dateTo]) => {
25208
- const filteredTransactions = transactions.filterByRange('date', dateFrom, dateTo);
25209
- const filteredDepreciations = depreciations.filterByRange('date', dateFrom, dateTo);
25223
+ combineLatest([this.get('businesses').valueChanges, this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
25224
+ .subscribe(([businesses, dateFrom, dateTo]) => {
25225
+ const businessIds = businesses.map(business => business.id);
25226
+ const filteredTransactions = transactions
25227
+ .filterByRange('date', dateFrom, dateTo)
25228
+ .filterBy('business.id', businessIds);
25229
+ const filteredDepreciations = depreciations
25230
+ .filterByRange('date', dateFrom, dateTo)
25231
+ .filterBy('business.id', businessIds);
25210
25232
  const incomeTransactions = filteredTransactions.getIncomeTransactions();
25211
25233
  const depreciationTransactions = filteredDepreciations.map(depreciation => depreciation.toTransaction({ amount: -depreciation.amount }));
25212
25234
  const expenseTransactions = new TransactionCollection(filteredTransactions.getExpenseTransactions().toArray());