webERP Forum
Credit_Invoice.php Issue - Printable Version

+- webERP Forum (
+-- Forum: webERP Discussion (
+--- Forum: Problems / Bugs? (
+--- Thread: Credit_Invoice.php Issue (/showthread.php?tid=2474)

Credit_Invoice.php Issue - jhm12698 - 05-30-2015

I am trying to credit an invoice and am getting the following error message:

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 (`jhm2`.`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('64', '', '0')
Database Rollback Due to Error Above : Rolling Back Transaction OK

As far as I can see I have everything set up from a tax standpoint. Everything I have currently is exempt. Please help with what I'm missing.

RE: Credit_Invoice.php Issue - jhm12698 - 05-30-2015

If it helps I think started when I upgraded from 4.12.2 to 4.12.3. I know I did credits previously without issue.

RE: Credit_Invoice.php Issue - jhm12698 - 05-31-2015

I somewhat figured out the problem. The calculationorder in the taxgrouptaxes was set to 0. Even when I went into TaxGroups.php and updated the order as 1 it stayed at zero in the table. Once I added another Assigned Tax Group, updated the order and then deleted one did it set the calculationorder to 1. Having an order of 0 doesn't appear to affect creating an invoice but does when creating a credit.