AccountFee script cannot fetch transfer history

Bug and problem reporting on Cyclos 4 version

Moderators: rmvanarkel, hugo, alexandre

Post Reply
jakob.schumann
Posts: 27
Joined: Thu Apr 23, 2020 5:37 pm

AccountFee script cannot fetch transfer history

Post by jakob.schumann »

#######################################################

Major Bug report
-------------------------------------------------------
Cyclos version: 4.14.5
Project: Scripting
User: Admin
Menu: Banking > Account Fees > manual execution
Installation(s): Installation on own server
-------------------------------------------------------
Description:
Im using the following code within an account fee script:

Code: Select all

println "accountid"
println account.id
def transferQuery = new AccountHistoryQuery(
  account: [account.id],
  period: [ 
    begin: startDate,
    end: endDate
  ]
)
def transferHistory = accountService.searchAccountHistory(transferQuery)
println "length"
println transferHistory.size() 
But this outputs "0" for every account the script processes, I checked start + end date and that there are indeed transfers in that period.
Using the same code in a custom operation script (for testing purposes) correctly prints the expected number of transfers in the log.

What is the difference here? Do I need another "accountService" instance? Do I need to initialize it?

Thanks in advance; Jakob
-------------------------------------------------------
Error log:
When called from the account fee script:
[2021-07-09 19:16:29] [info] accountid
[2021-07-09 19:16:29] [info] 100
[2021-07-09 19:16:29] [info] length
[2021-07-09 19:16:29] [info] 0

When called from the custom operation script:
[2021-07-09 19:27:31] [info] accountid
[2021-07-09 19:27:31] [info] 100
[2021-07-09 19:27:31] [info] length
[2021-07-09 19:27:31] [info] 2

#######################################################
alexandre
Posts: 969
Joined: Wed Sep 06, 2006 9:06 am

Re: AccountFee script cannot fetch transfer history

Post by alexandre »

Hi,

It was due to a bug that were already resolved.
If you update to the latest version it should work.

regards
Alexandre Caurrinhos
Cyclos development team.
admin_de2
Posts: 107
Joined: Wed Dec 31, 1969 9:00 pm

Re: AccountFee script cannot fetch transfer history

Post by admin_de2 »

Hi Alexandre,
which version do you exactly mean?
Thx, Thomas
alexandre
Posts: 969
Joined: Wed Sep 06, 2006 9:06 am

Re: AccountFee script cannot fetch transfer history

Post by alexandre »

Hi,

Update to the latest cyclos version.
4.14.12
This way you will get all fixes.

Regards
Alexandre Caurrinhos
Cyclos development team.
Post Reply