/**
 * Escribe un numero usando formato numerico
 *
 * @param string $number
 * @return string
 */
function money($number)
{
    $number = my_round($number);
    return "\$ " . number_format($number, 2, ",", ".");
}
 function comparePayedValues()
 {
     $query = " \tSELECT \r\n\t\t\t\t\t\tcp.*\r\n\t\t\t\t\tFROM #__hotelreservation_confirmations_payments \tcp\r\n\t\t\t\t\tINNER JOIN #__hotelreservation_paymentprocessors \tpp\tUSING(paymentprocessor_id)\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tcp.payment_status = '" . PAYMENT_STATUS_PAYED . "'\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_PAYPAL_EXPRESS . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_BANK_ORDER . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_EENMALIGE_INCASO . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_MPESA . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_IDEAL_OMNIKASSA . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_BUCKAROO . "'\r\n\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\tpp.paymentprocessor_type ='" . PROCESSOR_4B . "'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t\tcp.confirmation_id = " . $this->confirmation_id . "\r\n\t\t\t\t\t";
     $this->_db->setQuery($query);
     // dbg($this->_db);
     // exit;
     $payed =& $this->_getList($query);
     $t = 0;
     foreach ($payed as $res) {
         $t += $res->payment_value;
     }
     return my_round($t, 2) <= my_round($this->total, 2);
 }