taxtank-core 0.32.102 → 0.32.104
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.
- package/esm2022/lib/db/Enums/holding/holding-type-exchange-list.enum.mjs +6 -5
- package/esm2022/lib/db/Models/client/client-details.mjs +1 -1
- package/esm2022/lib/forms/firm/employee-details.form.mjs +1 -2
- package/esm2022/lib/forms/sole/bas-report.form.mjs +2 -2
- package/esm2022/lib/forms/sole/sole-invoice.form.mjs +3 -2
- package/esm2022/lib/forms/transaction/transaction.form.mjs +1 -1
- package/esm2022/lib/models/client/client-details.mjs +18 -1
- package/esm2022/lib/models/financial-year/financial-year.mjs +3 -3
- package/esm2022/lib/models/sole/sole-invoice.mjs +4 -1
- package/esm2022/lib/services/http/bank/basiq/basiq.service.mjs +7 -1
- package/esm2022/lib/validators/string/alpha-space.validator.mjs +5 -2
- package/fesm2022/taxtank-core.mjs +38 -10
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/lib/db/Enums/holding/holding-type-exchange-list.enum.d.ts +5 -4
- package/lib/db/Models/client/client-details.d.ts +1 -0
- package/lib/models/client/client-details.d.ts +6 -0
- package/lib/services/http/bank/basiq/basiq.service.d.ts +4 -0
- package/lib/validators/string/alpha-space.validator.d.ts +3 -0
- package/package.json +1 -1
@@ -1437,10 +1437,11 @@ var HoldingTypeExchangeListEnum;
|
|
1437
1437
|
(function (HoldingTypeExchangeListEnum) {
|
1438
1438
|
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["US"] = 1] = "US";
|
1439
1439
|
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["AU"] = 2] = "AU";
|
1440
|
-
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["
|
1441
|
-
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["
|
1442
|
-
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["
|
1443
|
-
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["
|
1440
|
+
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["LSE"] = 3] = "LSE";
|
1441
|
+
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["TO"] = 4] = "TO";
|
1442
|
+
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["HK"] = 5] = "HK";
|
1443
|
+
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["SG"] = 6] = "SG";
|
1444
|
+
HoldingTypeExchangeListEnum[HoldingTypeExchangeListEnum["CC"] = 7] = "CC";
|
1444
1445
|
})(HoldingTypeExchangeListEnum || (HoldingTypeExchangeListEnum = {}));
|
1445
1446
|
|
1446
1447
|
var TaxReturnCategoryListEnum;
|
@@ -1731,8 +1732,8 @@ class FinancialYear {
|
|
1731
1732
|
return +localStorage.getItem('financialYear');
|
1732
1733
|
}
|
1733
1734
|
constructor(date) {
|
1734
|
-
this.yearStartDate = '-07-01';
|
1735
|
-
this.yearEndDate = '-06-30';
|
1735
|
+
this.yearStartDate = '-07-01 00:00:00';
|
1736
|
+
this.yearEndDate = '-06-30 23:59:59';
|
1736
1737
|
if (date) {
|
1737
1738
|
this.year = date instanceof Date ? FinancialYear.toFinYear(date) : date;
|
1738
1739
|
}
|
@@ -4137,13 +4138,28 @@ var UserStatusEnum;
|
|
4137
4138
|
})(UserStatusEnum || (UserStatusEnum = {}));
|
4138
4139
|
|
4139
4140
|
class ClientDetails extends ClientDetails$1 {
|
4141
|
+
/**
|
4142
|
+
* reminder to sign basiq consent after x days before the expiration
|
4143
|
+
*/
|
4144
|
+
static { this.basiqReminderDays = 30; }
|
4140
4145
|
get taxFileNumberMasked() {
|
4141
4146
|
const maskedLength = this.taxFileNumber.length - 4;
|
4142
4147
|
const maskedPart = '*'.repeat(maskedLength);
|
4143
4148
|
const lastFour = this.taxFileNumber.slice(-4);
|
4144
4149
|
return maskedPart + lastFour;
|
4145
4150
|
}
|
4151
|
+
isBasiqConsentExpiring() {
|
4152
|
+
if (!this.basiqConsentId) {
|
4153
|
+
return false;
|
4154
|
+
}
|
4155
|
+
const reminderDate = new Date(this.basiqConsentExpiryDate);
|
4156
|
+
reminderDate.setDate(this.basiqConsentExpiryDate.getDate() - ClientDetails.basiqReminderDays);
|
4157
|
+
return new Date() >= reminderDate;
|
4158
|
+
}
|
4146
4159
|
}
|
4160
|
+
__decorate([
|
4161
|
+
Type(() => Date)
|
4162
|
+
], ClientDetails.prototype, "basiqConsentExpiryDate", void 0);
|
4147
4163
|
|
4148
4164
|
class AnnualClientDetails extends AbstractModel {
|
4149
4165
|
constructor() {
|
@@ -4980,6 +4996,9 @@ class SoleInvoice extends SoleInvoice$1 {
|
|
4980
4996
|
return this.taxType === SoleInvoiceTaxTypeEnum.TAX_INCLUSIVE;
|
4981
4997
|
}
|
4982
4998
|
getNumber() {
|
4999
|
+
if (!this.number) {
|
5000
|
+
return null;
|
5001
|
+
}
|
4983
5002
|
return 'N' + String(this.number).padStart(SoleInvoice.numberLength, '0');
|
4984
5003
|
}
|
4985
5004
|
get name() {
|
@@ -11674,6 +11693,12 @@ class BasiqService extends RestService$1 {
|
|
11674
11693
|
localStorage.setItem('basiqBankId', bankId);
|
11675
11694
|
window.location.replace(`${BasiqService.basiqConsentUrl}?token=${token}&institutionId=${bankId}${consentExist ? '&action=connect' : ''}`);
|
11676
11695
|
}
|
11696
|
+
/**
|
11697
|
+
* redirect to basiq extend consent date to prolong it
|
11698
|
+
*/
|
11699
|
+
extend(token) {
|
11700
|
+
window.location.replace(`${BasiqService.basiqConsentUrl}?token=${token}&action=extend`);
|
11701
|
+
}
|
11677
11702
|
/**
|
11678
11703
|
* Open basiq consent ui to allow user to manage basiq access to his bank data
|
11679
11704
|
* @param token User's basiq token
|
@@ -21180,9 +21205,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
21180
21205
|
args: [{ providedIn: 'root' }]
|
21181
21206
|
}], ctorParameters: function () { return [{ type: UserService }]; } });
|
21182
21207
|
|
21208
|
+
/**
|
21209
|
+
* should include alpha+space only, but currently allow all chars except @ for tests
|
21210
|
+
*/
|
21183
21211
|
function alphaSpaceValidator() {
|
21184
21212
|
return (control) => {
|
21185
|
-
const valid =
|
21213
|
+
const valid = !/@/.test(control.value);
|
21186
21214
|
return valid ? null : { 'alphaSpace': true };
|
21187
21215
|
};
|
21188
21216
|
}
|
@@ -21253,7 +21281,6 @@ class EmployeeDetailsForm extends AbstractForm {
|
|
21253
21281
|
super({
|
21254
21282
|
firmBranches: new FormControl(employeeDetails.firmBranches, [Validators.required]),
|
21255
21283
|
}, employeeDetails);
|
21256
|
-
console.log(this.value);
|
21257
21284
|
}
|
21258
21285
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeDetailsForm, deps: [{ token: EmployeeDetails }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
21259
21286
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EmployeeDetailsForm, providedIn: 'root' }); }
|
@@ -21576,7 +21603,8 @@ class SoleInvoiceForm extends AbstractForm {
|
|
21576
21603
|
payer: new UntypedFormControl(invoice.payer, Validators.required),
|
21577
21604
|
taxType: new UntypedFormControl(invoice.taxType, Validators.required),
|
21578
21605
|
bankAccount: new UntypedFormControl(invoice.bankAccount, Validators.required),
|
21579
|
-
reference: new UntypedFormControl(invoice.reference)
|
21606
|
+
reference: new UntypedFormControl(invoice.reference),
|
21607
|
+
number: new UntypedFormControl(invoice.number, [Validators.required]),
|
21580
21608
|
}),
|
21581
21609
|
items: new UntypedFormArray((invoice.items || [plainToClass(SoleInvoiceItem, {})])
|
21582
21610
|
.map((item) => new SoleInvoiceItemForm(item))),
|
@@ -21747,7 +21775,7 @@ class BasReportForm extends AbstractForm {
|
|
21747
21775
|
// prefill income/expense data based on transactions/depreciations filtered by specified date
|
21748
21776
|
combineLatest([this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
|
21749
21777
|
.subscribe(([dateFrom, dateTo]) => {
|
21750
|
-
dateFrom.setHours(0,
|
21778
|
+
// const from = clone(dateFrom).setHours(0,0,0,0);
|
21751
21779
|
const filteredTransactions = transactions.filterByRange('date', dateFrom, dateTo);
|
21752
21780
|
const filteredDepreciations = depreciations.filterByRange('date', dateFrom, dateTo);
|
21753
21781
|
const incomeTransactions = filteredTransactions.getIncomeTransactions();
|