tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2248-budgetcalculateInfinite Kind: Discussion 2019-03-08T10:10:25Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/466315352018-12-07T10:03:36Z2018-12-07T10:03:36ZBudget.calculate<div><p>I'm trying to write a small extension that requires data about budgeted and actual amounts of several categories. Looking through the documentation, I assumed the Budget.calculate method would do the work of calculating actual amounts based on transactions and returning that information. However, it seems to always return nothing. I have the following minimal Python repro:</p>
<p>from com.infinitekind.moneydance.model import *<br>
from com.moneydance.apps.md.controller import *<br>
from java.util import Date<br>
budget = moneydance_data.getBudgets().findCurrentBudget()<br>
start = Util.convertDateToInt(Date(2018,1,1))<br>
end = Util.convertDateToInt(Date(2018,12,31))<br>
items = budget.calculate(start, end, True, True)<br>
print(items.getActualExpensesList())</p>
<p>This results in printing an empty list. I checked and the budget returned is the expected one (2018) which does have several categories and is being tracked correctly in the UI. I can get the budget items from the budget and they contain data as expected. It's only the call to calculate that presents this problem.</p>
<p>Any idea about what might be going on?</p></div>jrcalzada