2
Why don't you put the prefixed table name in a variable instead of executing the prefix method twice?
Like this:
$ventas_table = $xoopsDB->prefix('ventas');
then
$result = $xoopsDB->queryF("SELECT v_venta_nro FROM $ventas_table WHERE id = (SELECT MAX(id) FROM $ventas_table LIMIT 1 )ORDER BY id DESC") ;