Fix: La suppression d'une adhsion n'effaait pas l'criture bancaire.

This commit is contained in:
Laurent Destailleur
2007-11-18 22:10:19 +00:00
parent 74c8bbbe7f
commit 4ce1d87927
6 changed files with 95 additions and 69 deletions

View File

@@ -299,20 +299,24 @@ class DoliDb
\brief Debut d'une transaction.
\return int 1 si ouverture transaction ok ou deja ouverte, 0 en cas d'erreur
*/
function begin()
{
if (! $this->transaction_opened)
{
$ret=$this->query("BEGIN");
if ($ret) $this->transaction_opened++;
return $ret;
}
else
{
$this->transaction_opened++;
return 1;
}
}
function begin()
{
if (! $this->transaction_opened)
{
$ret=$this->query("BEGIN");
if ($ret)
{
$this->transaction_opened++;
dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
}
return $ret;
}
else
{
$this->transaction_opened++;
return 1;
}
}
/**
\brief Validation d'une transaction
@@ -323,7 +327,11 @@ class DoliDb
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT");
if ($ret) $this->transaction_opened=0;
if ($ret)
{
$this->transaction_opened=0;
dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
}
return $ret;
}
else
@@ -339,13 +347,11 @@ class DoliDb
*/
function rollback()
{
dolibarr_syslog("ROLLBACK ".$this->transaction_opened, LOG_ERR);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK");
$this->transaction_opened=0;
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
return $ret;
}
else