taxtank-core 0.21.2 → 0.21.5
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/bundles/taxtank-core.umd.js +32 -15
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/forms/bank/bank-account/bank-account-add-manual.form.js +3 -2
- package/esm2015/lib/functions/mat-options-functions.js +4 -1
- package/esm2015/lib/models/bank/bank-account.js +7 -1
- package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +12 -10
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +5 -6
- package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +8 -1
- package/fesm2015/taxtank-core.js +32 -15
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/bank/bank-account.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3378,6 +3378,12 @@
|
|
|
3378
3378
|
BankAccount.prototype.isPropertyTank = function () {
|
|
3379
3379
|
return this.tankType === exports.TankTypeEnum.PROPERTY;
|
|
3380
3380
|
};
|
|
3381
|
+
/**
|
|
3382
|
+
* check if bank account related to sole tank
|
|
3383
|
+
*/
|
|
3384
|
+
BankAccount.prototype.isSoleTank = function () {
|
|
3385
|
+
return this.tankType === exports.TankTypeEnum.SOLE;
|
|
3386
|
+
};
|
|
3381
3387
|
/**
|
|
3382
3388
|
* Get Bank account property by id
|
|
3383
3389
|
* @param id Id of property
|
|
@@ -3612,15 +3618,17 @@
|
|
|
3612
3618
|
var connection = classTransformer.plainToClass(BankConnection, bankConnectionBase);
|
|
3613
3619
|
// We use this endpoint for create and reconnect bank connections because of basiq logic.
|
|
3614
3620
|
// So we try to replace bank connection in cache for reconnection case.
|
|
3615
|
-
if (
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3621
|
+
if (_this.cache) {
|
|
3622
|
+
if (bankConnection.id) {
|
|
3623
|
+
var tempCache = cloneDeep__default["default"](_this.cache);
|
|
3624
|
+
replace(tempCache, connection);
|
|
3625
|
+
_this.cache = tempCache;
|
|
3626
|
+
_this.cacheSubject.next(_this.cache);
|
|
3627
|
+
}
|
|
3628
|
+
else {
|
|
3629
|
+
_this.cache.push(connection);
|
|
3630
|
+
_this.cacheSubject.next(cloneDeep__default["default"](_this.cache));
|
|
3631
|
+
}
|
|
3624
3632
|
}
|
|
3625
3633
|
return classTransformer.plainToClass(BankConnection, connection);
|
|
3626
3634
|
}));
|
|
@@ -3705,12 +3713,11 @@
|
|
|
3705
3713
|
*/
|
|
3706
3714
|
BasiqService.prototype.updateConnection = function (data, userId, connection) {
|
|
3707
3715
|
var _this = this;
|
|
3708
|
-
// Send login data to basiq API to create a basiq job
|
|
3716
|
+
// Send login data and connection id to basiq API to create a basiq job
|
|
3709
3717
|
return this.http.post(BasiqService.basiqApiUrl + "/users/" + userId + "/connections", Object.assign(data, { id: connection.externalId }))
|
|
3710
|
-
.pipe(
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
return _this.bankConnectionService.add(classTransformer.plainToClass(BankConnection, Object.assign({ id: connection.id, basiqJob: { externalId: response.id } })));
|
|
3718
|
+
.pipe(operators.mergeMap(function (response) {
|
|
3719
|
+
// Create bank connection based on basiq job
|
|
3720
|
+
return _this.bankConnectionService.add(classTransformer.plainToClass(BankConnection, { id: connection.id, basiqJob: { externalId: response.id } }));
|
|
3714
3721
|
}), operators.catchError(function (error) {
|
|
3715
3722
|
// Show error when user provided wrong login data
|
|
3716
3723
|
if (error.status === 401) {
|
|
@@ -11543,6 +11550,13 @@
|
|
|
11543
11550
|
return response.map(function (item) { return classTransformer.plainToClass(ChartAccounts, item); });
|
|
11544
11551
|
}))
|
|
11545
11552
|
.subscribe(function (chartAccounts) {
|
|
11553
|
+
// Sort personal chart accounts by name (TT-1950)
|
|
11554
|
+
chartAccounts.sort(function (a, b) {
|
|
11555
|
+
if (a.isPersonal() && b.isPersonal()) {
|
|
11556
|
+
return a.name > b.name ? 1 : -1;
|
|
11557
|
+
}
|
|
11558
|
+
return 0;
|
|
11559
|
+
});
|
|
11546
11560
|
_this._chartAccounts = chartAccounts;
|
|
11547
11561
|
_this.chartAccountsSubject.next(_this._chartAccounts);
|
|
11548
11562
|
});
|
|
@@ -14791,6 +14805,9 @@
|
|
|
14791
14805
|
}
|
|
14792
14806
|
|
|
14793
14807
|
function compareMatOptions(option, value) {
|
|
14808
|
+
if (!option) {
|
|
14809
|
+
return false;
|
|
14810
|
+
}
|
|
14794
14811
|
return option.id === value.id;
|
|
14795
14812
|
}
|
|
14796
14813
|
function displayMatOptions(option) {
|
|
@@ -14978,7 +14995,7 @@
|
|
|
14978
14995
|
currentBalance: new forms.FormControl(null, forms.Validators.required),
|
|
14979
14996
|
accountNumber: new forms.FormControl(null, [forms.Validators.required, forms.Validators.pattern(BankAccountAddManualForm.accountNumberPattern)]),
|
|
14980
14997
|
tankType: new forms.FormControl(null, forms.Validators.required),
|
|
14981
|
-
}) || this;
|
|
14998
|
+
}, classTransformer.plainToClass(BankAccount, {})) || this;
|
|
14982
14999
|
_this.connection = connection;
|
|
14983
15000
|
_this.listenEvents();
|
|
14984
15001
|
return _this;
|