diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4d6f50538c31e..64b8ae3985693 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -292,7 +292,7 @@ function valid($user, $idwarehouse=0, $notrigger=0) } if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -436,7 +436,7 @@ function valid($user, $idwarehouse=0, $notrigger=0) * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user, $idwarehouse=-1) { global $conf,$langs; @@ -450,7 +450,7 @@ function set_draft($user, $idwarehouse=-1) } if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -494,7 +494,7 @@ function set_draft($user, $idwarehouse=-1) } if (!$error) { - $this->statut=self::STATUS_DRAFT; + $this->statut=self::STATUS_DRAFT; $this->db->commit(); return 1; }else { @@ -518,7 +518,7 @@ function set_draft($user, $idwarehouse=-1) * @param User $user Object user that change status * @return int <0 if KO, 0 if nothing is done, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_reopen($user) { $error=0; @@ -585,7 +585,7 @@ function cloture($user, $notrigger=0) $error=0; if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) { $this->db->begin(); @@ -931,7 +931,7 @@ function create($user, $notrigger=0) $this->error=$this->db->lasterror(); $error++; } - } + } } } @@ -975,8 +975,8 @@ function create($user, $notrigger=0) if (! $error) { - $result=$this->insertExtraFields(); - if ($result < 0) $error++; + $result=$this->insertExtraFields(); + if ($result < 0) $error++; } if (! $error && ! $notrigger) @@ -1195,7 +1195,7 @@ function createFromProposal($object, User $user) $this->linked_objects[$this->origin] = $this->origin_id; if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) { - $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); + $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); } $ret = $this->create($user); @@ -1336,7 +1336,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc); - // Clean vat code + // Clean vat code $vat_src_code=''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { @@ -1490,7 +1490,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') { global $conf, $mysoc; @@ -1720,7 +1720,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='') * @param int $idremise Id de la remise fixe * @return int >0 si ok, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { global $langs; @@ -1798,7 +1798,7 @@ function insert_discount($idremise) * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines($only_product=0) { $this->lines=array(); @@ -1856,10 +1856,10 @@ function fetch_lines($only_product=0) $line->price = $objp->price; $line->fk_product = $objp->fk_product; $line->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); - $line->pa_ht = $marginInfos[0]; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); + $line->pa_ht = $marginInfos[0]; $line->marge_tx = $marginInfos[1]; - $line->marque_tx = $marginInfos[2]; + $line->marque_tx = $marginInfos[2]; $line->rang = $objp->rang; $line->info_bits = $objp->info_bits; $line->special_code = $objp->special_code; @@ -1958,10 +1958,10 @@ function getNbOfShipments() $resql = $this->db->query($sql); if ($resql) { - $obj = $this->db->fetch_object($resql); - if ($obj) $nb = $obj->nb; + $obj = $this->db->fetch_object($resql); + if ($obj) $nb = $obj->nb; - $this->db->free($resql); + $this->db->free($resql); return $nb; } else @@ -2025,7 +2025,7 @@ function loadExpeditions($filtre_statut=-1) * * TODO deprecate, move to Shipping class */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function nb_expedition() { $sql = 'SELECT count(*)'; @@ -2052,7 +2052,7 @@ function nb_expedition() * * TODO FONCTION NON FINIE A FINIR */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function stock_array($filtre_statut=self::STATUS_CANCELED) { $this->stocks = array(); @@ -2169,7 +2169,7 @@ function deleteline($user=null, $lineid=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise($user, $remise, $notrigger=0) { $remise=trim($remise)?trim($remise):0; @@ -2236,7 +2236,7 @@ function set_remise($user, $remise, $notrigger=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_absolue($user, $remise, $notrigger=0) { $remise=trim($remise)?trim($remise):0; @@ -2303,7 +2303,7 @@ function set_remise_absolue($user, $remise, $notrigger=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date($user, $date, $notrigger=0) { if ($user->rights->commande->creer) @@ -2368,7 +2368,7 @@ function set_date($user, $date, $notrigger=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison, $notrigger=0) { if ($user->rights->commande->creer) @@ -2438,7 +2438,7 @@ function set_date_livraison($user, $date_livraison, $notrigger=0) * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC') { global $user; @@ -2576,7 +2576,7 @@ function availability($availability_id, $notrigger=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if ok, <0 if ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function demand_reason($demand_reason_id, $notrigger=0) { global $user; @@ -2648,7 +2648,7 @@ function demand_reason($demand_reason_id, $notrigger=0) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_ref_client($user, $ref_client, $notrigger=0) { if ($user->rights->commande->creer) @@ -2869,7 +2869,7 @@ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocalt $remise_percent=price2num($remise_percent); $qty=price2num($qty); $pu = price2num($pu); - $pa_ht=price2num($pa_ht); + $pa_ht=price2num($pa_ht); $pu_ht_devise=price2num($pu_ht_devise); $txtva=price2num($txtva); $txlocaltax1=price2num($txlocaltax1); @@ -2882,7 +2882,7 @@ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocalt $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); - // Clean vat code + // Clean vat code $vat_src_code=''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { @@ -3259,7 +3259,7 @@ function delete($user, $notrigger=0) * @param User $user Object user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { global $conf, $langs; @@ -3348,7 +3348,7 @@ function getLibStatut($mode) * @param int $donotshowbilled Do not show billed status after order status * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$billed,$mode,$donotshowbilled=0) { global $langs, $conf; @@ -3665,7 +3665,7 @@ function initAsSpecimen() * * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { global $user; @@ -4301,7 +4301,7 @@ function update(User $user, $notrigger=0) * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { $this->db->begin();