taxtank-core 0.27.1 → 0.27.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 +94 -90
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/sole/sole-business.js +6 -2
- package/fesm2015/taxtank-core.js +63 -59
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/sole/sole-business.d.ts +5 -1
- package/package.json +1 -1
|
@@ -3229,6 +3229,96 @@
|
|
|
3229
3229
|
classTransformer.Type(function () { return SoleInvoiceTemplate; })
|
|
3230
3230
|
], SoleInvoice.prototype, "template", void 0);
|
|
3231
3231
|
|
|
3232
|
+
/**
|
|
3233
|
+
* Class contains traveled kilometers and work usage percent in 12 weeks date range
|
|
3234
|
+
* @TODO Vik: Best period: move this and related logic to backend
|
|
3235
|
+
*/
|
|
3236
|
+
var LogbookPeriod = /** @class */ (function () {
|
|
3237
|
+
function LogbookPeriod() {
|
|
3238
|
+
}
|
|
3239
|
+
LogbookPeriod.prototype.isEndOfYear = function () {
|
|
3240
|
+
return this.to === new FinancialYear().endDate;
|
|
3241
|
+
};
|
|
3242
|
+
LogbookPeriod.prototype.getWorkUsageByClaim = function (claim) {
|
|
3243
|
+
var claimKilometers = this.logbooks.getByVehicleClaim(claim).getClaimableLogbooks().kilometers;
|
|
3244
|
+
return Math.round(this.workUsage * (claimKilometers / this.kilometers));
|
|
3245
|
+
};
|
|
3246
|
+
return LogbookPeriod;
|
|
3247
|
+
}());
|
|
3248
|
+
__decorate([
|
|
3249
|
+
classTransformer.Type(function () { return Date; })
|
|
3250
|
+
], LogbookPeriod.prototype, "from", void 0);
|
|
3251
|
+
__decorate([
|
|
3252
|
+
classTransformer.Type(function () { return Date; })
|
|
3253
|
+
], LogbookPeriod.prototype, "to", void 0);
|
|
3254
|
+
|
|
3255
|
+
var Vehicle$1 = /** @class */ (function (_super) {
|
|
3256
|
+
__extends(Vehicle, _super);
|
|
3257
|
+
function Vehicle() {
|
|
3258
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3259
|
+
}
|
|
3260
|
+
return Vehicle;
|
|
3261
|
+
}(AbstractModel));
|
|
3262
|
+
|
|
3263
|
+
var VehicleLogbook$1 = /** @class */ (function (_super) {
|
|
3264
|
+
__extends(VehicleLogbook, _super);
|
|
3265
|
+
function VehicleLogbook() {
|
|
3266
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3267
|
+
}
|
|
3268
|
+
return VehicleLogbook;
|
|
3269
|
+
}(AbstractModel));
|
|
3270
|
+
|
|
3271
|
+
var VehicleLogbook = /** @class */ (function (_super) {
|
|
3272
|
+
__extends(VehicleLogbook, _super);
|
|
3273
|
+
function VehicleLogbook() {
|
|
3274
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3275
|
+
}
|
|
3276
|
+
Object.defineProperty(VehicleLogbook.prototype, "kilometers", {
|
|
3277
|
+
get: function () {
|
|
3278
|
+
return this.odometerEnd - this.odometerStart;
|
|
3279
|
+
},
|
|
3280
|
+
enumerable: false,
|
|
3281
|
+
configurable: true
|
|
3282
|
+
});
|
|
3283
|
+
Object.defineProperty(VehicleLogbook.prototype, "tankType", {
|
|
3284
|
+
get: function () {
|
|
3285
|
+
return this.isSoleTank() ? exports.TankTypeEnum.SOLE : exports.TankTypeEnum.WORK;
|
|
3286
|
+
},
|
|
3287
|
+
enumerable: false,
|
|
3288
|
+
configurable: true
|
|
3289
|
+
});
|
|
3290
|
+
VehicleLogbook.prototype.isWorkTank = function () {
|
|
3291
|
+
return !this.business;
|
|
3292
|
+
};
|
|
3293
|
+
VehicleLogbook.prototype.isSoleTank = function () {
|
|
3294
|
+
return !!this.business;
|
|
3295
|
+
};
|
|
3296
|
+
return VehicleLogbook;
|
|
3297
|
+
}(VehicleLogbook$1));
|
|
3298
|
+
/**
|
|
3299
|
+
* 12 weeks in milliseconds
|
|
3300
|
+
* "To work out your business-use percentage, you need to keep a logbook and the odometer readings for the logbook period.
|
|
3301
|
+
* The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
|
|
3302
|
+
*/
|
|
3303
|
+
VehicleLogbook.periodDuration = 7257600000;
|
|
3304
|
+
__decorate([
|
|
3305
|
+
classTransformer.Type(function () { return Date; })
|
|
3306
|
+
], VehicleLogbook.prototype, "date", void 0);
|
|
3307
|
+
__decorate([
|
|
3308
|
+
classTransformer.Type(function () { return SoleBusiness; })
|
|
3309
|
+
], VehicleLogbook.prototype, "business", void 0);
|
|
3310
|
+
|
|
3311
|
+
var Vehicle = /** @class */ (function (_super) {
|
|
3312
|
+
__extends(Vehicle, _super);
|
|
3313
|
+
function Vehicle() {
|
|
3314
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3315
|
+
}
|
|
3316
|
+
return Vehicle;
|
|
3317
|
+
}(Vehicle$1));
|
|
3318
|
+
__decorate([
|
|
3319
|
+
classTransformer.Type(function () { return VehicleLogbook; })
|
|
3320
|
+
], Vehicle.prototype, "logbook", void 0);
|
|
3321
|
+
|
|
3232
3322
|
var VehicleClaim$1 = /** @class */ (function (_super) {
|
|
3233
3323
|
__extends(VehicleClaim, _super);
|
|
3234
3324
|
function VehicleClaim() {
|
|
@@ -4402,6 +4492,10 @@
|
|
|
4402
4492
|
};
|
|
4403
4493
|
return SoleBusiness;
|
|
4404
4494
|
}(SoleBusiness$1));
|
|
4495
|
+
/**
|
|
4496
|
+
* Maximum number of businesses that a person can have, according to the ATO
|
|
4497
|
+
*/
|
|
4498
|
+
SoleBusiness.businessesLimit = 6;
|
|
4405
4499
|
__decorate([
|
|
4406
4500
|
classTransformer.Type(function () { return User; })
|
|
4407
4501
|
], SoleBusiness.prototype, "user", void 0);
|
|
@@ -5990,96 +6084,6 @@
|
|
|
5990
6084
|
}]
|
|
5991
6085
|
}] });
|
|
5992
6086
|
|
|
5993
|
-
/**
|
|
5994
|
-
* Class contains traveled kilometers and work usage percent in 12 weeks date range
|
|
5995
|
-
* @TODO Vik: Best period: move this and related logic to backend
|
|
5996
|
-
*/
|
|
5997
|
-
var LogbookPeriod = /** @class */ (function () {
|
|
5998
|
-
function LogbookPeriod() {
|
|
5999
|
-
}
|
|
6000
|
-
LogbookPeriod.prototype.isEndOfYear = function () {
|
|
6001
|
-
return this.to === new FinancialYear().endDate;
|
|
6002
|
-
};
|
|
6003
|
-
LogbookPeriod.prototype.getWorkUsageByClaim = function (claim) {
|
|
6004
|
-
var claimKilometers = this.logbooks.getByVehicleClaim(claim).getClaimableLogbooks().kilometers;
|
|
6005
|
-
return Math.round(this.workUsage * (claimKilometers / this.kilometers));
|
|
6006
|
-
};
|
|
6007
|
-
return LogbookPeriod;
|
|
6008
|
-
}());
|
|
6009
|
-
__decorate([
|
|
6010
|
-
classTransformer.Type(function () { return Date; })
|
|
6011
|
-
], LogbookPeriod.prototype, "from", void 0);
|
|
6012
|
-
__decorate([
|
|
6013
|
-
classTransformer.Type(function () { return Date; })
|
|
6014
|
-
], LogbookPeriod.prototype, "to", void 0);
|
|
6015
|
-
|
|
6016
|
-
var Vehicle$1 = /** @class */ (function (_super) {
|
|
6017
|
-
__extends(Vehicle, _super);
|
|
6018
|
-
function Vehicle() {
|
|
6019
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6020
|
-
}
|
|
6021
|
-
return Vehicle;
|
|
6022
|
-
}(AbstractModel));
|
|
6023
|
-
|
|
6024
|
-
var VehicleLogbook$1 = /** @class */ (function (_super) {
|
|
6025
|
-
__extends(VehicleLogbook, _super);
|
|
6026
|
-
function VehicleLogbook() {
|
|
6027
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6028
|
-
}
|
|
6029
|
-
return VehicleLogbook;
|
|
6030
|
-
}(AbstractModel));
|
|
6031
|
-
|
|
6032
|
-
var VehicleLogbook = /** @class */ (function (_super) {
|
|
6033
|
-
__extends(VehicleLogbook, _super);
|
|
6034
|
-
function VehicleLogbook() {
|
|
6035
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6036
|
-
}
|
|
6037
|
-
Object.defineProperty(VehicleLogbook.prototype, "kilometers", {
|
|
6038
|
-
get: function () {
|
|
6039
|
-
return this.odometerEnd - this.odometerStart;
|
|
6040
|
-
},
|
|
6041
|
-
enumerable: false,
|
|
6042
|
-
configurable: true
|
|
6043
|
-
});
|
|
6044
|
-
Object.defineProperty(VehicleLogbook.prototype, "tankType", {
|
|
6045
|
-
get: function () {
|
|
6046
|
-
return this.isSoleTank() ? exports.TankTypeEnum.SOLE : exports.TankTypeEnum.WORK;
|
|
6047
|
-
},
|
|
6048
|
-
enumerable: false,
|
|
6049
|
-
configurable: true
|
|
6050
|
-
});
|
|
6051
|
-
VehicleLogbook.prototype.isWorkTank = function () {
|
|
6052
|
-
return !this.business;
|
|
6053
|
-
};
|
|
6054
|
-
VehicleLogbook.prototype.isSoleTank = function () {
|
|
6055
|
-
return !!this.business;
|
|
6056
|
-
};
|
|
6057
|
-
return VehicleLogbook;
|
|
6058
|
-
}(VehicleLogbook$1));
|
|
6059
|
-
/**
|
|
6060
|
-
* 12 weeks in milliseconds
|
|
6061
|
-
* "To work out your business-use percentage, you need to keep a logbook and the odometer readings for the logbook period.
|
|
6062
|
-
* The logbook period is a minimum continuous period of 12 weeks." © Nicole Kelly
|
|
6063
|
-
*/
|
|
6064
|
-
VehicleLogbook.periodDuration = 7257600000;
|
|
6065
|
-
__decorate([
|
|
6066
|
-
classTransformer.Type(function () { return Date; })
|
|
6067
|
-
], VehicleLogbook.prototype, "date", void 0);
|
|
6068
|
-
__decorate([
|
|
6069
|
-
classTransformer.Type(function () { return SoleBusiness; })
|
|
6070
|
-
], VehicleLogbook.prototype, "business", void 0);
|
|
6071
|
-
|
|
6072
|
-
var Vehicle = /** @class */ (function (_super) {
|
|
6073
|
-
__extends(Vehicle, _super);
|
|
6074
|
-
function Vehicle() {
|
|
6075
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
6076
|
-
}
|
|
6077
|
-
return Vehicle;
|
|
6078
|
-
}(Vehicle$1));
|
|
6079
|
-
__decorate([
|
|
6080
|
-
classTransformer.Type(function () { return VehicleLogbook; })
|
|
6081
|
-
], Vehicle.prototype, "logbook", void 0);
|
|
6082
|
-
|
|
6083
6087
|
var VehicleClaimCollection = /** @class */ (function (_super) {
|
|
6084
6088
|
__extends(VehicleClaimCollection, _super);
|
|
6085
6089
|
function VehicleClaimCollection() {
|