[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some consistency issues





On Dec 18, 2007 3:30 PM, The Anarcat <..hidden..> wrote:
We have lived for various periods with transaction reversal NOT enforced
here, and it probably had impact on the database sanity. I worked with
Chris Travers to try to reverse some of the obvious damage (that would
appear in conciliation statements, for example), but I think some
remain.

Could anyone confirm that this request should lead *no* results on a
consistent database?

select * from acc_trans WHERE trans_id NOT IN (SELECT id FROM
transactions UNION ALL SELECT id from ap UNION ALL SELECT id from ar
UNION ALL SELECT id FROM oe UNION ALL SELECT id from invoice) order by
transdate;

Try:

SELECT * from acc_trans WHERE trans_id NOT IN
(select id from ar UNION select id from ap UNION select id from gl)
ORDER BY transdate;

the transactions table in 1.2.x is not as useful as it might be.  this is fixed in /trunk but due to the difficulties in dealing with the existing db structure, you are better off checking the financial tables directly.


Basically, another way to ask the question is: what does the trans_id
column refer to? I thought it was to the id columns in the ap/ar or
transactions tables, but here it seems I have 959 rows that do not refer
to anything at all.

What about the gl table?


Thanks for the input,

--
We are discreet sheep; we wait to see how the drove is going, and then go
with the drove.
                       - Mark Twain

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHaFgzWGBzs0AjcC8RArMgAKCJcu76oV564NsE6MKyTn7j7fe8SwCfc9BC
vFmka36Xt8ddaBfy01kMjM8=
=ruYL
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel