mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-02 23:22:32 +01:00
Correction bug sur nombre a virgule dans la saisie des paiements.
This commit is contained in:
@@ -273,7 +273,10 @@ class DoliDb {
|
||||
{
|
||||
$query = trim($query);
|
||||
//print "<p>$query</p>\n";
|
||||
$this->lastquery=$query;
|
||||
|
||||
$this->results = mysql_query($query, $this->db);
|
||||
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
@@ -407,6 +410,16 @@ class DoliDb {
|
||||
return mysql_num_fields($this->results);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief renvoie la derniere requete soumise par la methode query()
|
||||
\return error_text
|
||||
*/
|
||||
|
||||
function lastquery()
|
||||
{
|
||||
return $this->lastquery;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief renvoie le texte de l'erreur mysql de l'operation precedente.
|
||||
\return error_text
|
||||
|
||||
@@ -100,18 +100,19 @@ class Paiement
|
||||
{
|
||||
$facid = $key;
|
||||
$value = trim($value);
|
||||
$amount = round(ereg_replace(",",".",$value), 2);
|
||||
$amount = ereg_replace(",",".",round($value, 2));
|
||||
|
||||
if (is_numeric($amount))
|
||||
{
|
||||
$total += $amount;
|
||||
}
|
||||
}
|
||||
$total = ereg_replace(",",".",$total);
|
||||
|
||||
if ($total > 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)";
|
||||
$sql .= " VALUES (now(), $this->datepaye, $total, $this->paiementid, '$this->num_paiement', '$this->note', $user->id)";
|
||||
$sql .= " VALUES (now(), $this->datepaye, '$total', $this->paiementid, '$this->num_paiement', '$this->note', $user->id)";
|
||||
|
||||
if ( $this->db->query($sql) )
|
||||
{
|
||||
@@ -130,13 +131,16 @@ class Paiement
|
||||
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
print dolibarr_print_error($this->db);
|
||||
$sql_err++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print dolibarr_print_error($this->db);
|
||||
$sql_err++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user