taxtank-core 0.12.0 → 0.12.3
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 +31 -14
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/db/Models/client-income-types.js +1 -1
- package/esm2015/lib/forms/client/client-income-types.form.js +3 -3
- package/esm2015/lib/models/pdf/pdf-settings.js +10 -0
- package/esm2015/lib/services/account-setup/account-setup.service.js +2 -2
- package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +8 -2
- package/esm2015/lib/services/pdf/pdf.service.js +11 -11
- package/esm2015/public-api.js +2 -1
- package/fesm2015/taxtank-core.js +30 -15
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/db/Models/client-income-types.d.ts +2 -2
- package/lib/models/pdf/pdf-settings.d.ts +9 -0
- package/lib/services/pdf/pdf.service.d.ts +3 -3
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -7671,6 +7671,16 @@
|
|
|
7671
7671
|
PdfOrientationEnum["LANDSCAPE"] = "landscape";
|
|
7672
7672
|
})(exports.PdfOrientationEnum || (exports.PdfOrientationEnum = {}));
|
|
7673
7673
|
|
|
7674
|
+
/**
|
|
7675
|
+
* Class with entities for generated PDF file
|
|
7676
|
+
*/
|
|
7677
|
+
var PdfSettings = /** @class */ (function () {
|
|
7678
|
+
function PdfSettings() {
|
|
7679
|
+
this.orientation = exports.PdfOrientationEnum.PORTRAIT;
|
|
7680
|
+
}
|
|
7681
|
+
return PdfSettings;
|
|
7682
|
+
}());
|
|
7683
|
+
|
|
7674
7684
|
/**
|
|
7675
7685
|
* Calculation form control types
|
|
7676
7686
|
*/
|
|
@@ -9299,7 +9309,11 @@
|
|
|
9299
9309
|
*/
|
|
9300
9310
|
TransactionAllocationService.prototype.onTransactionsCreated = function () {
|
|
9301
9311
|
var _this = this;
|
|
9302
|
-
this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTIONS_CREATED).subscribe(function () {
|
|
9312
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTIONS_CREATED).subscribe(function (transactions) {
|
|
9313
|
+
// @TODO Alex hack: research and refactor cache update logic, dont reset cache each time transactions changed
|
|
9314
|
+
if (transactions[0].isTransfer) {
|
|
9315
|
+
return;
|
|
9316
|
+
}
|
|
9303
9317
|
// Update allocations cache to synchronize data and fire subscriptions
|
|
9304
9318
|
_this.resetCache();
|
|
9305
9319
|
});
|
|
@@ -9310,6 +9324,7 @@
|
|
|
9310
9324
|
TransactionAllocationService.prototype.onDepreciationCreated = function () {
|
|
9311
9325
|
var _this = this;
|
|
9312
9326
|
this.eventDispatcherService.on(exports.AppEventTypeEnum.DEPRECIATIONS_CREATED).subscribe(function () {
|
|
9327
|
+
// @TODO Alex hack: research and refactor cache update logic, dont reset cache each time depreciations changed
|
|
9313
9328
|
// Update allocations cache to synchronize data and fire subscriptions
|
|
9314
9329
|
_this.resetCache();
|
|
9315
9330
|
});
|
|
@@ -9320,6 +9335,7 @@
|
|
|
9320
9335
|
TransactionAllocationService.prototype.onTransactionDeleted = function () {
|
|
9321
9336
|
var _this = this;
|
|
9322
9337
|
this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTION_DELETED).subscribe(function () {
|
|
9338
|
+
// @TODO Alex hack: research and refactor cache update logic, dont reset cache each time transactions changed
|
|
9323
9339
|
// Update allocations cache to synchronize data and fire subscriptions
|
|
9324
9340
|
_this.resetCache();
|
|
9325
9341
|
});
|
|
@@ -9426,7 +9442,7 @@
|
|
|
9426
9442
|
batch.push(this.create(AccountSetupItemsEnum.OTHER_INCOME, this.getIncomeSourcesByType(exports.IncomeSourceTypeEnum.OTHER)));
|
|
9427
9443
|
}
|
|
9428
9444
|
// Rental income item is completed when user added at least one property
|
|
9429
|
-
if (incomeTypes.
|
|
9445
|
+
if (incomeTypes.property) {
|
|
9430
9446
|
batch.push(this.create(AccountSetupItemsEnum.PROPERTY, this.propertyService.get()));
|
|
9431
9447
|
}
|
|
9432
9448
|
// Bank feeds item is completed when user added at least one bank account (basiq or manual)
|
|
@@ -11548,21 +11564,21 @@
|
|
|
11548
11564
|
/**
|
|
11549
11565
|
* Export file from provided HTML tables
|
|
11550
11566
|
*/
|
|
11551
|
-
PdfService.prototype.exportTables = function (tables,
|
|
11552
|
-
var document = this.generateFromTables(
|
|
11553
|
-
document.save(
|
|
11567
|
+
PdfService.prototype.exportTables = function (tables, fileSettings) {
|
|
11568
|
+
var document = this.generateFromTables(tables, fileSettings);
|
|
11569
|
+
document.save(fileSettings.filename + ".pdf");
|
|
11554
11570
|
};
|
|
11555
11571
|
/**
|
|
11556
11572
|
* Export file from provided array-like table data
|
|
11557
11573
|
*/
|
|
11558
|
-
PdfService.prototype.exportFromDataTables = function (dataTables,
|
|
11559
|
-
var document = this.generateFromDataTables(
|
|
11560
|
-
document.save(
|
|
11574
|
+
PdfService.prototype.exportFromDataTables = function (dataTables, fileSettings) {
|
|
11575
|
+
var document = this.generateFromDataTables(dataTables, fileSettings.title);
|
|
11576
|
+
document.save(fileSettings.filename + ".pdf");
|
|
11561
11577
|
};
|
|
11562
11578
|
/**
|
|
11563
11579
|
* Generate file from array-like table data
|
|
11564
11580
|
*/
|
|
11565
|
-
PdfService.prototype.generateFromDataTables = function (
|
|
11581
|
+
PdfService.prototype.generateFromDataTables = function (dataTables, title) {
|
|
11566
11582
|
var _this = this;
|
|
11567
11583
|
var pdf = new jsPDF__default["default"]();
|
|
11568
11584
|
this.setDocumentTitle(pdf, title);
|
|
@@ -11572,10 +11588,10 @@
|
|
|
11572
11588
|
});
|
|
11573
11589
|
return pdf;
|
|
11574
11590
|
};
|
|
11575
|
-
PdfService.prototype.generateFromTables = function (
|
|
11591
|
+
PdfService.prototype.generateFromTables = function (tables, fileSettings) {
|
|
11576
11592
|
var _this = this;
|
|
11577
|
-
var pdf = new jsPDF__default["default"](orientation);
|
|
11578
|
-
this.setDocumentTitle(pdf, title);
|
|
11593
|
+
var pdf = new jsPDF__default["default"](fileSettings.orientation);
|
|
11594
|
+
this.setDocumentTitle(pdf, fileSettings.title);
|
|
11579
11595
|
this.setDocumentLogo(pdf);
|
|
11580
11596
|
tables.forEach(function (table) {
|
|
11581
11597
|
// Add table caption if not provided
|
|
@@ -13417,8 +13433,8 @@
|
|
|
13417
13433
|
function ClientIncomeTypesForm(clientIncomeTypes) {
|
|
13418
13434
|
var _this = _super.call(this, {
|
|
13419
13435
|
salary: new forms.FormControl(clientIncomeTypes.salary),
|
|
13420
|
-
|
|
13421
|
-
|
|
13436
|
+
property: new forms.FormControl(clientIncomeTypes.property),
|
|
13437
|
+
sole: new forms.FormControl(clientIncomeTypes.sole),
|
|
13422
13438
|
dividends: new forms.FormControl(clientIncomeTypes.dividends),
|
|
13423
13439
|
other: new forms.FormControl(clientIncomeTypes.other)
|
|
13424
13440
|
}, atLeastOneCheckedValidator()) || this;
|
|
@@ -13790,6 +13806,7 @@
|
|
|
13790
13806
|
exports.OccupationService = OccupationService;
|
|
13791
13807
|
exports.PasswordForm = PasswordForm;
|
|
13792
13808
|
exports.PdfService = PdfService;
|
|
13809
|
+
exports.PdfSettings = PdfSettings;
|
|
13793
13810
|
exports.Phone = Phone;
|
|
13794
13811
|
exports.PreloaderService = PreloaderService;
|
|
13795
13812
|
exports.Property = Property;
|