From a0c7c6bad961136e789b282a19ee461ea3019fac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Mar 2021 10:45:01 +0100 Subject: [PATCH] Fix selection of accounting account --- htdocs/accountancy/admin/account.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 47a984cd467..ca5c10ec63d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -131,6 +131,7 @@ if (empty($reshook)) // and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value. // This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used. $tmp = file_get_contents($sqlfile); + $reg = array(); if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg)) { $offsetforchartofaccount += $reg[1]; @@ -302,7 +303,7 @@ if ($resql) // Box to select active chart of account print $langs->trans("Selectchartofaccounts")." : "; - print ''; $sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_system as a"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country = c.rowid AND c.active = 1"; @@ -313,6 +314,7 @@ if ($resql) if ($resqlchart) { $numbis = $db->num_rows($resqlchart); $i = 0; + print ''; while ($i < $numbis) { $obj = $db->fetch_object($resqlchart);