taxtank-core 2.1.31 → 2.1.32
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/fesm2022/taxtank-core.mjs +30 -18
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +7 -2
- package/package.json +1 -1
|
@@ -5970,6 +5970,9 @@ __decorate([
|
|
|
5970
5970
|
__decorate([
|
|
5971
5971
|
Type(() => Date)
|
|
5972
5972
|
], BasReport.prototype, "dateTo", void 0);
|
|
5973
|
+
__decorate([
|
|
5974
|
+
Type(() => SoleBusiness)
|
|
5975
|
+
], BasReport.prototype, "businesses", void 0);
|
|
5973
5976
|
|
|
5974
5977
|
class SoleContactItem {
|
|
5975
5978
|
}
|
|
@@ -16768,11 +16771,14 @@ var BasReportMessagesEnum;
|
|
|
16768
16771
|
BasReportMessagesEnum["CONFIRM_DELETE"] = "Are you sure you want to delete this BAS report?";
|
|
16769
16772
|
})(BasReportMessagesEnum || (BasReportMessagesEnum = {}));
|
|
16770
16773
|
|
|
16771
|
-
class BasReportService extends RestService {
|
|
16774
|
+
class BasReportService extends RestService$1 {
|
|
16772
16775
|
constructor() {
|
|
16773
16776
|
super(...arguments);
|
|
16774
16777
|
this.modelClass = BasReport;
|
|
16775
|
-
this.
|
|
16778
|
+
this.collectionClass = Collection;
|
|
16779
|
+
this.endpointUri = 'bas-reports';
|
|
16780
|
+
this.roles = [UserRolesEnum.SOLE_TANK];
|
|
16781
|
+
this.useBackendError = true;
|
|
16776
16782
|
}
|
|
16777
16783
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: BasReportService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
16778
16784
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: BasReportService, providedIn: 'root' }); }
|
|
@@ -25198,25 +25204,31 @@ class SoleInvoiceTemplateForm extends AbstractForm {
|
|
|
25198
25204
|
class BasReportForm extends AbstractForm {
|
|
25199
25205
|
constructor(report, transactions, depreciations) {
|
|
25200
25206
|
super({
|
|
25201
|
-
|
|
25202
|
-
|
|
25203
|
-
|
|
25204
|
-
|
|
25205
|
-
|
|
25206
|
-
|
|
25207
|
-
|
|
25208
|
-
|
|
25209
|
-
|
|
25210
|
-
|
|
25211
|
-
|
|
25212
|
-
|
|
25207
|
+
businesses: new FormControl(report.businesses, Validators.required),
|
|
25208
|
+
dateFrom: new FormControl(report.dateFrom, Validators.required),
|
|
25209
|
+
dateTo: new FormControl(report.dateTo, Validators.required),
|
|
25210
|
+
income: new FormControl({ value: report.income, disabled: true }),
|
|
25211
|
+
incomeGST: new FormControl({ value: report.incomeGST, disabled: true }, Validators.required),
|
|
25212
|
+
expenseGST: new FormControl({ value: report.expenseGST, disabled: true }, Validators.required),
|
|
25213
|
+
salary: new FormControl(report.salary, Validators.required),
|
|
25214
|
+
taxWithheldSalary: new FormControl(report.taxWithheldSalary, Validators.required),
|
|
25215
|
+
taxWithheldNoABN: new FormControl(report.taxWithheldNoABN, Validators.required),
|
|
25216
|
+
taxWithheldTotal: new FormControl({ value: report.taxWithheldTotal, disabled: true }),
|
|
25217
|
+
paygTaxInstalment: new FormControl(report.paygTaxInstalment, Validators.required),
|
|
25218
|
+
fuelTaxCredit: new FormControl(report.fuelTaxCredit, Validators.required),
|
|
25219
|
+
gst: new FormControl({ value: report.gst, disabled: true }),
|
|
25213
25220
|
}, report);
|
|
25214
25221
|
this.includeDisabledFields = true;
|
|
25215
25222
|
// prefill income/expense data based on transactions/depreciations filtered by specified date
|
|
25216
|
-
combineLatest([this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
|
|
25217
|
-
.subscribe(([dateFrom, dateTo]) => {
|
|
25218
|
-
const
|
|
25219
|
-
const
|
|
25223
|
+
combineLatest([this.get('businesses').valueChanges, this.get('dateFrom').valueChanges, this.get('dateTo').valueChanges])
|
|
25224
|
+
.subscribe(([businesses, dateFrom, dateTo]) => {
|
|
25225
|
+
const businessIds = businesses.map(business => business.id);
|
|
25226
|
+
const filteredTransactions = transactions
|
|
25227
|
+
.filterByRange('date', dateFrom, dateTo)
|
|
25228
|
+
.filterBy('business.id', businessIds);
|
|
25229
|
+
const filteredDepreciations = depreciations
|
|
25230
|
+
.filterByRange('date', dateFrom, dateTo)
|
|
25231
|
+
.filterBy('business.id', businessIds);
|
|
25220
25232
|
const incomeTransactions = filteredTransactions.getIncomeTransactions();
|
|
25221
25233
|
const depreciationTransactions = filteredDepreciations.map(depreciation => depreciation.toTransaction({ amount: -depreciation.amount }));
|
|
25222
25234
|
const expenseTransactions = new TransactionCollection(filteredTransactions.getExpenseTransactions().toArray());
|