function getLastCostForContract($contracts_id)
{
global $DB;
$query = "SELECT *\n FROM `" . $this->getTable() . "`\n WHERE `contracts_id` = '{$contracts_id}'\n ORDER BY 'end_date' DESC, `id` DESC";
if ($result = $DB->query($query)) {
return $DB->fetch_assoc($result);
}
return array();
}