forked from Wavyzz/dolibarr
wip
This commit is contained in:
@@ -203,12 +203,12 @@ class Commande extends CommonOrder
|
||||
public $multicurrency_total_ttc;
|
||||
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
//! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...)
|
||||
public $module_source;
|
||||
//! key of pos source ('0', '1', ...)
|
||||
public $pos_source;
|
||||
|
||||
|
||||
/**
|
||||
* ERR Not enough stock
|
||||
*/
|
||||
@@ -243,7 +243,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
@@ -260,7 +260,7 @@ class Commande extends CommonOrder
|
||||
* @param Societe $soc Object thirdparty
|
||||
* @return string Order free reference
|
||||
*/
|
||||
function getNextNumRef($soc)
|
||||
public function getNextNumRef($soc)
|
||||
{
|
||||
global $langs, $conf;
|
||||
$langs->load("order");
|
||||
@@ -318,7 +318,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <=0 if OK, 0=Nothing done, >0 if KO
|
||||
*/
|
||||
function valid($user, $idwarehouse = 0, $notrigger = 0)
|
||||
public function valid($user, $idwarehouse = 0, $notrigger = 0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@@ -471,7 +471,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Set draft status
|
||||
*
|
||||
@@ -479,8 +479,8 @@ 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
|
||||
*/
|
||||
function set_draft($user, $idwarehouse = -1)
|
||||
{
|
||||
public function set_draft($user, $idwarehouse = -1)
|
||||
{
|
||||
//phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -562,7 +562,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
|
||||
*/
|
||||
function set_reopen($user)
|
||||
public function set_reopen($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error=0;
|
||||
@@ -622,7 +622,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function cloture($user, $notrigger = 0)
|
||||
public function cloture($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -682,7 +682,7 @@ class Commande extends CommonOrder
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function cancel($idwarehouse = -1)
|
||||
public function cancel($idwarehouse = -1)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@@ -763,7 +763,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger = 0)
|
||||
public function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$error=0;
|
||||
@@ -892,7 +892,7 @@ class Commande extends CommonOrder
|
||||
$vatrate = $line->tva_tx;
|
||||
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
|
||||
|
||||
$result = $this->addline(
|
||||
$result = $this->addline(
|
||||
$line->desc,
|
||||
$line->subprice,
|
||||
$line->qty,
|
||||
@@ -1067,7 +1067,7 @@ class Commande extends CommonOrder
|
||||
* @param int $socid Id of thirdparty
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($socid = 0)
|
||||
public function createFromClone($socid = 0)
|
||||
{
|
||||
global $user,$hookmanager;
|
||||
|
||||
@@ -1152,7 +1152,7 @@ class Commande extends CommonOrder
|
||||
* @param User $user User making creation
|
||||
* @return int <0 if KO, 0 if nothing done, 1 if OK
|
||||
*/
|
||||
function createFromProposal($object, User $user)
|
||||
public function createFromProposal($object, User $user)
|
||||
{
|
||||
global $conf, $hookmanager;
|
||||
|
||||
@@ -1309,7 +1309,7 @@ class Commande extends CommonOrder
|
||||
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
|
||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0)
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0)
|
||||
{
|
||||
global $mysoc, $conf, $langs, $user;
|
||||
|
||||
@@ -1523,22 +1523,22 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Add line into array
|
||||
* $this->client must be loaded
|
||||
*
|
||||
* @param int $idproduct Product Id
|
||||
* @param float $qty Quantity
|
||||
* @param float $remise_percent Product discount relative
|
||||
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @return void
|
||||
* @param int $idproduct Product Id
|
||||
* @param float $qty Quantity
|
||||
* @param float $remise_percent Product discount relative
|
||||
* @param int $date_start Start date of the line
|
||||
* @param int $date_end End date of the line
|
||||
* @return void
|
||||
*
|
||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||
* insere dans tableau $this->products
|
||||
*/
|
||||
function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
|
||||
public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
@@ -1583,7 +1583,6 @@ class Commande extends CommonOrder
|
||||
$line->product_desc=$prod->description;
|
||||
$line->fk_unit=$prod->fk_unit;
|
||||
|
||||
// Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
// Save the start and end date of the line in the object
|
||||
if ($date_start) { $line->date_start = $date_start; }
|
||||
if ($date_end) { $line->date_end = $date_end; }
|
||||
@@ -1623,7 +1622,7 @@ class Commande extends CommonOrder
|
||||
* @param string $ref_int Internal reference of other object
|
||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||
*/
|
||||
function fetch($id, $ref = '', $ref_ext = '', $ref_int = '')
|
||||
public function fetch($id, $ref = '', $ref_ext = '', $ref_int = '')
|
||||
{
|
||||
|
||||
// Check parameters
|
||||
@@ -1719,7 +1718,7 @@ class Commande extends CommonOrder
|
||||
$this->fk_delivery_address = $obj->fk_delivery_address;
|
||||
$this->module_source = $obj->module_source;
|
||||
$this->pos_source = $obj->pos_source;
|
||||
|
||||
|
||||
//Incoterms
|
||||
$this->fk_incoterms = $obj->fk_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
@@ -1776,7 +1775,7 @@ class Commande extends CommonOrder
|
||||
* @param int $idremise Id de la remise fixe
|
||||
* @return int >0 si ok, <0 si ko
|
||||
*/
|
||||
function insert_discount($idremise)
|
||||
public function insert_discount($idremise)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@@ -1848,14 +1847,14 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load array lines
|
||||
*
|
||||
* @param int $only_product Return only physical products
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_lines($only_product = 0)
|
||||
public function fetch_lines($only_product = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->lines=array();
|
||||
@@ -1971,7 +1970,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return int <0 if KO, Nbr of product lines if OK
|
||||
*/
|
||||
function getNbOfProductsLines()
|
||||
public function getNbOfProductsLines()
|
||||
{
|
||||
$nb=0;
|
||||
foreach($this->lines as $line)
|
||||
@@ -1986,7 +1985,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return int <0 if KO, Nbr of service lines if OK
|
||||
*/
|
||||
function getNbOfServicesLines()
|
||||
public function getNbOfServicesLines()
|
||||
{
|
||||
$nb=0;
|
||||
foreach($this->lines as $line)
|
||||
@@ -1997,11 +1996,11 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* Count numbe rof shipments for this order
|
||||
* Count number of shipments for this order
|
||||
*
|
||||
* @return int <0 if KO, Nb of shipment found if OK
|
||||
*/
|
||||
function getNbOfShipments()
|
||||
public function getNbOfShipments()
|
||||
{
|
||||
$nb = 0;
|
||||
|
||||
@@ -2037,7 +2036,7 @@ class Commande extends CommonOrder
|
||||
* @param int $filtre_statut Filter on shipment status
|
||||
* @return int <0 if KO, Nb of lines found if OK
|
||||
*/
|
||||
function loadExpeditions($filtre_statut = -1)
|
||||
public function loadExpeditions($filtre_statut = -1)
|
||||
{
|
||||
$this->expeditions = array();
|
||||
|
||||
@@ -2077,7 +2076,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Returns a array with expeditions lines number
|
||||
*
|
||||
@@ -2085,7 +2084,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* TODO deprecate, move to Shipping class
|
||||
*/
|
||||
function nb_expedition()
|
||||
public function nb_expedition()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = 'SELECT count(*)';
|
||||
@@ -2104,7 +2103,7 @@ class Commande extends CommonOrder
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return a array with the pending stock by product
|
||||
*
|
||||
@@ -2113,7 +2112,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* TODO FONCTION NON FINIE A FINIR
|
||||
*/
|
||||
function stock_array($filtre_statut = self::STATUS_CANCELED)
|
||||
public function stock_array($filtre_statut = self::STATUS_CANCELED)
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->stocks = array();
|
||||
@@ -2153,7 +2152,7 @@ class Commande extends CommonOrder
|
||||
* @param int $lineid Id of line to delete
|
||||
* @return int >0 if OK, 0 if nothing to do, <0 if KO
|
||||
*/
|
||||
function deleteline($user = null, $lineid = 0)
|
||||
public function deleteline($user = null, $lineid = 0)
|
||||
{
|
||||
if ($this->statut == self::STATUS_DRAFT)
|
||||
{
|
||||
@@ -2222,7 +2221,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Applique une remise relative
|
||||
*
|
||||
@@ -2231,7 +2230,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_remise($user, $remise, $notrigger = 0)
|
||||
public function set_remise($user, $remise, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
@@ -2290,7 +2289,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Applique une remise absolue
|
||||
*
|
||||
@@ -2299,7 +2298,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_remise_absolue($user, $remise, $notrigger = 0)
|
||||
public function set_remise_absolue($user, $remise, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$remise=trim($remise)?trim($remise):0;
|
||||
@@ -2358,7 +2357,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Set the order date
|
||||
*
|
||||
@@ -2367,7 +2366,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_date($user, $date, $notrigger = 0)
|
||||
public function set_date($user, $date, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
@@ -2424,7 +2423,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Set the planned delivery date
|
||||
*
|
||||
@@ -2433,7 +2432,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
||||
public function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
@@ -2490,7 +2489,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return list of orders (eventuelly filtered on a user) into an array
|
||||
*
|
||||
@@ -2504,7 +2503,7 @@ class Commande extends CommonOrder
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC')
|
||||
public function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
@@ -2572,7 +2571,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function availability($availability_id, $notrigger = 0)
|
||||
public function availability($availability_id, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@@ -2635,7 +2634,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Update order demand_reason
|
||||
*
|
||||
@@ -2643,7 +2642,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int >0 if ok, <0 if ko
|
||||
*/
|
||||
function demand_reason($demand_reason_id, $notrigger = 0)
|
||||
public function demand_reason($demand_reason_id, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
@@ -2707,7 +2706,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Set customer ref
|
||||
*
|
||||
@@ -2716,7 +2715,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_ref_client($user, $ref_client, $notrigger = 0)
|
||||
public function set_ref_client($user, $ref_client, $notrigger = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($user->rights->commande->creer)
|
||||
@@ -2779,7 +2778,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function classifyBilled(User $user, $notrigger = 0)
|
||||
public function classifyBilled(User $user, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
@@ -2835,7 +2834,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function classifyUnBilled()
|
||||
public function classifyUnBilled()
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
$error = 0;
|
||||
@@ -2914,7 +2913,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger disable line update trigger
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0)
|
||||
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0)
|
||||
{
|
||||
global $conf, $mysoc, $langs, $user;
|
||||
|
||||
@@ -3104,7 +3103,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update(User $user, $notrigger = 0)
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -3199,7 +3198,7 @@ class Commande extends CommonOrder
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger = 0)
|
||||
public function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@@ -3321,14 +3320,14 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
public function load_board($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
@@ -3387,7 +3386,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return string Label
|
||||
*/
|
||||
function getLabelSource()
|
||||
public function getLabelSource()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -3403,12 +3402,12 @@ class Commande extends CommonOrder
|
||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode)
|
||||
public function getLibStatut($mode)
|
||||
{
|
||||
return $this->LibStatut($this->statut, $this->billed, $mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return label of status
|
||||
*
|
||||
@@ -3418,7 +3417,7 @@ class Commande extends CommonOrder
|
||||
* @param int $donotshowbilled Do not show billed status after order status
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($statut, $billed, $mode, $donotshowbilled = 0)
|
||||
public function LibStatut($statut, $billed, $mode, $donotshowbilled = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
@@ -3430,72 +3429,72 @@ class Commande extends CommonOrder
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return $langs->trans('StatusOrderCanceled');
|
||||
if ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraft');
|
||||
if ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidated').$billedtext;
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBill');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
|
||||
elseif ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraft');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidated').$billedtext;
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBill');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return $langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraftShort');
|
||||
if ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidatedShort').$billedtext;
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
|
||||
elseif ($statut==self::STATUS_DRAFT) return $langs->trans('StatusOrderDraftShort');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return $langs->trans('StatusOrderValidatedShort').$billedtext;
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return $langs->trans('StatusOrderSentShort').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderToBillShort');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderProcessed').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return $langs->trans('StatusOrderDelivered');
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5').' '.$langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraftShort');
|
||||
if ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated'), 'statut1').' '.$langs->trans('StatusOrderValidatedShort').$billedtext;
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSent'), 'statut3').' '.$langs->trans('StatusOrderSentShort').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDeliveredShort');
|
||||
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraftShort');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated'), 'statut1').' '.$langs->trans('StatusOrderValidatedShort').$billedtext;
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSent'), 'statut3').' '.$langs->trans('StatusOrderSentShort').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBillShort');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDeliveredShort');
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5');
|
||||
if ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
if ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3');
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return img_picto($langs->trans('StatusOrderCanceled'), 'statut5').' '.$langs->trans('StatusOrderCanceled');
|
||||
if ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||
if ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1').' '.$langs->trans('StatusOrderValidated').$billedtext;
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3').' '.$langs->trans('StatusOrderSent').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBill');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessedShort').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDelivered');
|
||||
elseif ($statut==self::STATUS_DRAFT) return img_picto($langs->trans('StatusOrderDraft'), 'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1').' '.$langs->trans('StatusOrderValidated').$billedtext;
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return img_picto($langs->trans('StatusOrderSentShort').$billedtext, 'statut3').' '.$langs->trans('StatusOrderSent').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderToBill'), 'statut4').' '.$langs->trans('StatusOrderToBill');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderProcessedShort').$billedtext, 'statut6').' '.$langs->trans('StatusOrderProcessed').$billedtext;
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return img_picto($langs->trans('StatusOrderDelivered'), 'statut6').' '.$langs->trans('StatusOrderDelivered');
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderCanceledShort').' </span>'.img_picto($langs->trans('StatusOrderCanceled'), 'statut5');
|
||||
if ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraftShort').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
if ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidatedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSentShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBillShort').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDeliveredShort').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
elseif ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraftShort').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidatedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSentShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBillShort').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessedShort').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDeliveredShort').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
}
|
||||
elseif ($mode == 6)
|
||||
{
|
||||
if ($statut==self::STATUS_CANCELED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderCanceled').' </span>'.img_picto($langs->trans('StatusOrderCanceled'), 'statut5');
|
||||
if ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraft').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
if ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidated').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
if ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSent').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
|
||||
if ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBill').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
if ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessed').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
if ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDelivered').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
elseif ($statut==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDraft').' </span>'.img_picto($langs->trans('StatusOrderDraft'), 'statut0');
|
||||
elseif ($statut==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderValidated').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderValidated').$billedtext, 'statut1');
|
||||
elseif ($statut==self::STATUS_SHIPMENTONPROCESS) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderSent').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderSent').$billedtext, 'statut3');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! $billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderToBill').' </span>'.img_picto($langs->trans('StatusOrderToBill'), 'statut4');
|
||||
elseif ($statut==self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderProcessed').$billedtext.' </span>'.img_picto($langs->trans('StatusOrderProcessed').$billedtext, 'statut6');
|
||||
elseif ($statut==self::STATUS_CLOSED && (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) return '<span class="hideonsmartphone">'.$langs->trans('StatusOrderDelivered').' </span>'.img_picto($langs->trans('StatusOrderDelivered'), 'statut6');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3511,7 +3510,7 @@ class Commande extends CommonOrder
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1)
|
||||
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
@@ -3588,7 +3587,7 @@ class Commande extends CommonOrder
|
||||
* @param int $id Id of order
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT c.rowid, date_creation as datec, tms as datem,';
|
||||
$sql.= ' date_valid as datev,';
|
||||
@@ -3646,7 +3645,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function initAsSpecimen()
|
||||
public function initAsSpecimen()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -3734,7 +3733,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
public function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
@@ -3776,7 +3775,7 @@ class Commande extends CommonOrder
|
||||
*
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function getLinesArray()
|
||||
public function getLinesArray()
|
||||
{
|
||||
return $this->fetch_lines();
|
||||
}
|
||||
@@ -3880,7 +3879,7 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
public $table_element='commandedet';
|
||||
|
||||
var $oldline;
|
||||
public $oldline;
|
||||
|
||||
/**
|
||||
* Id of parent order
|
||||
@@ -3897,38 +3896,37 @@ class OrderLine extends CommonOrderLine
|
||||
public $commande_id;
|
||||
|
||||
// From llx_commandedet
|
||||
var $fk_parent_line;
|
||||
var $fk_facture;
|
||||
public $fk_parent_line;
|
||||
public $fk_facture;
|
||||
|
||||
/**
|
||||
* @var string Order lines label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
var $fk_remise_except;
|
||||
var $rang = 0;
|
||||
var $fk_fournprice;
|
||||
public $fk_remise_except;
|
||||
public $rang = 0;
|
||||
public $fk_fournprice;
|
||||
|
||||
/**
|
||||
* Buy price without taxes
|
||||
* @var float
|
||||
*/
|
||||
var $pa_ht;
|
||||
var $marge_tx;
|
||||
var $marque_tx;
|
||||
public $pa_ht;
|
||||
public $marge_tx;
|
||||
public $marque_tx;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see remise_percent, fk_remise_except
|
||||
*/
|
||||
var $remise;
|
||||
public $remise;
|
||||
|
||||
// Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
// Start and end date of the line
|
||||
var $date_start;
|
||||
var $date_end;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
|
||||
var $skip_update_total; // Skip update price total for special lines
|
||||
public $skip_update_total; // Skip update price total for special lines
|
||||
|
||||
|
||||
/**
|
||||
@@ -3936,10 +3934,10 @@ class OrderLine extends CommonOrderLine
|
||||
*
|
||||
* @param DoliDB $db handler d'acces base de donnee
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db= $db;
|
||||
}
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db= $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load line order
|
||||
@@ -3947,7 +3945,7 @@ class OrderLine extends CommonOrderLine
|
||||
* @param int $rowid Id line order
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($rowid)
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_parent_line, cd.fk_product, cd.product_type, cd.label as custom_label, cd.description, cd.price, cd.qty, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx,';
|
||||
$sql.= ' cd.remise, cd.remise_percent, cd.fk_remise_except, cd.subprice,';
|
||||
@@ -4032,7 +4030,7 @@ class OrderLine extends CommonOrderLine
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete(User $user, $notrigger = 0)
|
||||
public function delete(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@@ -4093,7 +4091,7 @@ class OrderLine extends CommonOrderLine
|
||||
* @param int $notrigger 1 = disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function insert($user = null, $notrigger = 0)
|
||||
public function insert($user = null, $notrigger = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@@ -4238,7 +4236,7 @@ class OrderLine extends CommonOrderLine
|
||||
* @param int $notrigger 1 = disable triggers
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function update(User $user, $notrigger = 0)
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -4365,14 +4363,14 @@ class OrderLine extends CommonOrderLine
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_total()
|
||||
public function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
Reference in New Issue
Block a user