From fd6dbf5d1a288cd9791c38d0debf653243109ace Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 6 May 2016 22:59:03 +0200 Subject: [PATCH] Fix Remove unused variables --- htdocs/compta/facture/class/facture.class.php | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8fee9cc5758..bea200f2656 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Cédric Salvador @@ -734,7 +734,7 @@ class Facture extends CommonInvoice */ function createFromClone($socid=0) { - global $conf,$user,$langs,$hookmanager; + global $user,$hookmanager; $error=0; @@ -849,7 +849,7 @@ class Facture extends CommonInvoice */ function createFromOrder($object) { - global $conf,$user,$langs,$hookmanager; + global $user,$hookmanager; $error=0; @@ -1289,7 +1289,6 @@ class Facture extends CommonInvoice */ function update($user=null, $notrigger=0) { - global $conf, $langs; $error=0; // Clean parameters @@ -1682,7 +1681,6 @@ class Facture extends CommonInvoice */ function set_paid($user,$close_code='',$close_note='') { - global $conf,$langs; $error=0; if ($this->paye != 1) @@ -1740,7 +1738,6 @@ class Facture extends CommonInvoice */ function set_unpaid($user) { - global $conf,$langs; $error=0; $this->db->begin(); @@ -1790,9 +1787,6 @@ class Facture extends CommonInvoice */ function set_canceled($user,$close_code='',$close_note='') { - global $conf,$langs; - - $error=0; dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); @@ -2463,6 +2457,7 @@ class Facture extends CommonInvoice */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=0, $fk_unit = null) { + global $conf,$user; // Deprecation warning if ($label) { dol_syslog(__METHOD__ . ": using line label is deprecated", LOG_WARNING); @@ -2667,7 +2662,7 @@ class Facture extends CommonInvoice */ function update_percent($line, $percent) { - global $mysoc; + global $mysoc,$user; include_once(DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'); @@ -2693,7 +2688,6 @@ class Facture extends CommonInvoice */ function deleteline($rowid) { - global $langs, $conf; dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); @@ -2931,7 +2925,7 @@ class Facture extends CommonInvoice */ function getNextNumRef($soc,$mode='next') { - global $conf, $db, $langs; + global $conf, $langs; $langs->load("bills"); // Clean parameters (if not defined or using deprecated value) @@ -2993,7 +2987,7 @@ class Facture extends CommonInvoice * set up mask. */ if ($mode != 'last' && !$numref) { - dol_print_error($db,"Facture::getNextNumRef ".$obj->error); + dol_print_error($this->db,"Facture::getNextNumRef ".$obj->error); return ""; } @@ -3307,7 +3301,6 @@ class Facture extends CommonInvoice */ function demande_prelevement($fuser, $amount=0) { - global $langs; $error=0; @@ -3527,7 +3520,7 @@ class Facture extends CommonInvoice */ function initAsSpecimen($option='') { - global $user,$langs,$conf; + global $langs; $now=dol_now(); $arraynow=dol_getdate($now); @@ -3712,7 +3705,7 @@ class Facture extends CommonInvoice */ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { - global $conf,$user,$langs; + global $conf,$langs; $langs->load("bills"); @@ -3812,7 +3805,6 @@ class Facture extends CommonInvoice */ function setFinal() { - global $conf, $langs, $user; $this->db->begin(); @@ -4276,7 +4268,7 @@ class FactureLigne extends CommonInvoiceLine */ function update($user='',$notrigger=0) { - global $user,$langs,$conf; + global $user,$conf; $error=0; @@ -4402,9 +4394,7 @@ class FactureLigne extends CommonInvoiceLine */ function delete() { - global $conf,$langs,$user; - - $error=0; + global $user; $this->db->begin();