Merge pull request #11174 from fappels/clean_10_beta

Clean code and fix phpcs
This commit is contained in:
Laurent Destailleur 2019-05-16 21:21:59 +02:00 committed by GitHub
commit d10d5554cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 115 additions and 119 deletions

View File

@ -499,7 +499,7 @@ class Commande extends CommonOrder
return -1; return -1;
} }
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin(); $this->db->begin();

View File

@ -2532,7 +2532,6 @@ class Facture extends CommonInvoice
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -2549,11 +2548,11 @@ class Facture extends CommonInvoice
if ($this->statut == self::STATUS_DRAFT) if ($this->statut == self::STATUS_DRAFT)
{ {
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); dol_syslog(__METHOD__." already draft status", LOG_WARNING);
return 0; return 0;
} }
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin(); $this->db->begin();

View File

@ -3649,7 +3649,8 @@ abstract class CommonObject
{ {
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is '' if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
$totalToShip+=$line->qty_shipped; // defined for shipment only $totalToShip+=$line->qty_shipped; // defined for shipment only
}elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty)) }
elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
{ {
if (empty($totalToShip)) $totalToShip=0; if (empty($totalToShip)) $totalToShip=0;
$totalToShip+=$line->qty; // defined for reception only $totalToShip+=$line->qty; // defined for reception only

View File

@ -1474,8 +1474,6 @@ class FactureFournisseur extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -1492,11 +1490,11 @@ class FactureFournisseur extends CommonInvoice
if ($this->statut == self::STATUS_DRAFT) if ($this->statut == self::STATUS_DRAFT)
{ {
dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); dol_syslog(__METHOD__." already draft status", LOG_WARNING);
return 0; return 0;
} }
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin(); $this->db->begin();

View File

@ -1765,8 +1765,6 @@ class Reception extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -1799,7 +1797,7 @@ class Reception extends CommonObject
$sql.= " SET fk_statut = ".self::STATUS_DRAFT; $sql.= " SET fk_statut = ".self::STATUS_DRAFT;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// If stock increment is done on closing // If stock increment is done on closing