tabs added

This commit is contained in:
Frédéric FRANCE
2018-08-30 10:02:31 +02:00
parent 4196febb67
commit 1bdc33f286

View File

@@ -292,7 +292,7 @@ class Commande extends CommonOrder
}
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 @@ 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)
* @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 @@ class Commande extends CommonOrder
}
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 @@ class Commande extends CommonOrder
}
if (!$error) {
$this->statut=self::STATUS_DRAFT;
$this->statut=self::STATUS_DRAFT;
$this->db->commit();
return 1;
}else {
@@ -518,7 +518,7 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
$this->error=$this->db->lasterror();
$error++;
}
}
}
}
}
@@ -975,8 +975,8 @@ class Commande extends CommonOrder
if (! $error)
{
$result=$this->insertExtraFields();
if ($result < 0) $error++;
$result=$this->insertExtraFields();
if ($result < 0) $error++;
}
if (! $error && ! $notrigger)
@@ -1195,7 +1195,7 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
* 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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
*
* 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 @@ class Commande extends CommonOrder
*
* 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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
$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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
* @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 @@ class Commande extends CommonOrder
*
* @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 @@ class OrderLine extends CommonOrderLine
*
* @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();