Page 1 of 1

Invalid transactions

Posted: Mon Jul 07, 2014 6:59 pm
by Nikolay
This report should be always empty.
If not there are some problems in DB and it should be fixed.
Invalid Transactions.png
Invalid Transactions.png (11.49 KiB) Viewed 7062 times

Code: Select all

select c.transid, c.transdate, c.notes
    , 'ERROR' as Account
    , 'OK' as category
    ,  p.PayeeName as Payee
    from checkingaccount_v1 c
    inner join payee_v1 p on p.payeeid=c.payeeid
    where c.accountid not in (select accountid from accountlist_v1)
union all
select c.transid, c.transdate, c.notes
    , 'ERROR' as Account
    , 'OK' as category
    ,  '' as Payee
    from checkingaccount_v1 c
    where c.transcode ='Transfer' and c.toaccountid not in (select accountid from accountlist_v1)
union all
select c.transid, c.transdate, c.notes
    , a.AccountName
    , 'OK' 
    ,  'ERROR' 
    from checkingaccount_v1 c
      inner join accountlist_v1 a on a.accountid=c.accountid
    where c.payeeid not in (select payeeid from payee_v1) and transcode!='Transfer'
union all
select c.transid, c.transdate, c.notes
     , a.AccountName
    , 'ERROR'
    ,  p.PayeeName
    from checkingaccount_v1 c
      inner join payee_v1 p on p.payeeid=c.payeeid
      inner join accountlist_v1 a on a.accountid=c.accountid
    where c.categid=-1 and c.transid not in (select transid from splittransactions_v1)
union all
select c.transid, c.transdate, c.notes
     , a.AccountName
    , 'ERROR'
    ,  p.PayeeName
    from checkingaccount_v1 c
      inner join payee_v1 p on p.payeeid=c.payeeid
      inner join accountlist_v1 a on a.accountid=c.accountid
    where c.categid > 0 and c.categid not in (select categid from category_v1)
union all
select c.transid, c.transdate, c.notes
     , a.AccountName
    , 'ERROR'
    ,  p.PayeeName
    from checkingaccount_v1 c
      inner join payee_v1 p on p.payeeid=c.payeeid
      inner join accountlist_v1 a on a.accountid=c.accountid
    where c.categid > 0 and c.subcategid > 0 and c.subcategid not in (select subcategid from subcategory_v1)


Re: Invalid transactions

Posted: Sun Jul 13, 2014 1:43 pm
by Nikolay
DB with invalid transactions sample

Re: Invalid transactions

Posted: Wed Jul 16, 2014 9:23 pm
by miki
I have 3687 operations and 0 error ;) ... this report is empty :!:

Re: Invalid transactions

Posted: Fri Oct 10, 2014 9:46 pm
by msjpham
I ran the report and the results were empty and I am still getting the error message.

Re: Invalid transactions

Posted: Fri Oct 10, 2014 11:03 pm
by Nikolay
msjpham wrote:I ran the report and the results were empty and I am still getting the error message.
what kind of message?

Re: Invalid transactions

Posted: Fri Oct 17, 2014 7:30 am
by guanlisheng
Nikolay, would we post this report to Github ?

Re: Invalid transactions

Posted: Thu Dec 18, 2014 10:56 am
by Nikolay