Skip to content

Commit

Permalink
Uniformize name of table
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Mar 28, 2016
1 parent 432cc44 commit 436fb91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions htdocs/accountancy/class/accountingaccount.class.php
Expand Up @@ -69,16 +69,16 @@ function fetch($rowid = null, $account_number = null, $limittocurentchart = 0) {

if ($rowid || $account_number) {
$sql = "SELECT a.rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.pcg_subtype, a.account_number, a.account_parent, a.label, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active";
$sql .= ", ac.label as category_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a, ".MAIN_DB_PREFIX."c_accounting_category as ac";
$sql .= " WHERE a.fk_accounting_category = ac.rowid";
$sql .= ", ac.rowid, ac.label as category_label";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a, " . MAIN_DB_PREFIX . "c_accounting_category as ac";
$sql .= " WHERE ";
if ($rowid) {
$sql .= " AND rowid = '" . $rowid . "'";
$sql .= " a.rowid = '" . $rowid . "'";
} elseif ($account_number) {
$sql .= " AND account_number = '" . $account_number . "'";
$sql .= " a.account_number = '" . $account_number . "'";
}
if (! empty($limittocurentchart)) {
$sql .= ' AND fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$sql .= ' AND a.fk_pcg_version IN (SELECT a.pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system as as WHERE as.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/dict.php
Expand Up @@ -80,7 +80,7 @@
// Put here declaration of dictionaries properties

// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,0);
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);

// Name of SQL tables of dictionaries
$tabname=array();
Expand Down Expand Up @@ -115,7 +115,7 @@
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
$tabname[30]= MAIN_DB_PREFIX."c_format_cards";
$tabname[31]= MAIN_DB_PREFIX."accounting_system";
$tabname[32]= MAIN_DB_PREFIX."c_accountancy_category";
$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
$tabname[33]= MAIN_DB_PREFIX."c_hrm_department";
$tabname[34]= MAIN_DB_PREFIX."c_hrm_function";

Expand Down Expand Up @@ -189,7 +189,7 @@
$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_accountancy_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, 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";

Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formaccounting.class.php
Expand Up @@ -65,15 +65,15 @@ function select_accounting_category($selected='',$htmlname='actioncode', $useemp
if (! empty($mysoc->country_id))
{
$sql = "SELECT c.rowid, c.label as type, c.range";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accountancy_category as c";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
$sql.= " WHERE c.active = 1";
$sql.= " AND c.fk_country = ".$mysoc->country_id;
$sql.= " ORDER BY c.label ASC";
}
else
{
$sql = "SELECT c.rowid, c.label as type, c.range";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accountancy_category, ".MAIN_DB_PREFIX."c_country as co";
$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."'";
$sql.= " ORDER BY c.label ASC";
Expand Down

0 comments on commit 436fb91

Please sign in to comment.