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

Re: NaN, AP account credited twice after trying to correct wrong 'Payment' entry

On Wed, Dec 12, 2012 at 6:49 PM, ario <..hidden..> wrote:
Hi (Chris),

not so long ago there was an issue with 'NaN' in the amount field, where
the source field contained the amount. This was supposed to be solved by
issuing the psql statements:

SELECT trans_id FROM acc_trans WHERE source = '1,893.00';

to find the affected trans_id which turned out to be 15956, and

UPDATE acc_trans SET amount = 1893 WHERE amount = 'NaN' AND trans_id =

to fix the wrong entry.
However, after doing this, the AP account (2100) wasn't balanced: The
'purchases account (5010) is debited, the cash account (1010) is
credited, which both seem to be right, but the Accounts Payable account
(2100) is credited twice.
Should the AP account not be credited once and debited once to reflect
the completed payment?
And how would I correct that with a psql statement?

can you send me:

SELECT * FROM acc_trans WHERE trans_id = 15956 ORDER BY entry_id

My thinking is from what you say that is right, but let's identify the row, then you can switch from credit to debit by:

If it is the AP account, it should be a debit on the payment not a credit.

UPDATE acc_trans SET amount = -1 * amount WHERE entry_id = ....

Best Wishes,
Chris Travers 


A screenshot of the record can be found here:

LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
Ledger-smb-users mailing list