For a scipt to calculate an account fee I need to access the accounts (current) balance or better: The balance at the start or end of a given month (for the edge case when a transaction was already made in the new month, before the account fee was processed).
I only found account.getClosedAccountBalances(), but this does not seem to contain a usefule balance? Do I have to use setLastBalanceClosingDate() first to set it to the end of the month to get a new balance? Or do I need an instance of org.cyclos.entities.banking.AccountBalance, if so: how do I get one for the current account?
Also I need to access all transactions for the account, but there seems no method for this on the org.cyclos.entities.banking.UserAccount. So I tried to use TransactionQuery as shown below:
Code: Select all
import org.cyclos.model.banking.transactions.TransactionQuery import org.cyclos.model.users.users.UserVO def trFilter = new TransactionQuery() trFilter.setUser(new UserVO(account.owner.id)) def transactions = transactionService.search(trFilter)
Side question: How can I write log entries from scripts, like progress/debug messages? I've seen no class in https://documentation.cyclos.org/4.13/s ... mmary.html which seems suited for this.
Thanks in advance,