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
|
@@ -305,6 +305,9 @@ class BankAccountBalance extends AbstractModel {
|
|
|
305
305
|
|
|
306
306
|
let BankAccountProperty$1 = class BankAccountProperty extends AbstractModel {
|
|
307
307
|
};
|
|
308
|
+
__decorate([
|
|
309
|
+
Type(() => Number)
|
|
310
|
+
], BankAccountProperty$1.prototype, "percent", void 0);
|
|
308
311
|
|
|
309
312
|
/**
|
|
310
313
|
* Model, which children should be listened via event dispatcher service ising automatic events
|
|
@@ -320,6 +323,9 @@ class ObservableModel extends AbstractModel {
|
|
|
320
323
|
|
|
321
324
|
let BankAccount$1 = class BankAccount extends ObservableModel {
|
|
322
325
|
};
|
|
326
|
+
__decorate([
|
|
327
|
+
Type(() => Number)
|
|
328
|
+
], BankAccount$1.prototype, "currentBalance", void 0);
|
|
323
329
|
|
|
324
330
|
let BankConnection$1 = class BankConnection extends ObservableModel {
|
|
325
331
|
};
|
|
@@ -542,9 +548,30 @@ let BorrowingExpense$1 = class BorrowingExpense extends AbstractModel {
|
|
|
542
548
|
|
|
543
549
|
let LoanPayout$1 = class LoanPayout extends ObservableModel {
|
|
544
550
|
};
|
|
551
|
+
__decorate([
|
|
552
|
+
Type(() => Number)
|
|
553
|
+
], LoanPayout$1.prototype, "payoutAmount", void 0);
|
|
554
|
+
__decorate([
|
|
555
|
+
Type(() => Number)
|
|
556
|
+
], LoanPayout$1.prototype, "fees", void 0);
|
|
545
557
|
|
|
546
558
|
let Loan$1 = class Loan extends ObservableModel {
|
|
547
559
|
};
|
|
560
|
+
__decorate([
|
|
561
|
+
Type(() => Number)
|
|
562
|
+
], Loan$1.prototype, "amount", void 0);
|
|
563
|
+
__decorate([
|
|
564
|
+
Type(() => Number)
|
|
565
|
+
], Loan$1.prototype, "availableRedraw", void 0);
|
|
566
|
+
__decorate([
|
|
567
|
+
Type(() => Number)
|
|
568
|
+
], Loan$1.prototype, "interestRate", void 0);
|
|
569
|
+
__decorate([
|
|
570
|
+
Type(() => Number)
|
|
571
|
+
], Loan$1.prototype, "term", void 0);
|
|
572
|
+
__decorate([
|
|
573
|
+
Type(() => Number)
|
|
574
|
+
], Loan$1.prototype, "repaymentAmount", void 0);
|
|
548
575
|
|
|
549
576
|
let PropertySaleTaxExemptionMetaField$1 = class PropertySaleTaxExemptionMetaField extends AbstractModel {
|
|
550
577
|
};
|
|
@@ -569,15 +596,36 @@ let PropertyForecast$1 = class PropertyForecast extends AbstractModel {
|
|
|
569
596
|
|
|
570
597
|
let PropertyShare$1 = class PropertyShare extends ObservableModel {
|
|
571
598
|
};
|
|
599
|
+
__decorate([
|
|
600
|
+
Type(() => Number)
|
|
601
|
+
], PropertyShare$1.prototype, "percent", void 0);
|
|
572
602
|
|
|
573
603
|
let PropertySubscription$1 = class PropertySubscription extends AbstractModel {
|
|
574
604
|
};
|
|
575
605
|
|
|
576
606
|
let PropertyValuation$1 = class PropertyValuation extends AbstractModel {
|
|
577
607
|
};
|
|
608
|
+
__decorate([
|
|
609
|
+
Type(() => Number)
|
|
610
|
+
], PropertyValuation$1.prototype, "marketValue", void 0);
|
|
578
611
|
|
|
579
612
|
let Property$1 = class Property extends ObservableModel {
|
|
580
613
|
};
|
|
614
|
+
__decorate([
|
|
615
|
+
Type(() => Number)
|
|
616
|
+
], Property$1.prototype, "purchasePrice", void 0);
|
|
617
|
+
__decorate([
|
|
618
|
+
Type(() => Number)
|
|
619
|
+
], Property$1.prototype, "growthPercent", void 0);
|
|
620
|
+
__decorate([
|
|
621
|
+
Type(() => Number)
|
|
622
|
+
], Property$1.prototype, "stampDuty", void 0);
|
|
623
|
+
__decorate([
|
|
624
|
+
Type(() => Number)
|
|
625
|
+
], Property$1.prototype, "legalFees", void 0);
|
|
626
|
+
__decorate([
|
|
627
|
+
Type(() => Number)
|
|
628
|
+
], Property$1.prototype, "otherCapitalCosts", void 0);
|
|
581
629
|
|
|
582
630
|
let BasReport$1 = class BasReport extends AbstractModel {
|
|
583
631
|
};
|
|
@@ -3093,6 +3141,9 @@ class ChartAccounts extends ChartAccounts$1 {
|
|
|
3093
3141
|
isTransfer() {
|
|
3094
3142
|
return this.id === ChartAccountsListEnum.TRANSFER;
|
|
3095
3143
|
}
|
|
3144
|
+
isDividends() {
|
|
3145
|
+
return this.id === ChartAccountsListEnum.DIVIDENDS;
|
|
3146
|
+
}
|
|
3096
3147
|
}
|
|
3097
3148
|
/**
|
|
3098
3149
|
* Australian GST percent value (VAT)
|
|
@@ -3772,6 +3823,9 @@ __decorate([
|
|
|
3772
3823
|
__decorate([
|
|
3773
3824
|
Type(() => PropertyDocument)
|
|
3774
3825
|
], PropertyValuation.prototype, "document", void 0);
|
|
3826
|
+
__decorate([
|
|
3827
|
+
Type(() => Number)
|
|
3828
|
+
], PropertyValuation.prototype, "marketValue", void 0);
|
|
3775
3829
|
__decorate([
|
|
3776
3830
|
Exclude()
|
|
3777
3831
|
], PropertyValuation.prototype, "documentFile", void 0);
|
|
@@ -11786,6 +11840,7 @@ class BankAccountService extends RestService$1 {
|
|
|
11786
11840
|
listenToEventDispatcherChanges() {
|
|
11787
11841
|
this.eventDispatcherService.on([
|
|
11788
11842
|
AppEventTypeEnum.LOAN_PAYOUT_UPDATED,
|
|
11843
|
+
AppEventTypeEnum.BANK_TRANSACTIONS_ADDED
|
|
11789
11844
|
]).subscribe(() => {
|
|
11790
11845
|
this.resetCache();
|
|
11791
11846
|
});
|
|
@@ -17853,6 +17908,10 @@ class SoleInvoiceForm extends AbstractForm {
|
|
|
17853
17908
|
if (this.defaultTemplate) {
|
|
17854
17909
|
this.updateTemplateRelatedFields(this.defaultTemplate);
|
|
17855
17910
|
}
|
|
17911
|
+
// set tax exclusive by default if user is registered for gst
|
|
17912
|
+
if (this.soleDetailsGST) {
|
|
17913
|
+
this.commonData.get('taxType').setValue(SoleInvoiceTaxTypeEnum.TAX_EXCLUSIVE);
|
|
17914
|
+
}
|
|
17856
17915
|
}
|
|
17857
17916
|
// invoice.taxType is always NONE ('No Tax') when soleDetails.isGST === false
|
|
17858
17917
|
if (!this.soleDetailsGST) {
|
|
@@ -19667,6 +19726,39 @@ class TransactionForm extends TransactionBaseForm {
|
|
|
19667
19726
|
}
|
|
19668
19727
|
}
|
|
19669
19728
|
|
|
19729
|
+
/**
|
|
19730
|
+
* Validator that check fields for transaction meta
|
|
19731
|
+
*/
|
|
19732
|
+
function transactionsMetaFieldsValidator() {
|
|
19733
|
+
return (formGroup) => {
|
|
19734
|
+
const chartAccounts = formGroup.get('chartAccounts').value;
|
|
19735
|
+
if (!chartAccounts) {
|
|
19736
|
+
return null;
|
|
19737
|
+
}
|
|
19738
|
+
const metaFields = chartAccounts.metaFields;
|
|
19739
|
+
if (chartAccounts.isDividends()) {
|
|
19740
|
+
return checkDividends(metaFields, formGroup);
|
|
19741
|
+
}
|
|
19742
|
+
return null;
|
|
19743
|
+
};
|
|
19744
|
+
}
|
|
19745
|
+
/**
|
|
19746
|
+
* the sum of the fields "Franked" and "Unfranked" must equal transactions amount
|
|
19747
|
+
*/
|
|
19748
|
+
function checkDividends(metaFields, formGroup) {
|
|
19749
|
+
const frankedAndUnfrankedIds = [ChartAccountsMetaFieldListEnum.FRANKED, ChartAccountsMetaFieldListEnum.UNFRANKED];
|
|
19750
|
+
const amount = Math.abs(formGroup.get('amount').value);
|
|
19751
|
+
const frankedAndUnfrankedControls = (formGroup.get('metaFields')).controls
|
|
19752
|
+
.filter((control) => frankedAndUnfrankedIds.includes(control.get('chartAccountsMetaField').value.id));
|
|
19753
|
+
const frankedAndUnfrankedAmount = frankedAndUnfrankedControls.reduce((sum, control) => sum + (+control.get('value').value), 0);
|
|
19754
|
+
for (let control of frankedAndUnfrankedControls) {
|
|
19755
|
+
if (control.get('value').value !== null && frankedAndUnfrankedAmount !== amount) {
|
|
19756
|
+
return { metaFields: `Field ${control.get('chartAccountsMetaField').value.label} is required` };
|
|
19757
|
+
}
|
|
19758
|
+
}
|
|
19759
|
+
return amount === frankedAndUnfrankedAmount ? null : { metaFields: 'Please enter the franked and/or unfranked amounts.' };
|
|
19760
|
+
}
|
|
19761
|
+
|
|
19670
19762
|
class WorkTransactionForm extends TransactionForm {
|
|
19671
19763
|
constructor(transaction, registeredForGst, allocations, controls = {}) {
|
|
19672
19764
|
super(transaction, registeredForGst, allocations, Object.assign(controls, {
|
|
@@ -19678,6 +19770,7 @@ class WorkTransactionForm extends TransactionForm {
|
|
|
19678
19770
|
});
|
|
19679
19771
|
}))
|
|
19680
19772
|
}));
|
|
19773
|
+
this.setValidators(transactionsMetaFieldsValidator());
|
|
19681
19774
|
this.listenEvents();
|
|
19682
19775
|
}
|
|
19683
19776
|
listenEvents() {
|