$tabsql[31]="SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
$tabsql[32]="SELECT a.rowid as rowid, a.code as code, a.label AS label, a.range AS range, a.position, a.fk_country as country_id, a.active FROM ".MAIN_DB_PREFIX."c_accountancy_category AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid";
$tabsql[32]="SELECT a.rowid as rowid, a.code as code, a.label, a.range, a.position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accountancy_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
@@ -556,7 +557,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach($listfieldas$f=>$value)
{
if($value=='country_id'&&in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp')))continue;// For some pages, country is not mandatory
if($value=='country_id'&&in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory')))continue;// For some pages, country is not mandatory
if($value=='country'&&in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp')))continue;// For some pages, country is not mandatory