taxtank-core 0.30.28 → 0.30.29-1
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/esm2020/lib/db/Models/bank/bank-account-property.mjs +6 -1
- package/esm2020/lib/db/Models/bank/bank-account.mjs +6 -1
- package/esm2020/lib/db/Models/loan/loan-payout.mjs +9 -1
- package/esm2020/lib/db/Models/loan/loan.mjs +18 -1
- package/esm2020/lib/db/Models/property/property-share.mjs +6 -1
- package/esm2020/lib/db/Models/property/property-valuation.mjs +6 -1
- package/esm2020/lib/db/Models/property/property.mjs +18 -1
- package/esm2020/lib/forms/sole/sole-invoice.form.mjs +5 -1
- package/esm2020/lib/forms/transaction/work/work-transaction.form.mjs +3 -1
- package/esm2020/lib/models/chart-accounts/chart-accounts.mjs +4 -1
- package/esm2020/lib/models/property/property-valuation.mjs +4 -1
- package/esm2020/lib/services/http/bank/bank-account/bank-account.service.mjs +2 -1
- package/esm2020/lib/validators/transactions-meta-fields.validator.mjs +34 -0
- package/fesm2015/taxtank-core.mjs +93 -0
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +93 -0
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/models/chart-accounts/chart-accounts.d.ts +1 -0
- package/lib/models/property/property-valuation.d.ts +1 -0
- package/lib/validators/transactions-meta-fields.validator.d.ts +5 -0
- package/package.json +1 -1
|
@@ -299,6 +299,9 @@ class BankAccountBalance extends AbstractModel {
|
|
|
299
299
|
|
|
300
300
|
let BankAccountProperty$1 = class BankAccountProperty extends AbstractModel {
|
|
301
301
|
};
|
|
302
|
+
__decorate([
|
|
303
|
+
Type(() => Number)
|
|
304
|
+
], BankAccountProperty$1.prototype, "percent", void 0);
|
|
302
305
|
|
|
303
306
|
/**
|
|
304
307
|
* Model, which children should be listened via event dispatcher service ising automatic events
|
|
@@ -314,6 +317,9 @@ class ObservableModel extends AbstractModel {
|
|
|
314
317
|
|
|
315
318
|
let BankAccount$1 = class BankAccount extends ObservableModel {
|
|
316
319
|
};
|
|
320
|
+
__decorate([
|
|
321
|
+
Type(() => Number)
|
|
322
|
+
], BankAccount$1.prototype, "currentBalance", void 0);
|
|
317
323
|
|
|
318
324
|
let BankConnection$1 = class BankConnection extends ObservableModel {
|
|
319
325
|
};
|
|
@@ -533,9 +539,30 @@ let BorrowingExpense$1 = class BorrowingExpense extends AbstractModel {
|
|
|
533
539
|
|
|
534
540
|
let LoanPayout$1 = class LoanPayout extends ObservableModel {
|
|
535
541
|
};
|
|
542
|
+
__decorate([
|
|
543
|
+
Type(() => Number)
|
|
544
|
+
], LoanPayout$1.prototype, "payoutAmount", void 0);
|
|
545
|
+
__decorate([
|
|
546
|
+
Type(() => Number)
|
|
547
|
+
], LoanPayout$1.prototype, "fees", void 0);
|
|
536
548
|
|
|
537
549
|
let Loan$1 = class Loan extends ObservableModel {
|
|
538
550
|
};
|
|
551
|
+
__decorate([
|
|
552
|
+
Type(() => Number)
|
|
553
|
+
], Loan$1.prototype, "amount", void 0);
|
|
554
|
+
__decorate([
|
|
555
|
+
Type(() => Number)
|
|
556
|
+
], Loan$1.prototype, "availableRedraw", void 0);
|
|
557
|
+
__decorate([
|
|
558
|
+
Type(() => Number)
|
|
559
|
+
], Loan$1.prototype, "interestRate", void 0);
|
|
560
|
+
__decorate([
|
|
561
|
+
Type(() => Number)
|
|
562
|
+
], Loan$1.prototype, "term", void 0);
|
|
563
|
+
__decorate([
|
|
564
|
+
Type(() => Number)
|
|
565
|
+
], Loan$1.prototype, "repaymentAmount", void 0);
|
|
539
566
|
|
|
540
567
|
let PropertySaleTaxExemptionMetaField$1 = class PropertySaleTaxExemptionMetaField extends AbstractModel {
|
|
541
568
|
};
|
|
@@ -560,15 +587,36 @@ let PropertyForecast$1 = class PropertyForecast extends AbstractModel {
|
|
|
560
587
|
|
|
561
588
|
let PropertyShare$1 = class PropertyShare extends ObservableModel {
|
|
562
589
|
};
|
|
590
|
+
__decorate([
|
|
591
|
+
Type(() => Number)
|
|
592
|
+
], PropertyShare$1.prototype, "percent", void 0);
|
|
563
593
|
|
|
564
594
|
let PropertySubscription$1 = class PropertySubscription extends AbstractModel {
|
|
565
595
|
};
|
|
566
596
|
|
|
567
597
|
let PropertyValuation$1 = class PropertyValuation extends AbstractModel {
|
|
568
598
|
};
|
|
599
|
+
__decorate([
|
|
600
|
+
Type(() => Number)
|
|
601
|
+
], PropertyValuation$1.prototype, "marketValue", void 0);
|
|
569
602
|
|
|
570
603
|
let Property$1 = class Property extends ObservableModel {
|
|
571
604
|
};
|
|
605
|
+
__decorate([
|
|
606
|
+
Type(() => Number)
|
|
607
|
+
], Property$1.prototype, "purchasePrice", void 0);
|
|
608
|
+
__decorate([
|
|
609
|
+
Type(() => Number)
|
|
610
|
+
], Property$1.prototype, "growthPercent", void 0);
|
|
611
|
+
__decorate([
|
|
612
|
+
Type(() => Number)
|
|
613
|
+
], Property$1.prototype, "stampDuty", void 0);
|
|
614
|
+
__decorate([
|
|
615
|
+
Type(() => Number)
|
|
616
|
+
], Property$1.prototype, "legalFees", void 0);
|
|
617
|
+
__decorate([
|
|
618
|
+
Type(() => Number)
|
|
619
|
+
], Property$1.prototype, "otherCapitalCosts", void 0);
|
|
572
620
|
|
|
573
621
|
let BasReport$1 = class BasReport extends AbstractModel {
|
|
574
622
|
};
|
|
@@ -3077,6 +3125,9 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
3077
3125
|
isTransfer() {
|
|
3078
3126
|
return this.id === ChartAccountsListEnum.TRANSFER;
|
|
3079
3127
|
}
|
|
3128
|
+
isDividends() {
|
|
3129
|
+
return this.id === ChartAccountsListEnum.DIVIDENDS;
|
|
3130
|
+
}
|
|
3080
3131
|
}
|
|
3081
3132
|
/**
|
|
3082
3133
|
* Australian GST percent value (VAT)
|
|
@@ -3753,6 +3804,9 @@ __decorate([
|
|
|
3753
3804
|
__decorate([
|
|
3754
3805
|
Type(() => PropertyDocument)
|
|
3755
3806
|
], PropertyValuation.prototype, "document", void 0);
|
|
3807
|
+
__decorate([
|
|
3808
|
+
Type(() => Number)
|
|
3809
|
+
], PropertyValuation.prototype, "marketValue", void 0);
|
|
3756
3810
|
__decorate([
|
|
3757
3811
|
Exclude()
|
|
3758
3812
|
], PropertyValuation.prototype, "documentFile", void 0);
|
|
@@ -11713,6 +11767,7 @@ class BankAccountService extends RestService$1 {
|
|
|
11713
11767
|
listenToEventDispatcherChanges() {
|
|
11714
11768
|
this.eventDispatcherService.on([
|
|
11715
11769
|
AppEventTypeEnum.LOAN_PAYOUT_UPDATED,
|
|
11770
|
+
AppEventTypeEnum.BANK_TRANSACTIONS_ADDED
|
|
11716
11771
|
]).subscribe(() => {
|
|
11717
11772
|
this.resetCache();
|
|
11718
11773
|
});
|
|
@@ -17726,6 +17781,10 @@ class SoleInvoiceForm extends AbstractForm {
|
|
|
17726
17781
|
if (this.defaultTemplate) {
|
|
17727
17782
|
this.updateTemplateRelatedFields(this.defaultTemplate);
|
|
17728
17783
|
}
|
|
17784
|
+
// set tax exclusive by default if user is registered for gst
|
|
17785
|
+
if (this.soleDetailsGST) {
|
|
17786
|
+
this.commonData.get('taxType').setValue(SoleInvoiceTaxTypeEnum.TAX_EXCLUSIVE);
|
|
17787
|
+
}
|
|
17729
17788
|
}
|
|
17730
17789
|
// invoice.taxType is always NONE ('No Tax') when soleDetails.isGST === false
|
|
17731
17790
|
if (!this.soleDetailsGST) {
|
|
@@ -19528,6 +19587,39 @@ class TransactionForm extends TransactionBaseForm {
|
|
|
19528
19587
|
}
|
|
19529
19588
|
}
|
|
19530
19589
|
|
|
19590
|
+
/**
|
|
19591
|
+
* Validator that check fields for transaction meta
|
|
19592
|
+
*/
|
|
19593
|
+
function transactionsMetaFieldsValidator() {
|
|
19594
|
+
return (formGroup) => {
|
|
19595
|
+
const chartAccounts = formGroup.get('chartAccounts').value;
|
|
19596
|
+
if (!chartAccounts) {
|
|
19597
|
+
return null;
|
|
19598
|
+
}
|
|
19599
|
+
const metaFields = chartAccounts.metaFields;
|
|
19600
|
+
if (chartAccounts.isDividends()) {
|
|
19601
|
+
return checkDividends(metaFields, formGroup);
|
|
19602
|
+
}
|
|
19603
|
+
return null;
|
|
19604
|
+
};
|
|
19605
|
+
}
|
|
19606
|
+
/**
|
|
19607
|
+
* the sum of the fields "Franked" and "Unfranked" must equal transactions amount
|
|
19608
|
+
*/
|
|
19609
|
+
function checkDividends(metaFields, formGroup) {
|
|
19610
|
+
const frankedAndUnfrankedIds = [ChartAccountsMetaFieldListEnum.FRANKED, ChartAccountsMetaFieldListEnum.UNFRANKED];
|
|
19611
|
+
const amount = Math.abs(formGroup.get('amount').value);
|
|
19612
|
+
const frankedAndUnfrankedControls = (formGroup.get('metaFields')).controls
|
|
19613
|
+
.filter((control) => frankedAndUnfrankedIds.includes(control.get('chartAccountsMetaField').value.id));
|
|
19614
|
+
const frankedAndUnfrankedAmount = frankedAndUnfrankedControls.reduce((sum, control) => sum + (+control.get('value').value), 0);
|
|
19615
|
+
for (let control of frankedAndUnfrankedControls) {
|
|
19616
|
+
if (control.get('value').value !== null && frankedAndUnfrankedAmount !== amount) {
|
|
19617
|
+
return { metaFields: `Field ${control.get('chartAccountsMetaField').value.label} is required` };
|
|
19618
|
+
}
|
|
19619
|
+
}
|
|
19620
|
+
return amount === frankedAndUnfrankedAmount ? null : { metaFields: 'Please enter the franked and/or unfranked amounts.' };
|
|
19621
|
+
}
|
|
19622
|
+
|
|
19531
19623
|
class WorkTransactionForm extends TransactionForm {
|
|
19532
19624
|
constructor(transaction, registeredForGst, allocations, controls = {}) {
|
|
19533
19625
|
super(transaction, registeredForGst, allocations, Object.assign(controls, {
|
|
@@ -19539,6 +19631,7 @@ class WorkTransactionForm extends TransactionForm {
|
|
|
19539
19631
|
});
|
|
19540
19632
|
}))
|
|
19541
19633
|
}));
|
|
19634
|
+
this.setValidators(transactionsMetaFieldsValidator());
|
|
19542
19635
|
this.listenEvents();
|
|
19543
19636
|
}
|
|
19544
19637
|
listenEvents() {
|