Fix: Avoid to set invoice payed twice

This commit is contained in:
Laurent Destailleur 2008-05-19 19:54:22 +00:00
parent 25427f77f3
commit fd96fd639c

View File

@ -870,6 +870,8 @@ class Facture extends CommonObject
{ {
global $conf,$langs; global $conf,$langs;
if ($this->paye != 1)
{
dolibarr_syslog("Facture::set_payed rowid=".$this->id, LOG_DEBUG); dolibarr_syslog("Facture::set_payed rowid=".$this->id, LOG_DEBUG);
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET';
$sql.= ' fk_statut=2'; $sql.= ' fk_statut=2';
@ -893,6 +895,11 @@ class Facture extends CommonObject
return 1; return 1;
} }
else
{
return 0;
}
}
/** /**