webERP Forum
Database Error entering Credit - Printable Version

+- webERP Forum (
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Database Error entering Credit (/showthread.php?tid=2592)

Database Error entering Credit - M Watson - 10-16-2015 10:34 AM

Received this error when processing a credit against a customer invoice.

Database Error 1452 : CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE: The debtor transaction taxes records could not be inserted because
Cannot add or update a child row: a foreign key constraint fails (`bmba`.`debtortranstaxes`, CONSTRAINT `debtortranstaxes_ibfk_1` FOREIGN KEY (`taxauthid`) REFERENCES `taxauthorities` (`taxid`))
Database SQL Failure : The following SQL to insert the debtor transaction taxes record was used
INSERT INTO debtortranstaxes( debtortransid, taxauthid, taxamount) VALUES('47', '', '-1.818')
Database Rollback Due to Error Above : Rolling Back Transaction OK

RE: Database Error entering Credit - M Watson - 10-16-2015 12:15 PM

Seems to be a bug in Credit_Invoice.php where it tries to insert data into debtortranstaxes without a valid taxauthid. It tries to insert to records, the first record is correct, but the second record has the same debtortransid and taxamount, but taxauthid is NULL.

When you press UPDATE button prior to processing credit, it display an extra TAX line on screen, and incorrectly adjust the totals (with the additional Tax).