Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Error entering Credit
10-16-2015, 10:34 AM,
Database Error entering Credit
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
10-16-2015, 12:15 PM, (This post was last modified: 10-16-2015, 04:29 PM by M Watson.)
RE: Database Error entering Credit
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).

Forum Jump:

Users browsing this thread: 1 Guest(s)