Fix: uniformize code
This commit is contained in:
parent
75bf04ec71
commit
a2902877ce
@ -551,7 +551,7 @@ class Propal extends CommonObject
|
||||
// For triggers
|
||||
$line->fetch($lineid);
|
||||
|
||||
if ($line->delete($lineid))
|
||||
if ($line->delete() > 0)
|
||||
{
|
||||
$this->update_price(1);
|
||||
|
||||
@ -2484,13 +2484,13 @@ class PropaleLigne
|
||||
* Delete line in database
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete($rowid)
|
||||
function delete()
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
|
||||
dol_syslog("PropaleLigne::delete sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
@ -1547,9 +1547,7 @@ class Commande extends CommonObject
|
||||
// For triggers
|
||||
$line->fetch($lineid);
|
||||
|
||||
$result=$line->delete($user);
|
||||
|
||||
if ($result > 0)
|
||||
if ($line->delete() > 0)
|
||||
{
|
||||
$result=$this->update_price(1);
|
||||
|
||||
@ -2663,13 +2661,12 @@ class OrderLine
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Supprime la ligne de commande en base
|
||||
* \user User object
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Delete line in database
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete($user)
|
||||
function delete()
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';";
|
||||
|
||||
|
||||
@ -1923,12 +1923,11 @@ class Facture extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Supprime une ligne facture de la base
|
||||
* \param rowid Id de la ligne de facture a supprimer
|
||||
* \param user User object
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Delete line in database
|
||||
* @param rowid Id of line to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteline($rowid, $user='')
|
||||
function deleteline($rowid)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -1962,7 +1961,7 @@ class Facture extends CommonObject
|
||||
// For triggers
|
||||
$line->fetch($rowid);
|
||||
|
||||
if ($line->delete($user) > 0)
|
||||
if ($line->delete() > 0)
|
||||
{
|
||||
$result=$this->update_price(1);
|
||||
|
||||
@ -3410,13 +3409,13 @@ class FactureLigne
|
||||
* Delete line in database
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete($rowid)
|
||||
function delete()
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
|
||||
dol_syslog("FactureLigne::delete sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user