1 (edited by msmith 03/21/2013 12:45:51 pm)

Topic: DATABASE ERROR : FATAL : duplicate purchase order found

Hi, today I deleted an incorrect Purchase order that had been incorrectly made in the past. This PO was making an inventory item have a quantity of 1 in the "on order" column which was incorrect.

When I deleted it I got a blank page with a duplicate sql error on it.

When checking other purchase orders something strange has happened because now I get a red FA warning indicating:

<< DATABASE ERROR : FATAL : duplicate purchase order found
sql that failed was : >> (There is no indication to where the error is)

I've looked at the Database, but doesn't seem to be anything strange (duplicates or same codede PO's) in the purch_orders table....

Please any help will be appreciated !!

Re: DATABASE ERROR : FATAL : duplicate purchase order found

I think I have fixed the problem. Somehow although the order had been deleted there were still remnants of it in the grn_batch, grn_data & purch_data tables which I deleted. This has seemed to do the trick.

Re: DATABASE ERROR : FATAL : duplicate purchase order found

Did you delete the purchase order through SQL? I think that voiding the transaction would likely be a better move than trying to delete the purchase order through PHPMyAdmin or something similar.

Re: DATABASE ERROR : FATAL : duplicate purchase order found

Yes, sure. To avoid database inconsistency, transactions should be voided in FA. Direct intervention in db shoul;d be considered last resort, when your  database is inconsistent due to some real bug in FA.

Janusz

Re: DATABASE ERROR : FATAL : duplicate purchase order found

All this happened without touching the DB.

I went into the DB afterwards, just to delete the inconsistencies that had been left over and that were causing this error... It must be a bug or in any case misuse of the tool, but it shouldn't leave inconsistencies like it did...

Re: DATABASE ERROR : FATAL : duplicate purchase order found

Ok, then it would be good to reproduce the conditions leading to this problem. This would help find the bug.
Janusz