taxtank-core 2.1.102 → 2.1.104
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 +7 -4
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/index.d.ts.map +0 -1
|
@@ -6736,8 +6736,11 @@ class Property extends Property$1 {
|
|
|
6736
6736
|
get corelogicNextDate() {
|
|
6737
6737
|
return this.corelogicLastRequest ? new Date(this.corelogicLastRequest.getTime() + Property.corelogicCooldown) : new Date();
|
|
6738
6738
|
}
|
|
6739
|
+
isForeign() {
|
|
6740
|
+
return !this.address.country.isAustralia();
|
|
6741
|
+
}
|
|
6739
6742
|
isCorelogicAvailable() {
|
|
6740
|
-
return this.
|
|
6743
|
+
return !this.isForeign() && (this.corelogicLastRequest < new Date(Date.now() - Property.corelogicCooldown));
|
|
6741
6744
|
}
|
|
6742
6745
|
getGrowth() {
|
|
6743
6746
|
return this.valuation.marketValue - this.purchasePrice;
|
|
@@ -28253,9 +28256,7 @@ class PropertyEditForm extends AbstractForm {
|
|
|
28253
28256
|
|
|
28254
28257
|
class PropertyValuationForm extends AbstractForm {
|
|
28255
28258
|
constructor(valuation = plainToClass(PropertyValuation, {}), property) {
|
|
28256
|
-
|
|
28257
|
-
// const marketValue = valuation.id ? valuation.marketValue ?? property?.marketValue : 0;
|
|
28258
|
-
const marketValue = valuation.marketValue ?? property?.marketValue;
|
|
28259
|
+
const marketValue = property?.isForeign() && !valuation.id ? 0 : valuation.marketValue ?? property?.marketValue;
|
|
28259
28260
|
super({
|
|
28260
28261
|
// corelogic available only for new valuations if request cooldown has passed
|
|
28261
28262
|
isCorelogic: new FormControl(property?.isCorelogicAvailable() && !valuation.id),
|
|
@@ -29558,6 +29559,7 @@ var MessagesEnum$1;
|
|
|
29558
29559
|
class TransactionForm extends TransactionBaseForm {
|
|
29559
29560
|
constructor(transaction, registeredForGst, allocations, controls = {}) {
|
|
29560
29561
|
super(transaction, registeredForGst, Object.assign(controls, {
|
|
29562
|
+
transactions: new UntypedFormArray([]),
|
|
29561
29563
|
source: new UntypedFormControl(transaction.source || TransactionSourceEnum.BANK_TRANSACTION, Validators.required)
|
|
29562
29564
|
}));
|
|
29563
29565
|
this.includeDisabledFields = true;
|
|
@@ -29570,6 +29572,7 @@ class TransactionForm extends TransactionBaseForm {
|
|
|
29570
29572
|
if (transaction.property) {
|
|
29571
29573
|
this.get('date').addValidators(minDateValidator(transaction.property.myShare.fromDate, MessagesEnum$1.DATE_VALIDATION_ERROR));
|
|
29572
29574
|
}
|
|
29575
|
+
// property income usually comes with fees, add empty control for new transactions
|
|
29573
29576
|
if (!transaction.id && transaction.property && !transaction.transactions.length && transaction.isCredit()) {
|
|
29574
29577
|
this.addTransactionControl();
|
|
29575
29578
|
}
|