Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyforecast.h
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 58 | public: | |||
---|---|---|---|---|---|
85 | */ | 85 | */ | ||
86 | QList<MyMoneyAccount> accountList(); | 86 | QList<MyMoneyAccount> accountList(); | ||
87 | 87 | | |||
88 | /** | 88 | /** | ||
89 | * Returns the balance trend for account @a acc based on a number of days @p forecastDays | 89 | * Returns the balance trend for account @a acc based on a number of days @p forecastDays | ||
90 | * Collects and processes all transactions in the past for the | 90 | * Collects and processes all transactions in the past for the | ||
91 | * same period of forecast and calculates the balance trend | 91 | * same period of forecast and calculates the balance trend | ||
92 | */ | 92 | */ | ||
93 | static MyMoneyMoney calculateAccountTrend(const MyMoneyAccount& acc, int forecastDays); | 93 | static MyMoneyMoney calculateAccountTrend(const MyMoneyAccount& acc, qint64 forecastDays); | ||
94 | 94 | | |||
95 | /** | 95 | /** | ||
96 | * Returns the forecast balance trend for account @a acc for day @p QDate | 96 | * Returns the forecast balance trend for account @a acc for day @p QDate | ||
97 | */ | 97 | */ | ||
98 | MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, const QDate &forecastDate); | 98 | MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, const QDate &forecastDate); | ||
99 | 99 | | |||
100 | /** | 100 | /** | ||
101 | * Returns the forecast balance trend for account @a acc for offset @p int | 101 | * Returns the forecast balance trend for account @a acc for offset @p int | ||
102 | * offset is days from current date, inside forecast days. | 102 | * offset is days from current date, inside forecast days. | ||
103 | * Returns 0 if offset not in range of forecast days. | 103 | * Returns 0 if offset not in range of forecast days. | ||
104 | */ | 104 | */ | ||
105 | MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, int offset); | 105 | MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, qint64 offset); | ||
106 | 106 | | |||
107 | /** | 107 | /** | ||
108 | * Returns true if an account @a acc is an account to be forecast | 108 | * Returns true if an account @a acc is an account to be forecast | ||
109 | */ | 109 | */ | ||
110 | bool isForecastAccount(const MyMoneyAccount& acc); | 110 | bool isForecastAccount(const MyMoneyAccount& acc); | ||
111 | 111 | | |||
112 | /** | 112 | /** | ||
113 | * returns the number of days when a given account is forecast to be below minimum balance | 113 | * returns the number of days when a given account is forecast to be below minimum balance | ||
114 | * returns -1 if it will not be below minimum balance in the forecast period | 114 | * returns -1 if it will not be below minimum balance in the forecast period | ||
115 | */ | 115 | */ | ||
116 | int daysToMinimumBalance(const MyMoneyAccount& acc); | 116 | qint64 daysToMinimumBalance(const MyMoneyAccount& acc); | ||
117 | 117 | | |||
118 | /** | 118 | /** | ||
119 | * returns the number of days when a given account is forecast to be below zero if it is an asset accounts | 119 | * returns the number of days when a given account is forecast to be below zero if it is an asset accounts | ||
120 | * or above zero if it is a liability account | 120 | * or above zero if it is a liability account | ||
121 | * returns -1 if it will not happen in the forecast period | 121 | * returns -1 if it will not happen in the forecast period | ||
122 | */ | 122 | */ | ||
123 | int daysToZeroBalance(const MyMoneyAccount& acc); | 123 | qint64 daysToZeroBalance(const MyMoneyAccount& acc); | ||
124 | 124 | | |||
125 | /** | 125 | /** | ||
126 | * amount of variation of a given account in one cycle | 126 | * amount of variation of a given account in one cycle | ||
127 | */ | 127 | */ | ||
128 | MyMoneyMoney accountCycleVariation(const MyMoneyAccount& acc); | 128 | MyMoneyMoney accountCycleVariation(const MyMoneyAccount& acc); | ||
129 | 129 | | |||
130 | /** | 130 | /** | ||
131 | * amount of variation of a given account for the whole forecast period | 131 | * amount of variation of a given account for the whole forecast period | ||
Show All 18 Lines | |||||
150 | /** | 150 | /** | ||
151 | * creates a budget based on the history of a given timeframe | 151 | * creates a budget based on the history of a given timeframe | ||
152 | */ | 152 | */ | ||
153 | void createBudget(MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget); | 153 | void createBudget(MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget); | ||
154 | 154 | | |||
155 | /** | 155 | /** | ||
156 | * number of days to go back in history to calculate forecast | 156 | * number of days to go back in history to calculate forecast | ||
157 | */ | 157 | */ | ||
158 | int historyDays() const; | 158 | qint64 historyDays() const; | ||
159 | 159 | | |||
160 | void setAccountsCycle(int accountsCycle); | 160 | void setAccountsCycle(qint64 accountsCycle); | ||
161 | void setForecastCycles(int forecastCycles); | 161 | void setForecastCycles(qint64 forecastCycles); | ||
162 | void setForecastDays(int forecastDays); | 162 | void setForecastDays(qint64 forecastDays); | ||
163 | void setBeginForecastDate(const QDate &beginForecastDate); | 163 | void setBeginForecastDate(const QDate &beginForecastDate); | ||
164 | void setBeginForecastDay(int beginDay); | 164 | void setBeginForecastDay(qint64 beginDay); | ||
165 | void setForecastMethod(int forecastMethod); | 165 | void setForecastMethod(qint64 forecastMethod); | ||
166 | void setHistoryStartDate(const QDate &historyStartDate); | 166 | void setHistoryStartDate(const QDate &historyStartDate); | ||
167 | void setHistoryEndDate(const QDate &historyEndDate); | 167 | void setHistoryEndDate(const QDate &historyEndDate); | ||
168 | void setHistoryStartDate(int daysToStartDate); | 168 | void setHistoryStartDate(qint64 daysToStartDate); | ||
169 | void setHistoryEndDate(int daysToEndDate); | 169 | void setHistoryEndDate(qint64 daysToEndDate); | ||
170 | void setForecastStartDate(const QDate &_startDate); | 170 | void setForecastStartDate(const QDate &_startDate); | ||
171 | void setForecastEndDate(const QDate &_endDate); | 171 | void setForecastEndDate(const QDate &_endDate); | ||
172 | void setSkipOpeningDate(bool _skip); | 172 | void setSkipOpeningDate(bool _skip); | ||
173 | void setHistoryMethod(int historyMethod); | 173 | void setHistoryMethod(int historyMethod); | ||
174 | void setIncludeUnusedAccounts(bool _bool); | 174 | void setIncludeUnusedAccounts(bool _bool); | ||
175 | void setForecastDone(bool _bool); | 175 | void setForecastDone(bool _bool); | ||
176 | void setIncludeFutureTransactions(bool _bool); | 176 | void setIncludeFutureTransactions(bool _bool); | ||
177 | void setIncludeScheduledTransactions(bool _bool); | 177 | void setIncludeScheduledTransactions(bool _bool); | ||
178 | int accountsCycle() const; | 178 | qint64 accountsCycle() const; | ||
179 | int forecastCycles() const; | 179 | qint64 forecastCycles() const; | ||
180 | int forecastDays() const; | 180 | qint64 forecastDays() const; | ||
181 | QDate beginForecastDate() const; | 181 | QDate beginForecastDate() const; | ||
182 | int beginForecastDay() const; | 182 | qint64 beginForecastDay() const; | ||
183 | QDate historyStartDate() const; | 183 | QDate historyStartDate() const; | ||
184 | QDate historyEndDate() const; | 184 | QDate historyEndDate() const; | ||
185 | QDate forecastStartDate() const; | 185 | QDate forecastStartDate() const; | ||
186 | QDate forecastEndDate() const; | 186 | QDate forecastEndDate() const; | ||
187 | bool skipOpeningDate() const; | 187 | bool skipOpeningDate() const; | ||
188 | int historyMethod() const; | 188 | int historyMethod() const; | ||
189 | bool isIncludingUnusedAccounts() const; | 189 | bool isIncludingUnusedAccounts() const; | ||
190 | bool isForecastDone() const; | 190 | bool isForecastDone() const; | ||
Show All 28 Lines |