taxtank-core 0.28.8-1 → 0.28.8-2
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 +52 -34
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/transaction/transaction.collection.js +26 -1
- package/esm2015/lib/forms/bank/bank-account/bank-account-import.form.js +3 -3
- package/esm2015/lib/forms/loan/loan.form.js +1 -5
- package/esm2015/lib/models/depreciation/depreciation.js +2 -2
- package/esm2015/lib/models/loan/loan-max-number-of-payments.enum.js +2 -3
- package/esm2015/lib/models/report/property/property-report-item-transaction.js +2 -2
- package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +1 -1
- package/fesm2015/taxtank-core.js +45 -28
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/transaction/transaction.collection.d.ts +7 -0
- package/lib/forms/loan/loan.form.d.ts +0 -1
- package/lib/models/loan/loan-max-number-of-payments.enum.d.ts +1 -2
- package/package.json +1 -1
|
@@ -4562,7 +4562,7 @@
|
|
|
4562
4562
|
*/
|
|
4563
4563
|
Depreciation.prototype.toTransaction = function (params) {
|
|
4564
4564
|
if (params === void 0) { params = {}; }
|
|
4565
|
-
return classTransformer.plainToClass(Transaction, Object.assign(params, this, { amount: this.
|
|
4565
|
+
return classTransformer.plainToClass(Transaction, Object.assign(params, this, { amount: -this.claimAmount, claimAmount: -this.amount * (this.claimPercent / 100) }));
|
|
4566
4566
|
};
|
|
4567
4567
|
Object.defineProperty(Depreciation.prototype, "claimAmount", {
|
|
4568
4568
|
/**
|
|
@@ -7033,6 +7033,31 @@
|
|
|
7033
7033
|
return ClientPortfolioReportCollection;
|
|
7034
7034
|
}(Collection));
|
|
7035
7035
|
|
|
7036
|
+
/**
|
|
7037
|
+
* Chart serie class: chart data item
|
|
7038
|
+
* @TODO consider rename to ChartSerieData
|
|
7039
|
+
*/
|
|
7040
|
+
var ChartSerie = /** @class */ (function () {
|
|
7041
|
+
function ChartSerie() {
|
|
7042
|
+
}
|
|
7043
|
+
return ChartSerie;
|
|
7044
|
+
}());
|
|
7045
|
+
|
|
7046
|
+
/**
|
|
7047
|
+
* Chart data class
|
|
7048
|
+
* @TODO consider rename to ChartSerie
|
|
7049
|
+
*/
|
|
7050
|
+
var ChartData = /** @class */ (function () {
|
|
7051
|
+
function ChartData() {
|
|
7052
|
+
}
|
|
7053
|
+
return ChartData;
|
|
7054
|
+
}());
|
|
7055
|
+
__decorate([
|
|
7056
|
+
classTransformer.Type(function () { return ChartSerie; })
|
|
7057
|
+
], ChartData.prototype, "data", void 0);
|
|
7058
|
+
|
|
7059
|
+
var MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan'];
|
|
7060
|
+
|
|
7036
7061
|
/**
|
|
7037
7062
|
* Collection of transactions
|
|
7038
7063
|
*/
|
|
@@ -7249,6 +7274,29 @@
|
|
|
7249
7274
|
.getVehicleTransactions()
|
|
7250
7275
|
.removeBy('chartAccounts.id', [exports.ChartAccountsListEnum.KLMS_TRAVELLED_FOR_WORK, exports.ChartAccountsListEnum.KLMS_TRAVELLED]);
|
|
7251
7276
|
};
|
|
7277
|
+
/**
|
|
7278
|
+
* Build chart data with transactions cash position.
|
|
7279
|
+
* Cash position = Income - Expenses (include depreciations)
|
|
7280
|
+
* Chart data for each month from fin year start till current month
|
|
7281
|
+
*/
|
|
7282
|
+
TransactionCollection.prototype.getCashPositionChartData = function () {
|
|
7283
|
+
var _this = this;
|
|
7284
|
+
var chartData = [
|
|
7285
|
+
classTransformer.plainToClass(ChartData, { name: 'Income', data: [] }),
|
|
7286
|
+
classTransformer.plainToClass(ChartData, { name: 'Expense', data: [] })
|
|
7287
|
+
];
|
|
7288
|
+
new FinancialYear().getPastMonths().forEach(function (month) {
|
|
7289
|
+
chartData[0].data.push({
|
|
7290
|
+
label: MONTHS[month],
|
|
7291
|
+
value: _this.getIncomeTransactions().getByMonth(month).claimAmount
|
|
7292
|
+
});
|
|
7293
|
+
chartData[1].data.push({
|
|
7294
|
+
label: MONTHS[month],
|
|
7295
|
+
value: Math.abs(_this.getExpenseTransactions().getByMonth(month).claimAmount)
|
|
7296
|
+
});
|
|
7297
|
+
});
|
|
7298
|
+
return chartData;
|
|
7299
|
+
};
|
|
7252
7300
|
return TransactionCollection;
|
|
7253
7301
|
}(ExportableCollection));
|
|
7254
7302
|
|
|
@@ -7865,7 +7913,7 @@
|
|
|
7865
7913
|
__extends(PropertyReportItemTransaction, _super);
|
|
7866
7914
|
function PropertyReportItemTransaction(transactions, property, chartAccounts) {
|
|
7867
7915
|
var _this = _super.call(this, property, chartAccounts) || this;
|
|
7868
|
-
_this.amount = Math.abs(transactions.
|
|
7916
|
+
_this.amount = Math.abs(transactions.grossAmount);
|
|
7869
7917
|
_this.description = chartAccounts.name;
|
|
7870
7918
|
return _this;
|
|
7871
7919
|
}
|
|
@@ -9165,29 +9213,6 @@
|
|
|
9165
9213
|
return BorrowingExpenseLoan;
|
|
9166
9214
|
}(BorrowingExpenseLoan$1));
|
|
9167
9215
|
|
|
9168
|
-
/**
|
|
9169
|
-
* Chart serie class: chart data item
|
|
9170
|
-
* @TODO consider rename to ChartSerieData
|
|
9171
|
-
*/
|
|
9172
|
-
var ChartSerie = /** @class */ (function () {
|
|
9173
|
-
function ChartSerie() {
|
|
9174
|
-
}
|
|
9175
|
-
return ChartSerie;
|
|
9176
|
-
}());
|
|
9177
|
-
|
|
9178
|
-
/**
|
|
9179
|
-
* Chart data class
|
|
9180
|
-
* @TODO consider rename to ChartSerie
|
|
9181
|
-
*/
|
|
9182
|
-
var ChartData = /** @class */ (function () {
|
|
9183
|
-
function ChartData() {
|
|
9184
|
-
}
|
|
9185
|
-
return ChartData;
|
|
9186
|
-
}());
|
|
9187
|
-
__decorate([
|
|
9188
|
-
classTransformer.Type(function () { return ChartSerie; })
|
|
9189
|
-
], ChartData.prototype, "data", void 0);
|
|
9190
|
-
|
|
9191
9216
|
var ChartAccountsDepreciation$1 = /** @class */ (function (_super) {
|
|
9192
9217
|
__extends(ChartAccountsDepreciation, _super);
|
|
9193
9218
|
function ChartAccountsDepreciation() {
|
|
@@ -9860,8 +9885,6 @@
|
|
|
9860
9885
|
IconsFileEnum["DOC"] = "icon-doc";
|
|
9861
9886
|
})(exports.IconsFileEnum || (exports.IconsFileEnum = {}));
|
|
9862
9887
|
|
|
9863
|
-
var MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan'];
|
|
9864
|
-
|
|
9865
9888
|
// Todo extend from the base model when the backend is ready TT-555
|
|
9866
9889
|
var IncomePosition = /** @class */ (function () {
|
|
9867
9890
|
function IncomePosition() {
|
|
@@ -9916,8 +9939,7 @@
|
|
|
9916
9939
|
}());
|
|
9917
9940
|
|
|
9918
9941
|
/**
|
|
9919
|
-
* Enum with maximum number of payments, depending on the frequency
|
|
9920
|
-
* Used only for vehicle loans
|
|
9942
|
+
* Enum with maximum number of payments, depending on the frequency
|
|
9921
9943
|
*/
|
|
9922
9944
|
exports.LoanMaxNumberOfPaymentsEnum = void 0;
|
|
9923
9945
|
(function (LoanMaxNumberOfPaymentsEnum) {
|
|
@@ -16947,10 +16969,6 @@
|
|
|
16947
16969
|
* For vehicle loans term has a maximum value depended of repayment frequency
|
|
16948
16970
|
*/
|
|
16949
16971
|
LoanForm.prototype.updateTermValidation = function () {
|
|
16950
|
-
// no need terms for bank loans
|
|
16951
|
-
if (!!this.loan.bankAccount) {
|
|
16952
|
-
return;
|
|
16953
|
-
}
|
|
16954
16972
|
var currentRepaymentFrequency = this.get('repaymentFrequency').value;
|
|
16955
16973
|
// term validation depends on selected repayment frequency, so can not validate when frequency is empty
|
|
16956
16974
|
// repaymentType is required field, so we don't need to clear validation
|
|
@@ -17493,7 +17511,7 @@
|
|
|
17493
17511
|
if (bankAccount.isLoan()) {
|
|
17494
17512
|
// Attach bank account to loan for LoanForm's logic
|
|
17495
17513
|
// @TODO Alex/Vik: we should use separated API for bank accounts and loans
|
|
17496
|
-
var loan = classTransformer.plainToClass(Loan, Object.assign(bankAccount.loan, { bankAccount: {
|
|
17514
|
+
var loan = classTransformer.plainToClass(Loan, Object.assign(bankAccount.loan, { bankAccount: Object.assign(bankAccount, { loan: null }) }));
|
|
17497
17515
|
_this.addControl('loan', new LoanForm(loan));
|
|
17498
17516
|
}
|
|
17499
17517
|
// basiq account import form should be disabled (unchecked) by default
|