Remove old code (selectjournal_accountancy_bookkepping)
This commit is contained in:
parent
1f079fac9d
commit
e4f5d45c45
@ -322,7 +322,7 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
$delyear = dol_print_date(dol_now(), '%Y');
|
$delyear = dol_print_date(dol_now(), '%Y');
|
||||||
}
|
}
|
||||||
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
$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 (
|
$form_question['delyear'] = array (
|
||||||
'name' => 'delyear',
|
'name' => 'delyear',
|
||||||
|
|||||||
@ -426,44 +426,5 @@ class FormAccounting extends Form
|
|||||||
return $out_array;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user