diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d88df512b8cb5665ce625cfd46e18c644e46f7cf..f008a37a80572fd2c2168c68b885cb2625d3844b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -189,7 +189,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; $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, 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_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; $tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; @@ -300,7 +300,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country"; $tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldvalue[31]= "pcg_version,country,label"; -$tabfieldvalue[32]= "code,label,range,position,country"; +$tabfieldvalue[32]= "code,label,range_account,position,country"; $tabfieldvalue[33]= "code,label"; $tabfieldvalue[34]= "code,label"; @@ -337,7 +337,7 @@ $tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country"; $tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; $tabfieldinsert[31]= "pcg_version,fk_pays,label"; -$tabfieldinsert[32]= "code,label,range,position,fk_country"; +$tabfieldinsert[32]= "code,label,range_account,position,fk_country"; $tabfieldinsert[33]= "code,label"; $tabfieldinsert[34]= "code,label"; @@ -998,7 +998,7 @@ if ($id) if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='range') { $valuetoshow=$langs->trans("Range"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } if ($id == 2) // Special cas for state page { @@ -1166,7 +1166,7 @@ if ($id) if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='range') { $valuetoshow=$langs->trans("Range"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } // Affiche nom du champ if ($showfield) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index e8664e3166d01f7cd9929c6a3a5e1697ea0ef57b..4a76cca81d691522e204e5faf7f9276af2d0eba8 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -64,7 +64,7 @@ class FormAccounting if (! empty($mysoc->country_id)) { - $sql = "SELECT c.rowid, c.label as type, c.range"; + $sql = "SELECT c.rowid, c.label as type, c.range_account"; $sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; $sql.= " WHERE c.active = 1"; $sql.= " AND c.fk_country = ".$mysoc->country_id; @@ -72,7 +72,7 @@ class FormAccounting } else { - $sql = "SELECT c.rowid, c.label as type, c.range"; + $sql = "SELECT c.rowid, c.label as type, c.range_account"; $sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c, ".MAIN_DB_PREFIX."c_country as co"; $sql.= " WHERE c.active = 1 AND c.fk_country = co.rowid"; $sql.= " AND co.code = '".$mysoc->country_code."'"; @@ -96,7 +96,7 @@ class FormAccounting print '<option value="'.$obj->rowid.'"'; if ($obj->rowid == $selected) print ' selected'; print '>'.dol_trunc($obj->type,$maxlen); - print ' ('.$obj->range.')'; + print ' ('.$obj->range_account.')'; $i++; } print '</select>'; diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index b0e42872772ad4a1d238faff70f9c1e7c76c5297..7fe1deb3742c0185a11d5a7efb1ac3ae50f264b7 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -332,13 +332,13 @@ DELETE FROM llx_menu where module='expensereport'; ALTER TABLE llx_accounting_account ADD COLUMN fk_accounting_category integer DEFAULT 0 after label; CREATE TABLE llx_c_accounting_category ( - rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, - code varchar(16) NOT NULL, - label varchar(255) NOT NULL, - range varchar(255) NOT NULL, - position integer DEFAULT 0, - fk_country integer DEFAULT NULL, -- This category is dedicated to a country - active integer DEFAULT 1 + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + code varchar(16) NOT NULL, + label varchar(255) NOT NULL, + range_account varchar(255) NOT NULL, + position integer DEFAULT 0, + fk_country integer DEFAULT NULL, -- This category is dedicated to a country + active integer DEFAULT 1 ) ENGINE=innodb; ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code); diff --git a/htdocs/install/mysql/tables/llx_c_accounting_category.sql b/htdocs/install/mysql/tables/llx_c_accounting_category.sql index 0e789a6826cc0981667c27c66124743e818e4afc..9024284f1225422f499f4fbbe20fe1c20ac6f1be 100644 --- a/htdocs/install/mysql/tables/llx_c_accounting_category.sql +++ b/htdocs/install/mysql/tables/llx_c_accounting_category.sql @@ -18,11 +18,11 @@ -- =================================================================== CREATE TABLE llx_c_accounting_category ( - rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, - code varchar(16) NOT NULL, - label varchar(255) NOT NULL, - range varchar(255) NOT NULL, - position integer DEFAULT 0, - fk_country integer DEFAULT NULL, -- This category is dedicated to a country - active integer DEFAULT 1 + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + code varchar(16) NOT NULL, + label varchar(255) NOT NULL, + range_account varchar(255) NOT NULL, + position integer DEFAULT 0, + fk_country integer DEFAULT NULL, -- This category is dedicated to a country + active integer DEFAULT 1 ) ENGINE=innodb;