Skip to content
Snippets Groups Projects
Commit e4f5d45c authored by Alexandre SPANGARO's avatar Alexandre SPANGARO
Browse files

Remove old code (selectjournal_accountancy_bookkepping)

parent 1f079fac
No related branches found
No related tags found
No related merge requests found
......@@ -322,7 +322,7 @@ if ($action == 'delbookkeepingyear') {
$delyear = dol_print_date(dol_now(), '%Y');
}
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
$journal_array = $formaccounting->selectjournal_accountancy_bookkepping($deljournal, 'deljournal', 0, 'array');
$journal_array = $formaccounting->selectjournal($deljournal, 'deljournal', '', 1, 'array', 1, 1);
$form_question['delyear'] = array (
'name' => 'delyear',
......
......@@ -426,44 +426,5 @@ class FormAccounting extends Form
return $out_array;
}
}
/**
* Return HTML combo list of years existing into book keepping
*
* @param string $selected Preselected value
* @param string $htmlname Name of HTML select object
* @param int $useempty Affiche valeur vide dans liste
* @param string $output_format Html/option (for option html only)/array (to return options arrays
* @return string/array
*/
function selectjournal_accountancy_bookkepping($selected = '', $htmlname = 'journalid', $useempty = 0, $output_format = 'html')
{
global $conf,$langs;
$out_array = array();
$sql = "SELECT DISTINCT code_journal";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
$sql .= " ORDER BY code_journal";
dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$this->error = "Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::".__METHOD__.$this->error, LOG_ERR);
return -1;
}
while ($obj = $this->db->fetch_object($resql)) {
$out_array[$obj->code_journal] = $obj->code_journal?$obj->code_journal:$langs->trans("NotDefined"); // TODO Not defined is accepted ? We should avoid this, shouldn't we ?
}
$this->db->free($resql);
if ($output_format == 'html') {
return Form::selectarray($htmlname, $out_array, $selected, $useempty, 0, 0, 'placeholder="aa"');
} else {
return $out_array;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment