taxtank-core 1.0.20 → 1.0.23

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.
@@ -1620,8 +1620,8 @@ class FinancialYear {
1620
1620
  return +localStorage.getItem('financialYear');
1621
1621
  }
1622
1622
  constructor(date) {
1623
- this.yearStartDate = '-07-01T00:00:00Z';
1624
- this.yearEndDate = '-06-30T23:59:59Z';
1623
+ this.yearStartDate = '-07-01T00:00:00';
1624
+ this.yearEndDate = '-06-30T23:59:59';
1625
1625
  if (date) {
1626
1626
  this.year = date instanceof Date ? FinancialYear.toFinYear(date) : date;
1627
1627
  }
@@ -1651,9 +1651,11 @@ class FinancialYear {
1651
1651
  }
1652
1652
  setStartDate(year) {
1653
1653
  this.startDate = new Date(`${year - 1}${this.yearStartDate}`);
1654
+ this.startDateUTC = new Date(Date.UTC(this.startDate.getFullYear(), this.startDate.getMonth(), this.startDate.getDate()));
1654
1655
  }
1655
1656
  setEndDate(year) {
1656
1657
  this.endDate = new Date(`${year}${this.yearEndDate}`);
1658
+ this.endDateUTC = new Date(Date.UTC(this.endDate.getFullYear(), this.endDate.getMonth(), this.endDate.getDate()));
1657
1659
  }
1658
1660
  getPastMonths() {
1659
1661
  const months = [];
@@ -6518,11 +6520,13 @@ class Transaction extends Transaction$1 {
6518
6520
  setParent(transaction) {
6519
6521
  this.description = this.chartAccounts.name;
6520
6522
  this.date = transaction.date;
6521
- this.claimPercent = transaction.claimPercent;
6522
6523
  this.property = transaction.property;
6523
6524
  this.loan = transaction.loan;
6524
6525
  this.incomeSource = transaction.incomeSource;
6525
6526
  this.business = transaction.business;
6527
+ if (this.claimPercent > 0) {
6528
+ this.claimPercent = transaction.claimPercent;
6529
+ }
6526
6530
  }
6527
6531
  isEditable() {
6528
6532
  return !ChartAccounts.systemList.includes(this.chartAccounts.id);
@@ -16492,6 +16496,7 @@ class UserService extends RestService$1 {
16492
16496
  localStorage.setItem('userId', this.getCacheFirst().id.toString());
16493
16497
  localStorage.setItem('financialYear', this.getCacheFirst().financialYear.toString());
16494
16498
  localStorage.setItem('roles', JSON.stringify(this.getCacheFirst().roles));
16499
+ // localStorage.setItem('timezone', JSON.stringify(this.getCacheFirst().clientDetails.timezone));
16495
16500
  return users;
16496
16501
  }));
16497
16502
  }
@@ -22658,9 +22663,10 @@ class BasReportForm extends AbstractForm {
22658
22663
  // prefill income/expense data based on transactions/depreciations filtered by specified date
22659
22664
  combineLatest([this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
22660
22665
  .subscribe(([dateFrom, dateTo]) => {
22661
- // const from = clone(dateFrom).setHours(0,0,0,0);
22662
- const filteredTransactions = transactions.filterByRange('date', dateFrom, dateTo);
22663
- const filteredDepreciations = depreciations.filterByRange('date', dateFrom, dateTo);
22666
+ const from = clone(dateFrom).setHours(0, 0, 0);
22667
+ const to = clone(dateTo).setHours(23, 59, 59);
22668
+ const filteredTransactions = transactions.filterByRange('date', from, to);
22669
+ const filteredDepreciations = depreciations.filterByRange('date', from, to);
22664
22670
  const incomeTransactions = filteredTransactions.getIncomeTransactions();
22665
22671
  const expenseTransactions = new TransactionCollection(filteredTransactions.getExpenseTransactions().toArray(), filteredDepreciations.toArray());
22666
22672
  // all sole income claimed as 100%
@@ -22836,8 +22842,8 @@ function atLeastOneEnabledValidator(arrayName) {
22836
22842
  * Form for import multiple basiq bank accounts
22837
22843
  */
22838
22844
  class BankAccountsImportForm extends AbstractForm {
22839
- static { this.minDate = new FinancialYear(new Date().getFullYear() - 1).startDate; }
22840
- static { this.maxDate = new FinancialYear(new Date()).endDate; }
22845
+ static { this.minDate = new FinancialYear(new Date().getFullYear() - 1).startDateUTC; }
22846
+ static { this.maxDate = new FinancialYear(new Date()).endDateUTC; }
22841
22847
  constructor(bankAccounts) {
22842
22848
  super({
22843
22849
  migrateFrom: new UntypedFormControl(BankAccountsImportForm.minDate, [Validators.required, dateRangeValidator(BankAccountsImportForm.minDate, BankAccountsImportForm.maxDate)]),