moneymanagerex / general-reports

Bunch of general reports for Money Manager Ex
http://moneymanagerex.org/
MIT License
76 stars 47 forks source link

Account Summary Report #57

Closed petubl closed 5 years ago

petubl commented 5 years ago

Hello I just managed to update my database to version 13, in order to be able to use Vomikan's modified version of the Account Summary report, so that i can print it for a specific date. Its the file contained in this issue thread: https://github.com/moneymanagerex/general-reports/issues/42

After changing all references to tables with "_V1" by removing the V1 (none of my tables has V1 in the name) and all references to currencies which was causing the report to fail (I only use euros), I managed to get the report to run, and return two columns - the account name and the balance.

However, in some cases, actually on every other line, rather than get a balance to 2 decimal places i get a balance of many decimal places like, 14.7599999999899 (instead of 14.76) OR 5.51381162949838e-12 instead of 0.00

The graph does not work either , but that does not bother me. I just need to be able to enter a specific date and know what the balance was on each of my accounts.

Here is what my edit SQL code says. I dont know anything about SQL, so i would be grateful if someone could help out.

with b as (select ACCOUNTID, STATUS, TRANSDATE,
            (case when TRANSCODE = 'Deposit' then TRANSAMOUNT else -TRANSAMOUNT end) as TRANSAMOUNT
        from CHECKINGACCOUNT
        union all
        select TOACCOUNTID, STATUS, TRANSDATE, TOTRANSAMOUNT 
        from CHECKINGACCOUNT
        where TRANSCODE = 'Transfer') 
select a.ACCOUNTNAME, 
    total(b.TRANSAMOUNT) + a.INITIALBAL as Balance 
from ACCOUNTLIST as a, b
inner join CURRENCYFORMATS as c on c.CURRENCYID = a.CURRENCYID
where a.ACCOUNTTYPE  not in ('Investment') 
and a.STATUS = 'Open' and b.STATUS <>'V'
and a.ACCOUNTID=b.ACCOUNTID
and b.TRANSDATE <='&single_date'
group by a.ACCOUNTNAME
order by a.ACCOUNTNAME asc;

Thanks for any help you can provide guys!

vomikan commented 5 years ago

https://github.com/moneymanagerex/general-reports/issues/42