mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Fix: La suppression d'une adhsion n'effaait pas l'criture bancaire.
This commit is contained in:
@@ -190,11 +190,6 @@ class Cotisation extends CommonObject
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php");
|
||||
$accountline=new AccountLine($this->db);
|
||||
$result=$accountline->fetch($this->fk_bank);
|
||||
if ($accountline->rappro)
|
||||
{
|
||||
$this->error="ErrorBankRecordConcialiated";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
@@ -209,7 +204,7 @@ class Cotisation extends CommonObject
|
||||
{
|
||||
if ($this->fk_bank)
|
||||
{
|
||||
$result=$accountline->delete();
|
||||
$result=$accountline->delete(); // Renvoi faux si ligne rapprocher
|
||||
if ($result > 0)
|
||||
{
|
||||
$this->db->commit();
|
||||
@@ -217,6 +212,7 @@ class Cotisation extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$accountline->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
|
||||
if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
{
|
||||
$result=$subscription->fetch($rowid);
|
||||
$result=$subscription->delete($rowid);
|
||||
$result=$subscription->delete();
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent);
|
||||
|
||||
@@ -253,7 +253,11 @@ class DoliDb
|
||||
if (! $this->transaction_opened)
|
||||
{
|
||||
$ret=$this->query("BEGIN TRANSACTION");
|
||||
if ($ret) $this->transaction_opened++;
|
||||
if ($ret)
|
||||
{
|
||||
$this->transaction_opened++;
|
||||
dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@@ -272,7 +276,11 @@ class DoliDb
|
||||
if ($this->transaction_opened <= 1)
|
||||
{
|
||||
$ret=$this->query("COMMIT TRANSACTION");
|
||||
if ($ret) $this->transaction_opened=0;
|
||||
if ($ret)
|
||||
{
|
||||
$this->transaction_opened=0;
|
||||
dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@@ -288,13 +296,11 @@ class DoliDb
|
||||
*/
|
||||
function rollback()
|
||||
{
|
||||
dolibarr_syslog("ROLLBACK ".$this->transaction_opened, LOG_ERR);
|
||||
|
||||
if ($this->transaction_opened<=1)
|
||||
{
|
||||
$ret=$this->query("ROLLBACK TRANSACTION");
|
||||
$this->transaction_opened=0;
|
||||
|
||||
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -304,7 +304,11 @@ class DoliDb
|
||||
if (! $this->transaction_opened)
|
||||
{
|
||||
$ret=$this->query("BEGIN");
|
||||
if ($ret) $this->transaction_opened++;
|
||||
if ($ret)
|
||||
{
|
||||
$this->transaction_opened++;
|
||||
dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@@ -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
|
||||
|
||||
@@ -309,7 +309,11 @@ class DoliDb
|
||||
if (! $this->transaction_opened)
|
||||
{
|
||||
$ret=$this->query("BEGIN");
|
||||
if ($ret) $this->transaction_opened++;
|
||||
if ($ret)
|
||||
{
|
||||
$this->transaction_opened++;
|
||||
dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@@ -328,7 +332,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
|
||||
@@ -348,6 +356,7 @@ class DoliDb
|
||||
{
|
||||
$ret=$this->query("ROLLBACK");
|
||||
$this->transaction_opened=0;
|
||||
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -252,7 +252,11 @@ class DoliDb
|
||||
if (! $this->transaction_opened)
|
||||
{
|
||||
$ret=$this->query("BEGIN;");
|
||||
if ($ret) $this->transaction_opened++;
|
||||
if ($ret)
|
||||
{
|
||||
$this->transaction_opened++;
|
||||
dolibarr_syslog("BEGIN Transaction",LOG_DEBUG);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@@ -271,7 +275,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
|
||||
@@ -291,6 +299,7 @@ class DoliDb
|
||||
{
|
||||
$ret=$this->query("ROLLBACK;");
|
||||
$this->transaction_opened=0;
|
||||
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user