taxtank-core 0.28.77 → 0.28.79
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 +44 -21
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/depreciation/depreciation.js +8 -1
- package/esm2015/lib/models/report/property/property-report-item-transaction.js +2 -2
- package/esm2015/lib/models/sole/index.js +1 -2
- package/esm2015/lib/models/transaction/transaction.js +3 -3
- package/esm2015/lib/services/http/sole/sole-invoice/sole-invoice.service.js +25 -16
- package/fesm2015/taxtank-core.js +35 -17
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/depreciation/depreciation.d.ts +1 -0
- package/lib/models/sole/index.d.ts +0 -1
- package/lib/services/http/sole/sole-invoice/sole-invoice.service.d.ts +4 -3
- package/package.json +1 -1
- package/esm2015/lib/models/sole/sole-invoice-send-data.interface.js +0 -2
- package/lib/models/sole/sole-invoice-send-data.interface.d.ts +0 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('lodash/last'), require('lodash/uniqBy'), require('lodash/concat'), require('moment'), require('moment-range'), require('lodash/cloneDeep'), require('rxjs/internal/observable/throwError'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('lodash/differenceBy'), require('@angular/forms'), require('lodash/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'moment', 'moment-range', 'lodash/cloneDeep', 'rxjs/internal/observable/throwError', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', 'lodash/differenceBy', '@angular/forms', 'lodash/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.classTransformer, global.angularJwt, global.get, global.flatten, global.hasIn, global.first, global.last, global.uniqBy, global.concat, global.moment$1, global.momentRange, global.cloneDeep$1, global.rxjs["internal/observable/throwError"], global.eventsource_min_js, global.compact, global.differenceBy, global.ng.forms, global.
|
|
5
|
-
})(this, (function (exports, i0, i1$1, i1, operators, rxjs, classTransformer, angularJwt, get, flatten, hasIn, first, last, uniqBy, concat, moment$1, momentRange, cloneDeep$1, throwError, eventsource_min_js, compact, differenceBy, forms,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('lodash/last'), require('lodash/uniqBy'), require('lodash/concat'), require('moment'), require('moment-range'), require('lodash/cloneDeep'), require('rxjs/internal/observable/throwError'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('lodash/differenceBy'), require('@angular/forms'), require('lodash/isEqual'), require('lodash/fromPairs'), require('lodash'), require('@angular/router'), require('lodash/clone'), require('html2pdf.js'), require('lodash/merge'), require('jspdf'), require('jspdf-autotable'), require('@stripe/stripe-js'), require('xlsx'), require('file-saver')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'moment', 'moment-range', 'lodash/cloneDeep', 'rxjs/internal/observable/throwError', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', 'lodash/differenceBy', '@angular/forms', 'lodash/isEqual', 'lodash/fromPairs', 'lodash', '@angular/router', 'lodash/clone', 'html2pdf.js', 'lodash/merge', 'jspdf', 'jspdf-autotable', '@stripe/stripe-js', 'xlsx', 'file-saver'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.classTransformer, global.angularJwt, global.get, global.flatten, global.hasIn, global.first, global.last, global.uniqBy, global.concat, global.moment$1, global.momentRange, global.cloneDeep$1, global.rxjs["internal/observable/throwError"], global.eventsource_min_js, global.compact, global.differenceBy, global.ng.forms, global.isEqual, global.fromPairs, global._, global.ng.router, global.clone, global.html2pdf, global.merge, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
|
|
5
|
+
})(this, (function (exports, i0, i1$1, i1, operators, rxjs, classTransformer, angularJwt, get, flatten, hasIn, first, last, uniqBy, concat, moment$1, momentRange, cloneDeep$1, throwError, eventsource_min_js, compact, differenceBy, forms, isEqual, fromPairs, _, i1$2, clone, html2pdf, merge, jsPDF, autoTable, stripeJs, xlsx, FileSaver) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep$1);
|
|
39
39
|
var compact__default = /*#__PURE__*/_interopDefaultLegacy(compact);
|
|
40
40
|
var differenceBy__default = /*#__PURE__*/_interopDefaultLegacy(differenceBy);
|
|
41
|
-
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
42
41
|
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
43
42
|
var fromPairs__default = /*#__PURE__*/_interopDefaultLegacy(fromPairs);
|
|
44
43
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
45
44
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
46
45
|
var clone__default = /*#__PURE__*/_interopDefaultLegacy(clone);
|
|
47
46
|
var html2pdf__namespace = /*#__PURE__*/_interopNamespace(html2pdf);
|
|
47
|
+
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
48
48
|
var jsPDF__default = /*#__PURE__*/_interopDefaultLegacy(jsPDF);
|
|
49
49
|
var autoTable__default = /*#__PURE__*/_interopDefaultLegacy(autoTable);
|
|
50
50
|
var xlsx__namespace = /*#__PURE__*/_interopNamespace(xlsx);
|
|
@@ -4510,6 +4510,14 @@
|
|
|
4510
4510
|
enumerable: false,
|
|
4511
4511
|
configurable: true
|
|
4512
4512
|
});
|
|
4513
|
+
Object.defineProperty(Depreciation.prototype, "gstClaimAmount", {
|
|
4514
|
+
get: function () {
|
|
4515
|
+
var _a;
|
|
4516
|
+
return this.gstAmount * ((_a = this.currentYearForecast) === null || _a === void 0 ? void 0 : _a.claimRate);
|
|
4517
|
+
},
|
|
4518
|
+
enumerable: false,
|
|
4519
|
+
configurable: true
|
|
4520
|
+
});
|
|
4513
4521
|
/**
|
|
4514
4522
|
* assets purchased in the current financial year
|
|
4515
4523
|
*/
|
|
@@ -4566,6 +4574,9 @@
|
|
|
4566
4574
|
__decorate([
|
|
4567
4575
|
classTransformer.Exclude()
|
|
4568
4576
|
], Depreciation.prototype, "amountWithGst", null);
|
|
4577
|
+
__decorate([
|
|
4578
|
+
classTransformer.Exclude()
|
|
4579
|
+
], Depreciation.prototype, "gstClaimAmount", null);
|
|
4569
4580
|
|
|
4570
4581
|
// @TODO Alex: refactor: move here allocations methods, netAmount = amount, grossAmount calculation, remove unused methods, etc.
|
|
4571
4582
|
var Transaction = /** @class */ (function (_super) {
|
|
@@ -4699,14 +4710,14 @@
|
|
|
4699
4710
|
};
|
|
4700
4711
|
Object.defineProperty(Transaction.prototype, "debit", {
|
|
4701
4712
|
get: function () {
|
|
4702
|
-
return this.isDebit() ? Math.abs(this.
|
|
4713
|
+
return this.isDebit() ? Math.abs(this.grossAmount) : 0;
|
|
4703
4714
|
},
|
|
4704
4715
|
enumerable: false,
|
|
4705
4716
|
configurable: true
|
|
4706
4717
|
});
|
|
4707
4718
|
Object.defineProperty(Transaction.prototype, "credit", {
|
|
4708
4719
|
get: function () {
|
|
4709
|
-
return this.isCredit() ? Math.abs(this.
|
|
4720
|
+
return this.isCredit() ? Math.abs(this.grossAmount) : 0;
|
|
4710
4721
|
},
|
|
4711
4722
|
enumerable: false,
|
|
4712
4723
|
configurable: true
|
|
@@ -9054,7 +9065,7 @@
|
|
|
9054
9065
|
__extends(PropertyReportItemTransaction, _super);
|
|
9055
9066
|
function PropertyReportItemTransaction(transactions, property, chartAccounts) {
|
|
9056
9067
|
var _this = _super.call(this, property, chartAccounts) || this;
|
|
9057
|
-
_this.amount = Math.abs(transactions.
|
|
9068
|
+
_this.amount = Math.abs(transactions.sumBy('grossAmount'));
|
|
9058
9069
|
_this.description = chartAccounts.name;
|
|
9059
9070
|
return _this;
|
|
9060
9071
|
}
|
|
@@ -12972,32 +12983,44 @@
|
|
|
12972
12983
|
_this.isHydra = true;
|
|
12973
12984
|
return _this;
|
|
12974
12985
|
}
|
|
12975
|
-
SoleInvoiceService.prototype.
|
|
12976
|
-
var
|
|
12977
|
-
|
|
12978
|
-
|
|
12986
|
+
SoleInvoiceService.prototype.add = function (invoice) {
|
|
12987
|
+
var _this = this;
|
|
12988
|
+
return _super.prototype.add.call(this, invoice).pipe(operators.map(function (newInvoice) {
|
|
12989
|
+
// invoice published right away skipping draft status
|
|
12990
|
+
if (newInvoice.isPending()) {
|
|
12991
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED, newInvoice));
|
|
12992
|
+
}
|
|
12993
|
+
return newInvoice;
|
|
12994
|
+
}));
|
|
12979
12995
|
};
|
|
12980
|
-
SoleInvoiceService.prototype.
|
|
12996
|
+
SoleInvoiceService.prototype.updateStatus = function (invoice, status) {
|
|
12981
12997
|
var _this = this;
|
|
12982
|
-
// use id only to avoid unexpected changes
|
|
12983
|
-
return this.update(
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12998
|
+
// @TODO use id only to avoid unexpected changes
|
|
12999
|
+
return this.update(Object.assign({}, invoice, { status: status })).pipe(operators.map(function (updatedInvoice) {
|
|
13000
|
+
// draft invoice status can be changed to pending only, which means publish
|
|
13001
|
+
if (invoice.isDraft()) {
|
|
13002
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.SOLE_INVOICE_PUBLISHED, updatedInvoice));
|
|
13003
|
+
}
|
|
13004
|
+
return updatedInvoice;
|
|
12987
13005
|
}));
|
|
12988
13006
|
};
|
|
12989
|
-
SoleInvoiceService.prototype.
|
|
12990
|
-
|
|
13007
|
+
SoleInvoiceService.prototype.send = function (invoice, file) {
|
|
13008
|
+
var formData = new FormData();
|
|
13009
|
+
formData.append('file', file);
|
|
13010
|
+
return this.http.post(this.environment.apiV2 + "/" + this.url + "/" + invoice.id + "/send", formData);
|
|
12991
13011
|
};
|
|
12992
13012
|
/**
|
|
13013
|
+
* @TODO use backend
|
|
12993
13014
|
* Return the next number from the last invoice.
|
|
12994
13015
|
* Basically needed to create a new invoice to show its number when the invoice has not yet been sent to the backend
|
|
12995
13016
|
*/
|
|
12996
13017
|
SoleInvoiceService.prototype.getNewInvoiceNumber = function () {
|
|
13018
|
+
var _a, _b;
|
|
12997
13019
|
if (!this.cache) {
|
|
12998
13020
|
return 0;
|
|
12999
13021
|
}
|
|
13000
|
-
|
|
13022
|
+
var number = (_b = (_a = last__default["default"](this.cache)) === null || _a === void 0 ? void 0 : _a.number) !== null && _b !== void 0 ? _b : 0;
|
|
13023
|
+
return number + 1;
|
|
13001
13024
|
};
|
|
13002
13025
|
return SoleInvoiceService;
|
|
13003
13026
|
}(RestService));
|