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

Re: AP Invoice deletion/update clean up



thanks Chris will run some test this evening.


Chris Travers wrote:


On Dec 2, 2007 11:15 PM, Mark Clarke <..hidden.. <mailto:..hidden..>> wrote:

    Hi all,

    I don't know about others but the various bugs in ledger-smb have
    caused
    the system to go out of balance. Often the total per a chart
    account does
    not agree to the detail underlying the account. i.e if one looks
    at the
    balance on  the TB and then drills down to the detail the account
    amounts
    are different.


There were some bugs early in the 1.2.x series which could cause this because part of a transaction would roll back. To my knowledge these have all been fixed for some time, but if you are still seeing new instances, we need to track them down as any such bugs are considered serious.


    In my case this was caused by the often reported problem with AP
    Vendor
    Invoice deletions or editing and reposting of AP invoices. It
    seems this
    is still not fixed. Here is what I do to get things back in
    balance. (I
    hope I am not making things worse!)

    Please backup your database and test this first. Let me know if I am
    missing something.

    1) First you need to find the transactions in acc_trans which are
    supposed
    to be AP transaction but have no corresponding entries in the ap
    table. I
    don't have a copy of the query I ran now but it should be
    something like

    Select tran_id from acc_trans
    left join ap on acc_trans.trans_id = ap.trans_id
    where chart_id = (id for purchase account from chart table) where
    invoiceid is not null and ap.id <http://ap.id> is null

    This should give you all AP entries in acc_trans not in ap.



I would do it differently:
SELECT trans_id FROM acc_trans WHERE trans_id NOT IN
(SELECT id FROM ap
UNION
SELECT id FROM ar
UNION
SELECT id FROM gl
)
GROUP BY trans_id;

Your way may cause issues if GL entries hit the AP account.
Also you can try the same with invoice (with just the ap and ar tables)

I would also do a SELECT INTO before doing the delete. This way if you need to check on some data later, the data is still there.,

Best Wishes,
Chris Travers
------------------------------------------------------------------------

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
------------------------------------------------------------------------

_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users

===========================================
Cyber Connect - More than just broadband
http://www.CyberConnect.co.za - Vodacom 3G R99/month

Cyber Designs - Put your business on the net
http://www.CyberDesigns.co.za

Jumping Bean - Your Java and Linux Experts
http://www.JumpingBean.co.za

Tel: 011-781 80 14
Fax: 011-781 80 15
===========================================
Disclaimer

Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.