webERP Forum

Full Version: Database Error entering Credit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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).
Reference URL's