diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index d58dddaa4..c21754054 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -444,22 +444,6 @@ class Acc_Ledger extends jrn_def_sql return $Res; } - /** - * @brief Get the number of lines of a journal - * @param$p_cred deb or cred - * - * \return an integer - */ - function GetDefLine() - { - $sql_cred='jrn_deb_max_line'; - $sql="select jrn_deb_max_line as value from jrn_def where jrn_def_id=$1"; - $r=$this->db->exec_sql($sql, array($this->id)); - $Res=Database::fetch_all($r); - if ($Res == FALSE || sizeof($Res)==0) - return 1; - return $Res[0]['value']; - } /** * @brief get the saldo of a ledger for a specific period diff --git a/include/class/pre_op_ven.class.php b/include/class/pre_op_ven.class.php index be479d5f3..0a2c79dae 100644 --- a/include/class/pre_op_ven.class.php +++ b/include/class/pre_op_ven.class.php @@ -142,7 +142,7 @@ class Pre_op_ven extends Pre_operation_detail // Find the ledger $ledger=new Acc_Ledger($this->db,$this->operation->jrn_def_id); // Find the max line of the ledger - $max_row=$ledger->GetDefLine(); + $max_row=$ledger->get_min_row(); // compute nb_item $array['nb_item']=($max_row > $count)?$max_row:$count;