taxtank-core 2.0.97 → 2.0.98
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 +12 -12
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +6 -6
- package/package.json +1 -1
|
@@ -8668,7 +8668,7 @@ class BudgetRuleItem {
|
|
|
8668
8668
|
if (rule.property) {
|
|
8669
8669
|
transactions = transactions.filterBy('property.id', rule.property.id);
|
|
8670
8670
|
}
|
|
8671
|
-
this.forecast = rule.
|
|
8671
|
+
this.forecast = rule.getCalendarEvents(false).filterByDate(dateFrom, dateTo).amount;
|
|
8672
8672
|
this.transactions = transactions;
|
|
8673
8673
|
this.actual = transactions.sumBy(isGross ? 'grossAmount' : 'amount');
|
|
8674
8674
|
this.variance = this.actual - this.forecast;
|
|
@@ -8804,8 +8804,8 @@ class BudgetRuleCollection extends Collection {
|
|
|
8804
8804
|
const propertyIds = properties.map(property => property.id);
|
|
8805
8805
|
return this.filter(rule => propertyIds.includes(rule.property?.id));
|
|
8806
8806
|
}
|
|
8807
|
-
|
|
8808
|
-
return new MoneyCalendarEventCollection(this.map(rule => rule.
|
|
8807
|
+
getCalendarEvents(inCalendar = true) {
|
|
8808
|
+
return new MoneyCalendarEventCollection(this.map(rule => rule.getCalendarEvents(inCalendar).items).flat());
|
|
8809
8809
|
}
|
|
8810
8810
|
getByMonth(index) {
|
|
8811
8811
|
return new BudgetRuleCollection(this.items.filter(rule => rule.inMonth(index)));
|
|
@@ -8841,8 +8841,8 @@ class BudgetRuleItemCollection extends Collection {
|
|
|
8841
8841
|
get rules() {
|
|
8842
8842
|
return new BudgetRuleCollection(this.mapBy('rule'));
|
|
8843
8843
|
}
|
|
8844
|
-
|
|
8845
|
-
return new MoneyCalendarEventCollection(this.map(item => item.rule.
|
|
8844
|
+
getCalendarEvents(inCalendar = false) {
|
|
8845
|
+
return new MoneyCalendarEventCollection(this.map(item => item.rule.getCalendarEvents(inCalendar).toArray()).flat());
|
|
8846
8846
|
}
|
|
8847
8847
|
onTrack() {
|
|
8848
8848
|
return this.sumBy('variance') >= 0;
|
|
@@ -8857,7 +8857,7 @@ class BudgetRuleItemCollection extends Collection {
|
|
|
8857
8857
|
* @TODO move to property to avoid recalculations?
|
|
8858
8858
|
*/
|
|
8859
8859
|
getForecastByMonth(month) {
|
|
8860
|
-
return this.
|
|
8860
|
+
return this.getCalendarEvents(false).getByMonth(month).amount;
|
|
8861
8861
|
}
|
|
8862
8862
|
/**
|
|
8863
8863
|
* @TODO move to property to avoid recalculations?
|
|
@@ -9965,8 +9965,8 @@ class FinancialGoalCollection extends Collection {
|
|
|
9965
9965
|
// const loan = '';
|
|
9966
9966
|
// });
|
|
9967
9967
|
// }
|
|
9968
|
-
|
|
9969
|
-
return new MoneyCalendarEventCollection(this.map(rule => rule.
|
|
9968
|
+
getCalendarEvents(inCalendar = false) {
|
|
9969
|
+
return new MoneyCalendarEventCollection(this.map(rule => rule.getCalendarEvents(inCalendar).items).flat());
|
|
9970
9970
|
}
|
|
9971
9971
|
}
|
|
9972
9972
|
|
|
@@ -11721,8 +11721,8 @@ class BudgetRule extends BudgetRule$1 {
|
|
|
11721
11721
|
/**
|
|
11722
11722
|
* creates recurring calendar events based on frequency
|
|
11723
11723
|
*/
|
|
11724
|
-
|
|
11725
|
-
if (!this.inCalendar) {
|
|
11724
|
+
getCalendarEvents(inCalendar = true) {
|
|
11725
|
+
if (inCalendar && !this.inCalendar) {
|
|
11726
11726
|
return new MoneyCalendarEventCollection([]);
|
|
11727
11727
|
}
|
|
11728
11728
|
const paymentDates = this.frequency
|
|
@@ -11974,8 +11974,8 @@ class FinancialGoal extends ObservableModel {
|
|
|
11974
11974
|
/**
|
|
11975
11975
|
* creates recurring calendar events based on paymentFrequency
|
|
11976
11976
|
*/
|
|
11977
|
-
|
|
11978
|
-
if (!this.inCalendar || this.isPropertyType()) {
|
|
11977
|
+
getCalendarEvents(inCalendar = false) {
|
|
11978
|
+
if (inCalendar && (!this.inCalendar || this.isPropertyType())) {
|
|
11979
11979
|
return new MoneyCalendarEventCollection([]);
|
|
11980
11980
|
}
|
|
11981
11981
|
const paymentDates = recurringDates(this.paymentFrequency, this.startDate, this.endDate);
|