Skip to content

Commit

Permalink
tabs added
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Aug 30, 2018
1 parent 4196feb commit 1bdc33f
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -931,7 +931,7 @@ function create($user, $notrigger=0)
$this->error=$this->db->lasterror();
$error++;
}
}
}
}
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(*)';
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand All @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1bdc33f

Please sign in to comment.