Fix: La methode getSommePaiement renvoyait toujours 0 depuis l'ajout de la table llx_facture_paiement.

This commit is contained in:
Laurent Destailleur 2004-05-20 14:17:52 +00:00
parent dd27d22608
commit 6b0b14088d

View File

@ -880,13 +880,14 @@ class Facture
return -1; return -1;
} }
} }
/** /**
* Renvoie la sommes des paiements * Renvoie la sommes des paiements deja effectués
* * Utilisé entre autre par certains modèles de factures
*/ */
Function getSommePaiement() Function getSommePaiement()
{ {
$sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."paiement WHERE fk_facture = ".$this->id; $sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."paiement_facture WHERE fk_facture = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$row = $this->db->fetch_row(0); $row = $this->db->fetch_row(0);