taxtank-core 2.0.81 → 2.0.83
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 +16 -1
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -8632,7 +8632,18 @@ class BudgetRuleItem {
|
|
|
8632
8632
|
this.tankType = TankTypeEnum[rule.chartAccounts.tankType];
|
|
8633
8633
|
this.frequency = DailyFrequencyEnum[rule.frequency] ?? 'Once';
|
|
8634
8634
|
this.forecast = rule.amount;
|
|
8635
|
+
if (rule.business) {
|
|
8636
|
+
transactions = transactions.filterBy('business.id', rule.business.id);
|
|
8637
|
+
}
|
|
8638
|
+
if (rule.incomeSource) {
|
|
8639
|
+
transactions = transactions.filterBy('incomeSource.id', rule.incomeSource.id);
|
|
8640
|
+
}
|
|
8641
|
+
if (rule.property) {
|
|
8642
|
+
transactions = transactions.filterBy('property.id', rule.property.id);
|
|
8643
|
+
}
|
|
8635
8644
|
this.actual = Math.abs(transactions.sumBy('amount'));
|
|
8645
|
+
this.startDate = rule.startDate;
|
|
8646
|
+
this.endDate = rule.endDate;
|
|
8636
8647
|
}
|
|
8637
8648
|
}
|
|
8638
8649
|
|
|
@@ -9404,6 +9415,10 @@ class BudgetRuleCollection extends Collection {
|
|
|
9404
9415
|
getByMonth(index) {
|
|
9405
9416
|
return new BudgetRuleCollection(this.items.filter(rule => rule.inMonth(index)));
|
|
9406
9417
|
}
|
|
9418
|
+
getByChartAccountsName(name) {
|
|
9419
|
+
const searchQuery = name.toLowerCase().trim();
|
|
9420
|
+
return this.filter(rule => rule.chartAccounts.name.toLowerCase().includes(searchQuery));
|
|
9421
|
+
}
|
|
9407
9422
|
}
|
|
9408
9423
|
|
|
9409
9424
|
class AllocationGroupCollection extends Collection {
|
|
@@ -23642,7 +23657,7 @@ class BudgetRuleForm extends AbstractForm {
|
|
|
23642
23657
|
inCalendar: new FormControl(rule.inCalendar),
|
|
23643
23658
|
frequency: new FormControl(rule.frequency),
|
|
23644
23659
|
description: new FormControl(rule.description),
|
|
23645
|
-
bankAccount: new FormControl(rule.
|
|
23660
|
+
bankAccount: new FormControl(rule.bankAccount, conditionalValidator(() => !!this.value.inCalendar, Validators.required)),
|
|
23646
23661
|
property: new FormControl(rule.property, conditionalValidator(() => this.value.tankType === TankTypeEnum.PROPERTY, Validators.required)),
|
|
23647
23662
|
business: new FormControl(rule.business, conditionalValidator(() => this.value.tankType === TankTypeEnum.SOLE, Validators.required)),
|
|
23648
23663
|
incomeSource: new FormControl(rule.incomeSource, conditionalValidator(() => this.value.chartAccounts?.isWorkIncome(), Validators.required)),
|