diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a955d671475f4f33a1a0d5988684a49f28b8aab6..369dd7afcec88bf1688aedec73d5a2d2d0b1e469 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -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', diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 3ad3721c9d4b5d893efe3ecf64b851843c992521..f3db577778363ac45f5259cc98a6630c36564e88 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -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; - } - } }