tabs added

This commit is contained in:
Frédéric FRANCE 2018-08-30 10:02:31 +02:00
parent 4196febb67
commit 1bdc33f286
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1

View File

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