mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
add visibility
This commit is contained in:
@@ -69,7 +69,7 @@ class PrestaShopWebservice
|
|||||||
* @param string $key Authentification key
|
* @param string $key Authentification key
|
||||||
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
|
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
|
||||||
*/
|
*/
|
||||||
function __construct($url, $key, $debug = true)
|
public function __construct($url, $key, $debug = true)
|
||||||
{
|
{
|
||||||
if (!extension_loaded('curl'))
|
if (!extension_loaded('curl'))
|
||||||
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
|
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Dolistore
|
|||||||
*
|
*
|
||||||
* @param boolean $debug Enable debug of request on screen
|
* @param boolean $debug Enable debug of request on screen
|
||||||
*/
|
*/
|
||||||
function __construct($debug = false)
|
public function __construct($debug = false)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class Dolistore
|
|||||||
* @param array $options Options
|
* @param array $options Options
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
|
public function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -163,14 +163,14 @@ class Dolistore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return tree of Dolistore categories. $this->categories must have been loaded before.
|
* Return tree of Dolistore categories. $this->categories must have been loaded before.
|
||||||
*
|
*
|
||||||
* @param int $parent Id of parent category
|
* @param int $parent Id of parent category
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_categories($parent = 0)
|
public function get_categories($parent = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (!isset($this->categories)) die('not possible');
|
if (!isset($this->categories)) die('not possible');
|
||||||
@@ -212,13 +212,13 @@ class Dolistore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of product formated for output
|
* Return list of product formated for output
|
||||||
*
|
*
|
||||||
* @return string HTML output
|
* @return string HTML output
|
||||||
*/
|
*/
|
||||||
function get_products()
|
public function get_products()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
@@ -295,39 +295,39 @@ class Dolistore
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get previous link
|
* get previous link
|
||||||
*
|
*
|
||||||
* @param string $text symbol previous
|
* @param string $text symbol previous
|
||||||
* @return string html previous link
|
* @return string html previous link
|
||||||
*/
|
*/
|
||||||
function get_previous_link($text = '<<')
|
public function get_previous_link($text = '<<')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get next link
|
* get next link
|
||||||
*
|
*
|
||||||
* @param string $text symbol next
|
* @param string $text symbol next
|
||||||
* @return string html next link
|
* @return string html next link
|
||||||
*/
|
*/
|
||||||
function get_next_link($text = '>>')
|
public function get_next_link($text = '>>')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get previous url
|
* get previous url
|
||||||
*
|
*
|
||||||
* @return string previous url
|
* @return string previous url
|
||||||
*/
|
*/
|
||||||
function get_previous_url()
|
public function get_previous_url()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$param_array = array();
|
$param_array = array();
|
||||||
@@ -345,13 +345,13 @@ class Dolistore
|
|||||||
return $this->url."&".$param;
|
return $this->url."&".$param;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get next url
|
* get next url
|
||||||
*
|
*
|
||||||
* @return string next url
|
* @return string next url
|
||||||
*/
|
*/
|
||||||
function get_next_url()
|
public function get_next_url()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$param_array = array();
|
$param_array = array();
|
||||||
@@ -369,7 +369,7 @@ class Dolistore
|
|||||||
return $this->url."&".$param;
|
return $this->url."&".$param;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* version compare
|
* version compare
|
||||||
*
|
*
|
||||||
@@ -377,7 +377,7 @@ class Dolistore
|
|||||||
* @param string $v2 version 2
|
* @param string $v2 version 2
|
||||||
* @return int result of compare
|
* @return int result of compare
|
||||||
*/
|
*/
|
||||||
function version_compare($v1, $v2)
|
public function version_compare($v1, $v2)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$v1 = explode('.', $v1);
|
$v1 = explode('.', $v1);
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ class Propal extends CommonObject
|
|||||||
* @param int $socid Id third party
|
* @param int $socid Id third party
|
||||||
* @param int $propalid Id proposal
|
* @param int $propalid Id proposal
|
||||||
*/
|
*/
|
||||||
function __construct($db, $socid = "", $propalid = 0)
|
public function __construct($db, $socid = "", $propalid = 0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add line into array products
|
* Add line into array products
|
||||||
* $this->thirdparty should be loaded
|
* $this->thirdparty should be loaded
|
||||||
@@ -267,7 +267,7 @@ class Propal extends CommonObject
|
|||||||
* TODO Replace calls to this function by generation objet Ligne
|
* TODO Replace calls to this function by generation objet Ligne
|
||||||
* inserted into table $this->products
|
* inserted into table $this->products
|
||||||
*/
|
*/
|
||||||
function add_product($idproduct, $qty, $remise_percent = 0)
|
public function add_product($idproduct, $qty, $remise_percent = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
@@ -316,14 +316,14 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Adding line of fixed discount in the proposal in DB
|
* Adding line of fixed discount in the proposal in DB
|
||||||
*
|
*
|
||||||
* @param int $idremise Id of fixed discount
|
* @param int $idremise Id of fixed discount
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function insert_discount($idremise)
|
public function insert_discount($idremise)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -434,7 +434,7 @@ class Propal extends CommonObject
|
|||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
* @see add_product
|
* @see add_product
|
||||||
*/
|
*/
|
||||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0)
|
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0)
|
||||||
{
|
{
|
||||||
global $mysoc, $conf, $langs;
|
global $mysoc, $conf, $langs;
|
||||||
|
|
||||||
@@ -663,11 +663,11 @@ class Propal extends CommonObject
|
|||||||
* @param int $notrigger disable line update trigger
|
* @param int $notrigger disable line update trigger
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0)
|
public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $mysoc;
|
global $mysoc;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise_percent=$remise_percent,
|
dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise_percent=$remise_percent,
|
||||||
txtva=$txtva, desc=$desc, price_base_type=$price_base_type, info_bits=$info_bits, special_code=$special_code, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, type=$type, date_start=$date_start, date_end=$date_end");
|
txtva=$txtva, desc=$desc, price_base_type=$price_base_type, info_bits=$info_bits, special_code=$special_code, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, type=$type, date_start=$date_start, date_end=$date_end");
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
@@ -827,7 +827,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $lineid Id of line to delete
|
* @param int $lineid Id of line to delete
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function deleteline($lineid)
|
public function deleteline($lineid)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -869,7 +869,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf,$hookmanager;
|
global $conf,$hookmanager;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -1193,7 +1193,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Insert into DB a proposal object completely defined by its data members (ex, results from copy).
|
* Insert into DB a proposal object completely defined by its data members (ex, results from copy).
|
||||||
*
|
*
|
||||||
@@ -1201,7 +1201,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @return int Id of the new object if ok, <0 if ko
|
* @return int Id of the new object if ok, <0 if ko
|
||||||
* @see create
|
* @see create
|
||||||
*/
|
*/
|
||||||
function create_from($user)
|
public function create_from($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
// i love this function because $this->products is not used in create function...
|
// i love this function because $this->products is not used in create function...
|
||||||
@@ -1216,7 +1216,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $socid Id of thirdparty
|
* @param int $socid Id of thirdparty
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($socid = 0)
|
public function createFromClone($socid = 0)
|
||||||
{
|
{
|
||||||
global $user,$conf,$hookmanager;
|
global $user,$conf,$hookmanager;
|
||||||
|
|
||||||
@@ -1345,7 +1345,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param string $ref Ref of proposal
|
* @param string $ref Ref of proposal
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($rowid, $ref = '')
|
public function fetch($rowid, $ref = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||||
@@ -1509,7 +1509,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update(User $user, $notrigger = 0)
|
public function update(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1597,14 +1597,14 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load array lines
|
* Load array lines
|
||||||
*
|
*
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
function fetch_lines($only_product = 0)
|
public function fetch_lines($only_product = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->lines=array();
|
$this->lines=array();
|
||||||
@@ -1723,7 +1723,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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=Nothing done, >=0 if OK
|
* @return int <0 if KO, 0=Nothing done, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function valid($user, $notrigger = 0)
|
public function valid($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
@@ -1838,7 +1838,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define proposal date
|
* Define proposal date
|
||||||
*
|
*
|
||||||
@@ -1847,7 +1847,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_date($user, $date, $notrigger = 0)
|
public function set_date($user, $date, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($date))
|
if (empty($date))
|
||||||
@@ -1907,7 +1907,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define end validity date
|
* Define end validity date
|
||||||
*
|
*
|
||||||
@@ -1916,7 +1916,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_echeance($user, $date_fin_validite, $notrigger = 0)
|
public function set_echeance($user, $date_fin_validite, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! empty($user->rights->propal->creer))
|
if (! empty($user->rights->propal->creer))
|
||||||
@@ -1969,7 +1969,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set delivery date
|
* Set delivery date
|
||||||
*
|
*
|
||||||
@@ -1978,7 +1978,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
public function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! empty($user->rights->propal->creer))
|
if (! empty($user->rights->propal->creer))
|
||||||
@@ -2031,7 +2031,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set delivery
|
* Set delivery
|
||||||
*
|
*
|
||||||
@@ -2040,7 +2040,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_availability($user, $id, $notrigger = 0)
|
public function set_availability($user, $id, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
||||||
@@ -2102,7 +2102,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set source of demand
|
* Set source of demand
|
||||||
*
|
*
|
||||||
@@ -2111,7 +2111,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_demand_reason($user, $id, $notrigger = 0)
|
public function set_demand_reason($user, $id, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
|
||||||
@@ -2175,7 +2175,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set customer reference number
|
* Set customer reference number
|
||||||
*
|
*
|
||||||
@@ -2184,7 +2184,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_ref_client($user, $ref_client, $notrigger = 0)
|
public function set_ref_client($user, $ref_client, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! empty($user->rights->propal->creer))
|
if (! empty($user->rights->propal->creer))
|
||||||
@@ -2240,7 +2240,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set an overall discount on the proposal
|
* Set an overall discount on the proposal
|
||||||
*
|
*
|
||||||
@@ -2249,7 +2249,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_remise_percent($user, $remise, $notrigger = 0)
|
public function set_remise_percent($user, $remise, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$remise=trim($remise)?trim($remise):0;
|
$remise=trim($remise)?trim($remise):0;
|
||||||
@@ -2307,7 +2307,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set an absolute overall discount on the proposal
|
* Set an absolute overall discount on the proposal
|
||||||
*
|
*
|
||||||
@@ -2316,7 +2316,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_remise_absolue($user, $remise, $notrigger = 0)
|
public function set_remise_absolue($user, $remise, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$remise=trim($remise)?trim($remise):0;
|
$remise=trim($remise)?trim($remise):0;
|
||||||
@@ -2385,7 +2385,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function reopen($user, $statut, $note = '', $notrigger = 0)
|
public function reopen($user, $statut, $note = '', $notrigger = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->statut = $statut;
|
$this->statut = $statut;
|
||||||
@@ -2446,7 +2446,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function cloture($user, $statut, $note = "", $notrigger = 0)
|
public function cloture($user, $statut, $note = "", $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
@@ -2549,7 +2549,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function classifyBilled(User $user, $notrigger = 0)
|
public function classifyBilled(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -2597,7 +2597,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@@ -2605,7 +2605,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function set_draft($user, $notrigger = 0)
|
public function set_draft($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -2656,7 +2656,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of proposal (eventually filtered on user) into an array
|
* Return list of proposal (eventually filtered on user) into an array
|
||||||
*
|
*
|
||||||
@@ -2670,7 +2670,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC')
|
public function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
@@ -2739,19 +2739,19 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
*
|
*
|
||||||
* @return array Array of invoices
|
* @return array Array of invoices
|
||||||
*/
|
*/
|
||||||
function getInvoiceArrayList()
|
public function getInvoiceArrayList()
|
||||||
{
|
{
|
||||||
return $this->InvoiceArrayList($this->id);
|
return $this->InvoiceArrayList($this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns an array with id and ref of related invoices
|
* Returns an array with id and ref of related invoices
|
||||||
*
|
*
|
||||||
* @param int $id Id propal
|
* @param int $id Id propal
|
||||||
* @return array Array of invoices id
|
* @return array Array of invoices id
|
||||||
*/
|
*/
|
||||||
function InvoiceArrayList($id)
|
public function InvoiceArrayList($id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$ga = array();
|
$ga = array();
|
||||||
@@ -2838,7 +2838,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int 1 if ok, otherwise if error
|
* @return int 1 if ok, otherwise if error
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
public function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@@ -2962,7 +2962,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
* @deprecated use set_availability
|
* @deprecated use set_availability
|
||||||
*/
|
*/
|
||||||
function availability($availability_id, $notrigger = 0)
|
public function availability($availability_id, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -3024,7 +3024,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Change source demand
|
* Change source demand
|
||||||
*
|
*
|
||||||
@@ -3033,7 +3033,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @return int >0 si ok, <0 si ko
|
* @return int >0 si ok, <0 si ko
|
||||||
* @deprecated use set_demand_reason
|
* @deprecated use set_demand_reason
|
||||||
*/
|
*/
|
||||||
function demand_reason($demand_reason_id, $notrigger = 0)
|
public function demand_reason($demand_reason_id, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
@@ -3103,7 +3103,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $id Proposal id
|
* @param int $id Proposal id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT c.rowid, ";
|
$sql = "SELECT c.rowid, ";
|
||||||
$sql.= " c.datec, c.date_valid as datev, c.date_cloture as dateo,";
|
$sql.= " c.datec, c.date_valid as datev, c.date_cloture as dateo,";
|
||||||
@@ -3158,12 +3158,12 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut, $mode);
|
return $this->LibStatut($this->statut, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of a status (draft, validated, ...)
|
* Return label of a status (draft, validated, ...)
|
||||||
*
|
*
|
||||||
@@ -3171,7 +3171,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @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
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode = 1)
|
public function LibStatut($statut, $mode = 1)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -3210,7 +3210,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
@@ -3218,7 +3218,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $mode "opened" for proposal to close, "signed" for proposal to invoice
|
* @param int $mode "opened" for proposal to close, "signed" for proposal to invoice
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
function load_board($user, $mode)
|
public function load_board($user, $mode)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -3300,7 +3300,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -3386,13 +3386,13 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Charge indicateurs this->nb de tableau de bord
|
* Charge indicateurs this->nb de tableau de bord
|
||||||
*
|
*
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function load_state_board()
|
public function load_state_board()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
@@ -3438,7 +3438,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param Societe $soc Object thirdparty
|
* @param Societe $soc Object thirdparty
|
||||||
* @return string Reference libre pour la propale
|
* @return string Reference libre pour la propale
|
||||||
*/
|
*/
|
||||||
function getNextNumRef($soc)
|
public function getNextNumRef($soc)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
@@ -3500,7 +3500,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @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
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
@@ -3574,7 +3574,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
|
|||||||
*
|
*
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getLinesArray()
|
public function getLinesArray()
|
||||||
{
|
{
|
||||||
return $this->fetch_lines();
|
return $this->fetch_lines();
|
||||||
}
|
}
|
||||||
@@ -3754,7 +3754,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db= $db;
|
$this->db= $db;
|
||||||
}
|
}
|
||||||
@@ -3765,7 +3765,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
* @param int $rowid Propal line id
|
* @param int $rowid Propal line id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
public function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.vat_src_code, pd.tva_tx,';
|
$sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.vat_src_code, pd.tva_tx,';
|
||||||
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
|
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
|
||||||
@@ -3859,7 +3859,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function insert($notrigger = 0)
|
public function insert($notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
@@ -4002,7 +4002,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function delete(User $user, $notrigger = 0)
|
public function delete(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -4056,7 +4056,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function update($notrigger = 0)
|
public function update($notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
@@ -4178,14 +4178,14 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update DB line fields total_xxx
|
* Update DB line fields total_xxx
|
||||||
* Used by migration
|
* Used by migration
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_total()
|
public function update_total()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ class PropaleStats extends Stats
|
|||||||
*/
|
*/
|
||||||
public $table_element;
|
public $table_element;
|
||||||
|
|
||||||
var $socid;
|
public $socid;
|
||||||
var $userid;
|
public $userid;
|
||||||
|
|
||||||
var $from;
|
public $from;
|
||||||
var $field;
|
public $field;
|
||||||
var $where;
|
public $where;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +56,7 @@ class PropaleStats extends Stats
|
|||||||
* @param int $userid Id user for filter (creation user)
|
* @param int $userid Id user for filter (creation user)
|
||||||
* @param string $mode Option ('customer', 'supplier')
|
* @param string $mode Option ('customer', 'supplier')
|
||||||
*/
|
*/
|
||||||
function __construct($db, $socid = 0, $userid = 0, $mode = 'customer')
|
public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer')
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ class PropaleStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array with number by month
|
* @return array Array with number by month
|
||||||
*/
|
*/
|
||||||
function getNbByMonth($year, $format = 0)
|
public function getNbByMonth($year, $format = 0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class PropaleStats extends Stats
|
|||||||
* @return array Array with number by year
|
* @return array Array with number by year
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getNbByYear()
|
public function getNbByYear()
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ class PropaleStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array with amount by month
|
* @return array Array with amount by month
|
||||||
*/
|
*/
|
||||||
function getAmountByMonth($year, $format)
|
public function getAmountByMonth($year, $format)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ class PropaleStats extends Stats
|
|||||||
* @param int $year year for stats
|
* @param int $year year for stats
|
||||||
* @return array array with number by month
|
* @return array array with number by month
|
||||||
*/
|
*/
|
||||||
function getAverageByMonth($year)
|
public function getAverageByMonth($year)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ class PropaleStats extends Stats
|
|||||||
*
|
*
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAllByYear()
|
public function getAllByYear()
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ class PropaleStats extends Stats
|
|||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAllByProduct($year)
|
public function getAllByProduct($year)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class Localtax extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class Localtax extends CommonObject
|
|||||||
* @param User $user User that create
|
* @param User $user User that create
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function create($user)
|
public function create($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ class Localtax extends CommonObject
|
|||||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update(User $user, $notrigger = 0)
|
public function update(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ class Localtax extends CommonObject
|
|||||||
* @param int $id Object id
|
* @param int $id Object id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
@@ -292,7 +292,7 @@ class Localtax extends CommonObject
|
|||||||
* @param User $user User that delete
|
* @param User $user User that delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
public function delete($user)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LOCALTAX_DELETE', $user);
|
$result=$this->call_trigger('LOCALTAX_DELETE', $user);
|
||||||
@@ -322,7 +322,7 @@ class Localtax extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ class Localtax extends CommonObject
|
|||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
*/
|
*/
|
||||||
function solde($year = 0)
|
public function solde($year = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$reglee = $this->localtax_sum_reglee($year);
|
$reglee = $this->localtax_sum_reglee($year);
|
||||||
@@ -358,14 +358,14 @@ class Localtax extends CommonObject
|
|||||||
return $solde;
|
return $solde;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Total de la localtax des factures emises par la societe.
|
* Total de la localtax des factures emises par la societe.
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
*/
|
*/
|
||||||
function localtax_sum_collectee($year = 0)
|
public function localtax_sum_collectee($year = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "SELECT sum(f.localtax) as amount";
|
$sql = "SELECT sum(f.localtax) as amount";
|
||||||
@@ -398,14 +398,14 @@ class Localtax extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* localtax payed
|
* localtax payed
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
*/
|
*/
|
||||||
function localtax_sum_payee($year = 0)
|
public function localtax_sum_payee($year = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class Localtax extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* localtax payed
|
* localtax payed
|
||||||
* Total de la localtax payed
|
* Total de la localtax payed
|
||||||
@@ -448,7 +448,7 @@ class Localtax extends CommonObject
|
|||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
*/
|
*/
|
||||||
function localtax_sum_reglee($year = 0)
|
public function localtax_sum_reglee($year = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
|
||||||
@@ -489,7 +489,7 @@ class Localtax extends CommonObject
|
|||||||
* @param User $user Object user that insert
|
* @param User $user Object user that insert
|
||||||
* @return int <0 if KO, rowid in localtax table if OK
|
* @return int <0 if KO, rowid in localtax table if OK
|
||||||
*/
|
*/
|
||||||
function addPayment($user)
|
public function addPayment($user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -596,21 +596,20 @@ class Localtax extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update the link betwen localtax payment and the line into llx_bank
|
* Update the link betwen localtax payment and the line into llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id Id bank account
|
* @param int $id Id bank account
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_fk_bank($id)
|
public function update_fk_bank($id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id;
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -628,7 +627,7 @@ class Localtax extends CommonObject
|
|||||||
* @param string $option Sur quoi pointe le lien
|
* @param string $option Sur quoi pointe le lien
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '')
|
public function getNomUrl($withpicto = 0, $option = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -652,12 +651,12 @@ class Localtax extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle
|
* @return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut, $mode);
|
return $this->LibStatut($this->statut, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@@ -665,7 +664,7 @@ class Localtax extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
function LibStatut($status, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param string $filename Filename of withdraw receipt
|
* @param string $filename Filename of withdraw receipt
|
||||||
*/
|
*/
|
||||||
function __construct($db, $filename = '')
|
public function __construct($db, $filename = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$this->fetched = 0;
|
$this->fetched = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add invoice to withdrawal
|
* Add invoice to withdrawal
|
||||||
*
|
*
|
||||||
@@ -126,7 +126,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $number_key number key of account number
|
* @param string $number_key number key of account number
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
public function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -184,7 +184,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $number_key number key of account number
|
* @param string $number_key number key of account number
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
public function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
||||||
{
|
{
|
||||||
$result = -1;
|
$result = -1;
|
||||||
$concat = 0;
|
$concat = 0;
|
||||||
@@ -258,7 +258,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param int $error Id of error
|
* @param int $error Id of error
|
||||||
* @return string Error string
|
* @return string Error string
|
||||||
*/
|
*/
|
||||||
function getErrorString($error)
|
public function getErrorString($error)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $ref Ref of direct debit
|
* @param string $ref Ref of direct debit
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($rowid, $ref = '')
|
public function fetch($rowid, $ref = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -331,13 +331,13 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set credite and set status of linked invoices. Still used ??
|
* Set credite and set status of linked invoices. Still used ??
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function set_credite()
|
public function set_credite()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$conf;
|
global $user,$conf;
|
||||||
@@ -410,7 +410,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set direct debit order to "credited" status.
|
* Set direct debit order to "credited" status.
|
||||||
*
|
*
|
||||||
@@ -418,7 +418,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param int $date date of action
|
* @param int $date date of action
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function set_infocredit($user, $date)
|
public function set_infocredit($user, $date)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -557,7 +557,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set withdrawal to transmited status
|
* Set withdrawal to transmited status
|
||||||
*
|
*
|
||||||
@@ -566,7 +566,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $method method of transmision to bank
|
* @param string $method method of transmision to bank
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function set_infotrans($user, $date, $method)
|
public function set_infotrans($user, $date, $method)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -683,13 +683,13 @@ class BonPrelevement extends CommonObject
|
|||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns amount of withdrawal
|
* Returns amount of withdrawal
|
||||||
*
|
*
|
||||||
* @return double Total amount
|
* @return double Total amount
|
||||||
*/
|
*/
|
||||||
function SommeAPrelever()
|
public function SommeAPrelever()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -722,7 +722,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get number of invoices to withdrawal
|
* Get number of invoices to withdrawal
|
||||||
* TODO delete params banque and agence when not necesary
|
* TODO delete params banque and agence when not necesary
|
||||||
@@ -731,7 +731,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param int $agence dolibarr mysoc agence
|
* @param int $agence dolibarr mysoc agence
|
||||||
* @return int <O if KO, number of invoices if OK
|
* @return int <O if KO, number of invoices if OK
|
||||||
*/
|
*/
|
||||||
function NbFactureAPrelever($banque = 0, $agence = 0)
|
public function NbFactureAPrelever($banque = 0, $agence = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -765,7 +765,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Create a withdraw
|
* Create a withdraw
|
||||||
* TODO delete params banque and agence when not necesary
|
* TODO delete params banque and agence when not necesary
|
||||||
@@ -777,7 +777,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $executiondate Date to execute the transfer
|
* @param string $executiondate Date to execute the transfer
|
||||||
* @return int <0 if KO, nbre of invoice withdrawed if OK
|
* @return int <0 if KO, nbre of invoice withdrawed if OK
|
||||||
*/
|
*/
|
||||||
function Create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL', $executiondate = '')
|
public function Create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL', $executiondate = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -1138,7 +1138,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param User $user Object user that delete
|
* @param User $user Object user that delete
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function delete($user = null)
|
public function delete($user = null)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@@ -1178,7 +1178,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $option link target
|
* @param string $option link target
|
||||||
* @return string URL of target
|
* @return string URL of target
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '')
|
public function getNomUrl($withpicto = 0, $option = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -1200,14 +1200,14 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete a notification def by id
|
* Delete a notification def by id
|
||||||
*
|
*
|
||||||
* @param int $rowid id of notification
|
* @param int $rowid id of notification
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function DeleteNotificationById($rowid)
|
public function DeleteNotificationById($rowid)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -1225,7 +1225,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete a notification
|
* Delete a notification
|
||||||
*
|
*
|
||||||
@@ -1233,7 +1233,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $action notification action
|
* @param string $action notification action
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function DeleteNotification($user, $action)
|
public function DeleteNotification($user, $action)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -1251,7 +1251,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add a notification
|
* Add a notification
|
||||||
*
|
*
|
||||||
@@ -1260,7 +1260,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $action notification action
|
* @param string $action notification action
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function AddNotification($db, $user, $action)
|
public function AddNotification($db, $user, $action)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -1299,7 +1299,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $executiondate Date to execute transfer
|
* @param string $executiondate Date to execute transfer
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function generate($format = 'ALL', $executiondate = '')
|
public function generate($format = 'ALL', $executiondate = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -1478,7 +1478,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write recipient of request (customer)
|
* Write recipient of request (customer)
|
||||||
*
|
*
|
||||||
@@ -1493,7 +1493,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $rib_dom rib domiciliation
|
* @param string $rib_dom rib domiciliation
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '')
|
public function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
fputs($this->file, "06");
|
fputs($this->file, "06");
|
||||||
@@ -1559,14 +1559,14 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $row_drum Id of customer bank account (rib.rowid)
|
* @param string $row_drum Id of customer bank account (rib.rowid)
|
||||||
* @return string RUM number
|
* @return string RUM number
|
||||||
*/
|
*/
|
||||||
static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$pre = $langs->trans('RUM').'-';
|
$pre = $langs->trans('RUM').'-';
|
||||||
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write recipient of request (customer)
|
* Write recipient of request (customer)
|
||||||
*
|
*
|
||||||
@@ -1588,7 +1588,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $row_drum rib.rowid used to generate rum
|
* @param string $row_drum rib.rowid used to generate rum
|
||||||
* @return string Return string with SEPA part DrctDbtTxInf
|
* @return string Return string with SEPA part DrctDbtTxInf
|
||||||
*/
|
*/
|
||||||
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -1646,13 +1646,13 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write sender of request (me)
|
* Write sender of request (me)
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function EnregEmetteur()
|
public function EnregEmetteur()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
fputs($this->file, "03");
|
fputs($this->file, "03");
|
||||||
@@ -1713,7 +1713,7 @@ class BonPrelevement extends CommonObject
|
|||||||
fputs($this->file, "\n");
|
fputs($this->file, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write sender of request (me).
|
* Write sender of request (me).
|
||||||
* Note: The tag PmtInf is opened here but closed into caller
|
* Note: The tag PmtInf is opened here but closed into caller
|
||||||
@@ -1726,7 +1726,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $format FRST or RCUR or ALL
|
* @param string $format FRST or RCUR or ALL
|
||||||
* @return string String with SEPA Sender
|
* @return string String with SEPA Sender
|
||||||
*/
|
*/
|
||||||
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST')
|
public function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
// SEPA INITIALISATION
|
// SEPA INITIALISATION
|
||||||
@@ -1836,14 +1836,14 @@ class BonPrelevement extends CommonObject
|
|||||||
return $XML_SEPA_INFO;
|
return $XML_SEPA_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write end
|
* Write end
|
||||||
*
|
*
|
||||||
* @param int $total total amount
|
* @param int $total total amount
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function EnregTotal($total)
|
public function EnregTotal($total)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
fputs($this->file, "08");
|
fputs($this->file, "08");
|
||||||
@@ -1905,12 +1905,12 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut, $mode);
|
return $this->LibStatut($this->statut, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return status label for a status
|
* Return status label for a status
|
||||||
*
|
*
|
||||||
@@ -1918,7 +1918,7 @@ class BonPrelevement extends CommonObject
|
|||||||
* @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
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode = 0)
|
public function LibStatut($statut, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($this->labelstatut))
|
if (empty($this->labelstatut))
|
||||||
@@ -1937,32 +1937,32 @@ class BonPrelevement extends CommonObject
|
|||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut];
|
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut];
|
||||||
if ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut];
|
elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut];
|
||||||
if ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut];
|
elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1');
|
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1');
|
||||||
if ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3');
|
elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3');
|
||||||
if ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6');
|
elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut];
|
if ($statut==0) return img_picto($this->labelstatut[$statut], 'statut1').' '.$this->labelstatut[$statut];
|
||||||
if ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut];
|
elseif ($statut==1) return img_picto($this->labelstatut[$statut], 'statut3').' '.$this->labelstatut[$statut];
|
||||||
if ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut];
|
elseif ($statut==2) return img_picto($this->labelstatut[$statut], 'statut6').' '.$this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
||||||
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3');
|
elseif ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3');
|
||||||
if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
elseif ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut1');
|
||||||
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3');
|
elseif ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut3');
|
||||||
if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
elseif ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut], 'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class PaymentSalary extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->element = 'payment_salary';
|
$this->element = 'payment_salary';
|
||||||
@@ -108,7 +108,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = null, $notrigger = 0)
|
public function update($user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param User $user User that load
|
* @param User $user User that load
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $user = null)
|
public function fetch($id, $user = null)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
@@ -265,7 +265,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param User $user User that delete
|
* @param User $user User that delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
public function delete($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ class PaymentSalary extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param User $user User that create
|
* @param User $user User that create
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function create($user)
|
public function create($user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -509,14 +509,14 @@ class PaymentSalary extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update link between payment salary and line generate into llx_bank
|
* Update link between payment salary and line generate into llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id_bank Id bank account
|
* @param int $id_bank Id bank account
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_fk_bank($id_bank)
|
public function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
|
||||||
@@ -544,7 +544,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string Chaine with URL
|
* @return string Chaine with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs, $hookmanager;
|
global $db, $conf, $langs, $hookmanager;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@@ -614,7 +614,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $id Id of record
|
* @param int $id Id of record
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author';
|
$sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps';
|
||||||
@@ -652,12 +652,12 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle
|
* @return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut, $mode);
|
return $this->LibStatut($this->statut, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@@ -665,7 +665,7 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
function LibStatut($status, $mode = 0)
|
public function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ class SalariesStats extends Stats
|
|||||||
*/
|
*/
|
||||||
public $table_element;
|
public $table_element;
|
||||||
|
|
||||||
var $socid;
|
public $socid;
|
||||||
var $userid;
|
public $userid;
|
||||||
|
|
||||||
var $from;
|
public $from;
|
||||||
var $field;
|
public $field;
|
||||||
var $where;
|
public $where;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -49,7 +49,7 @@ class SalariesStats extends Stats
|
|||||||
* @param mixed $userid Id user for filter or array of user ids
|
* @param mixed $userid Id user for filter or array of user ids
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function __construct($db, $socid = 0, $userid = 0)
|
public function __construct($db, $socid = 0, $userid = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -62,8 +62,7 @@ class SalariesStats extends Stats
|
|||||||
$this->field='amount';
|
$this->field='amount';
|
||||||
|
|
||||||
$this->where.= " entity = ".$conf->entity;
|
$this->where.= " entity = ".$conf->entity;
|
||||||
if ($this->socid)
|
if ($this->socid) {
|
||||||
{
|
|
||||||
$this->where.=" AND fk_soc = ".$this->socid;
|
$this->where.=" AND fk_soc = ".$this->socid;
|
||||||
}
|
}
|
||||||
if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',', $this->userid).')';
|
if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',', $this->userid).')';
|
||||||
@@ -76,7 +75,7 @@ class SalariesStats extends Stats
|
|||||||
*
|
*
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getNbByYear()
|
public function getNbByYear()
|
||||||
{
|
{
|
||||||
$sql = "SELECT YEAR(datep) as dm, count(*)";
|
$sql = "SELECT YEAR(datep) as dm, count(*)";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
@@ -94,7 +93,7 @@ class SalariesStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getNbByMonth($year, $format = 0)
|
public function getNbByMonth($year, $format = 0)
|
||||||
{
|
{
|
||||||
$sql = "SELECT MONTH(datep) as dm, count(*)";
|
$sql = "SELECT MONTH(datep) as dm, count(*)";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
@@ -116,7 +115,7 @@ class SalariesStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAmountByMonth($year, $format = 0)
|
public function getAmountByMonth($year, $format = 0)
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datep,'%m') as dm, sum(".$this->field.")";
|
$sql = "SELECT date_format(datep,'%m') as dm, sum(".$this->field.")";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
@@ -136,7 +135,7 @@ class SalariesStats extends Stats
|
|||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAverageByMonth($year)
|
public function getAverageByMonth($year)
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datep,'%m') as dm, avg(".$this->field.")";
|
$sql = "SELECT date_format(datep,'%m') as dm, avg(".$this->field.")";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
@@ -153,7 +152,7 @@ class SalariesStats extends Stats
|
|||||||
*
|
*
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAllByYear()
|
public function getAllByYear()
|
||||||
{
|
{
|
||||||
$sql = "SELECT date_format(datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
$sql = "SELECT date_format(datep,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fonction generant le projet sur le disque
|
* Fonction generant le projet sur le disque
|
||||||
*
|
*
|
||||||
@@ -98,7 +98,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs)
|
public function write_file($object, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $hookmanager, $langs, $user;
|
global $conf, $hookmanager, $langs, $user;
|
||||||
@@ -288,7 +288,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||||
{
|
{
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $langs,$conf,$mysoc;
|
global $langs,$conf,$mysoc;
|
||||||
|
|
||||||
@@ -390,7 +390,7 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fonction generant le projet sur le disque
|
* Fonction generant le projet sur le disque
|
||||||
*
|
*
|
||||||
@@ -105,7 +105,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param null|array $moreparams More parameters
|
* @param null|array $moreparams More parameters
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $hookmanager, $langs, $user, $mysoc;
|
global $conf, $hookmanager, $langs, $user, $mysoc;
|
||||||
@@ -435,7 +435,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||||
{
|
{
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show miscellaneous information (payment mode, payment term, ...)
|
* Show miscellaneous information (payment mode, payment term, ...)
|
||||||
*
|
*
|
||||||
@@ -453,7 +453,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
private function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
@@ -480,7 +480,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show area for the customer to sign
|
* Show area for the customer to sign
|
||||||
*
|
*
|
||||||
@@ -490,7 +490,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param Translate $outputlangs Objet langs
|
* @param Translate $outputlangs Objet langs
|
||||||
* @return int Position pour suite
|
* @return int Position pour suite
|
||||||
*/
|
*/
|
||||||
function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
private function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@@ -531,7 +531,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $langs,$conf,$mysoc;
|
global $langs,$conf,$mysoc;
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
@@ -45,7 +45,7 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
* @param Translate $langs Lang object to use for output
|
* @param Translate $langs Lang object to use for output
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
public function info($langs)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
return $texte;
|
return $texte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
@@ -203,7 +203,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
* @param Translate $langs Lang object to use for output
|
* @param Translate $langs Lang object to use for output
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
public function info($langs)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
return $texte;
|
return $texte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
@@ -203,7 +203,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||||
|
|||||||
@@ -867,7 +867,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -1115,7 +1115,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return int Return height of bottom margin including footer text
|
* @return int Return height of bottom margin including footer text
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string text description
|
* @return string text description
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||||||
* @param Object $shipment Shipment object
|
* @param Object $shipment Shipment object
|
||||||
* @return string Value if OK, 0 if KO
|
* @return string Value if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $shipment)
|
public function getNextValue($objsoc, $shipment)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||||||
return $numFinal;
|
return $numFinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return next free value
|
* Return next free value
|
||||||
*
|
*
|
||||||
@@ -148,7 +148,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||||||
* @param Object $objforref Shipment object
|
* @param Object $objforref Shipment object
|
||||||
* @return string Next free value
|
* @return string Next free value
|
||||||
*/
|
*/
|
||||||
function expedition_get_num($objsoc, $objforref)
|
public function expedition_get_num($objsoc, $objforref)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $objforref);
|
return $this->getNextValue($objsoc, $objforref);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string text description
|
* @return string text description
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
||||||
@@ -71,7 +71,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
return $this->prefix."0501-0001";
|
return $this->prefix."0501-0001";
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return boolean false if conflit, true if ok
|
* @return boolean false if conflit, true if ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
* @param Object $shipment Shipment object
|
* @param Object $shipment Shipment object
|
||||||
* @return string Value if OK, 0 if KO
|
* @return string Value if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $shipment)
|
public function getNextValue($objsoc, $shipment)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
return $this->prefix.$yymm."-".$num;
|
return $this->prefix.$yymm."-".$num;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return next free value
|
* Return next free value
|
||||||
*
|
*
|
||||||
@@ -158,7 +158,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
|||||||
* @param Object $objforref Shipment object
|
* @param Object $objforref Shipment object
|
||||||
* @return string Next free value
|
* @return string Next free value
|
||||||
*/
|
*/
|
||||||
function expedition_get_num($objsoc, $objforref)
|
public function expedition_get_num($objsoc, $objforref)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $objforref);
|
return $this->getNextValue($objsoc, $objforref);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation models
|
* Return list of active generation models
|
||||||
*
|
*
|
||||||
@@ -50,7 +50,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -80,7 +80,7 @@ abstract class ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return boolean true if model can be used
|
* @return boolean true if model can be used
|
||||||
*/
|
*/
|
||||||
function isEnabled()
|
public function isEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ abstract class ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string text description
|
* @return string text description
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
@@ -102,7 +102,7 @@ abstract class ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
@@ -114,7 +114,7 @@ abstract class ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return boolean false if conflict, true if ok
|
* @return boolean false if conflict, true if ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ abstract class ModelNumRefExpedition
|
|||||||
* @param Object $shipment Shipment object
|
* @param Object $shipment Shipment object
|
||||||
* @return string Value
|
* @return string Value
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $shipment)
|
public function getNextValue($objsoc, $shipment)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("NotAvailable");
|
return $langs->trans("NotAvailable");
|
||||||
@@ -137,7 +137,7 @@ abstract class ModelNumRefExpedition
|
|||||||
*
|
*
|
||||||
* @return string Value
|
* @return string Value
|
||||||
*/
|
*/
|
||||||
function getVersion()
|
public function getVersion()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
@@ -204,7 +204,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1=OK, 0=KO
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager;
|
global $user, $langs, $conf, $mysoc, $db, $hookmanager;
|
||||||
@@ -450,8 +450,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1) {
|
||||||
{
|
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
@@ -625,7 +624,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
@@ -770,8 +769,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$pdf->MultiCell(96, 4, $outputlangs->transnoentities("DateCreation")." : ".dol_print_date($object->date_create, "day", false, $outputlangs), 0, 'L');
|
$pdf->MultiCell(96, 4, $outputlangs->transnoentities("DateCreation")." : ".dol_print_date($object->date_create, "day", false, $outputlangs), 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->fk_statut==99)
|
if ($object->fk_statut==99) {
|
||||||
{
|
|
||||||
if ($object->fk_user_refuse > 0) {
|
if ($object->fk_user_refuse > 0) {
|
||||||
$userfee=new User($this->db);
|
$userfee=new User($this->db);
|
||||||
$userfee->fetch($object->fk_user_refuse); $posy+=6;
|
$userfee->fetch($object->fk_user_refuse); $posy+=6;
|
||||||
@@ -840,7 +838,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
* @param string $currency Currency code
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
|
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1062,7 +1060,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return int Return height of bottom margin including footer text
|
* @return int Return height of bottom margin including footer text
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails = $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails = $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return string Text with description
|
* @return string Text with description
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
||||||
@@ -71,7 +71,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
return $this->prefix."0501-0001";
|
return $this->prefix."0501-0001";
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
* @param Object $object Object we need next value for
|
* @param Object $object Object we need next value for
|
||||||
* @return string Value if KO, <0 if KO
|
* @return string Value if KO, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($object)
|
public function getNextValue($object)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $db, $conf,$langs,$user;
|
global $db, $conf,$langs,$user;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
|||||||
* @param Object $object Object we need next value for
|
* @param Object $object Object we need next value for
|
||||||
* @return string Value if KO, <0 if KO
|
* @return string Value if KO, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($object)
|
public function getNextValue($object)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active models generation
|
* Return list of active models generation
|
||||||
*
|
*
|
||||||
@@ -37,7 +37,7 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -52,7 +52,6 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* expensereport_pdf_create
|
* expensereport_pdf_create
|
||||||
*
|
*
|
||||||
@@ -68,7 +67,6 @@ abstract class ModeleExpenseReport extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
|
||||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +87,7 @@ abstract class ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return boolean true if model can be used
|
* @return boolean true if model can be used
|
||||||
*/
|
*/
|
||||||
function isEnabled()
|
public function isEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -99,7 +97,7 @@ abstract class ModeleNumRefExpenseReport
|
|||||||
*
|
*
|
||||||
* @return string Descriptive text
|
* @return string Descriptive text
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@@ -151,9 +149,9 @@ abstract class ModeleNumRefExpenseReport
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
||||||
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
||||||
if ($this->version == 'dolibarr') return DOL_VERSION;
|
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
||||||
if ($this->version) return $this->version;
|
elseif ($this->version) return $this->version;
|
||||||
return $langs->trans("NotAvailable");
|
else return $langs->trans("NotAvailable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class ImportCsv extends ModeleImports
|
|||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param string $datatoimport String code describing import set (ex: 'societe_1')
|
* @param string $datatoimport String code describing import set (ex: 'societe_1')
|
||||||
*/
|
*/
|
||||||
function __construct($db, $datatoimport)
|
public function __construct($db, $datatoimport)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@@ -118,20 +118,20 @@ class ImportCsv extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output header of an example file for this format
|
* Output header of an example file for this format
|
||||||
*
|
*
|
||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_header_example($outputlangs)
|
public function write_header_example($outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output title line of an example file for this format
|
* Output title line of an example file for this format
|
||||||
*
|
*
|
||||||
@@ -139,14 +139,14 @@ class ImportCsv extends ModeleImports
|
|||||||
* @param array $headerlinefields Array of fields name
|
* @param array $headerlinefields Array of fields name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_title_example($outputlangs, $headerlinefields)
|
public function write_title_example($outputlangs, $headerlinefields)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$s=join($this->separator, array_map('cleansep', $headerlinefields));
|
$s=join($this->separator, array_map('cleansep', $headerlinefields));
|
||||||
return $s."\n";
|
return $s."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output record of an example file for this format
|
* Output record of an example file for this format
|
||||||
*
|
*
|
||||||
@@ -154,21 +154,21 @@ class ImportCsv extends ModeleImports
|
|||||||
* @param array $contentlinevalues Array of lines
|
* @param array $contentlinevalues Array of lines
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_record_example($outputlangs, $contentlinevalues)
|
public function write_record_example($outputlangs, $contentlinevalues)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$s=join($this->separator, array_map('cleansep', $contentlinevalues));
|
$s=join($this->separator, array_map('cleansep', $contentlinevalues));
|
||||||
return $s."\n";
|
return $s."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output footer of an example file for this format
|
* Output footer of an example file for this format
|
||||||
*
|
*
|
||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_footer_example($outputlangs)
|
public function write_footer_example($outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return '';
|
return '';
|
||||||
@@ -176,14 +176,14 @@ class ImportCsv extends ModeleImports
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Open input file
|
* Open input file
|
||||||
*
|
*
|
||||||
* @param string $file Path of filename
|
* @param string $file Path of filename
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_open_file($file)
|
public function import_open_file($file)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -209,40 +209,40 @@ class ImportCsv extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return nb of records. File must be closed.
|
* Return nb of records. File must be closed.
|
||||||
*
|
*
|
||||||
* @param string $file Path of filename
|
* @param string $file Path of filename
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_get_nb_of_lines($file)
|
public function import_get_nb_of_lines($file)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return dol_count_nb_of_line($file);
|
return dol_count_nb_of_line($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Input header line from file
|
* Input header line from file
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_read_header()
|
public function import_read_header()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return array of next record in input file.
|
* Return array of next record in input file.
|
||||||
*
|
*
|
||||||
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||||
*/
|
*/
|
||||||
function import_read_record()
|
public function import_read_record()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -293,13 +293,13 @@ class ImportCsv extends ModeleImports
|
|||||||
return $newarrayres;
|
return $newarrayres;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Close file handle
|
* Close file handle
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function import_close_file()
|
public function import_close_file()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
fclose($this->handle);
|
fclose($this->handle);
|
||||||
@@ -307,7 +307,7 @@ class ImportCsv extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Insert a record into database
|
* Insert a record into database
|
||||||
*
|
*
|
||||||
@@ -319,7 +319,7 @@ class ImportCsv extends ModeleImports
|
|||||||
* @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
|
* @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
|
public function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf,$user;
|
global $langs,$conf,$user;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param string $datatoimport String code describing import set (ex: 'societe_1')
|
* @param string $datatoimport String code describing import set (ex: 'societe_1')
|
||||||
*/
|
*/
|
||||||
function __construct($db, $datatoimport)
|
public function __construct($db, $datatoimport)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@@ -125,14 +125,14 @@ class ImportXlsx extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output header of an example file for this format
|
* Output header of an example file for this format
|
||||||
*
|
*
|
||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_header_example($outputlangs)
|
public function write_header_example($outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$conf,$langs;
|
global $user,$conf,$langs;
|
||||||
@@ -158,7 +158,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output title line of an example file for this format
|
* Output title line of an example file for this format
|
||||||
*
|
*
|
||||||
@@ -166,7 +166,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
* @param array $headerlinefields Array of fields name
|
* @param array $headerlinefields Array of fields name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_title_example($outputlangs, $headerlinefields)
|
public function write_title_example($outputlangs, $headerlinefields)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -184,7 +184,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
return ''; // final output will be generated in footer
|
return ''; // final output will be generated in footer
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output record of an example file for this format
|
* Output record of an example file for this format
|
||||||
*
|
*
|
||||||
@@ -192,7 +192,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
* @param array $contentlinevalues Array of lines
|
* @param array $contentlinevalues Array of lines
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_record_example($outputlangs, $contentlinevalues)
|
public function write_record_example($outputlangs, $contentlinevalues)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$col = 0;
|
$col = 0;
|
||||||
@@ -205,14 +205,14 @@ class ImportXlsx extends ModeleImports
|
|||||||
return ''; // final output will be generated in footer
|
return ''; // final output will be generated in footer
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Output footer of an example file for this format
|
* Output footer of an example file for this format
|
||||||
*
|
*
|
||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function write_footer_example($outputlangs)
|
public function write_footer_example($outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
// return the file content as a string
|
// return the file content as a string
|
||||||
@@ -229,14 +229,14 @@ class ImportXlsx extends ModeleImports
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Open input file
|
* Open input file
|
||||||
*
|
*
|
||||||
* @param string $file Path of filename
|
* @param string $file Path of filename
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_open_file($file)
|
public function import_open_file($file)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -253,14 +253,14 @@ class ImportXlsx extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return nb of records. File must be closed.
|
* Return nb of records. File must be closed.
|
||||||
*
|
*
|
||||||
* @param string $file Path of filename
|
* @param string $file Path of filename
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_get_nb_of_lines($file)
|
public function import_get_nb_of_lines($file)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$reader = new PHPExcel_Reader_Excel2007();
|
$reader = new PHPExcel_Reader_Excel2007();
|
||||||
@@ -275,13 +275,13 @@ class ImportXlsx extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Input header line from file
|
* Input header line from file
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function import_read_header()
|
public function import_read_header()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
// This is not called by the import code !!!
|
// This is not called by the import code !!!
|
||||||
@@ -294,13 +294,13 @@ class ImportXlsx extends ModeleImports
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return array of next record in input file.
|
* Return array of next record in input file.
|
||||||
*
|
*
|
||||||
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||||
*/
|
*/
|
||||||
function import_read_record()
|
public function import_read_record()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -319,13 +319,13 @@ class ImportXlsx extends ModeleImports
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Close file handle
|
* Close file handle
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function import_close_file()
|
public function import_close_file()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->workbook->disconnectWorksheets();
|
$this->workbook->disconnectWorksheets();
|
||||||
@@ -334,7 +334,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
|
|
||||||
|
|
||||||
// What is this doing here ? it is common to all imports, is should be in the parent class
|
// What is this doing here ? it is common to all imports, is should be in the parent class
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Insert a record into database
|
* Insert a record into database
|
||||||
*
|
*
|
||||||
@@ -346,7 +346,7 @@ class ImportXlsx extends ModeleImports
|
|||||||
* @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
|
* @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
|
public function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf,$user;
|
global $langs,$conf,$user;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class ModeleImports
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Id
|
* @return string Id
|
||||||
*/
|
*/
|
||||||
function getDriverId()
|
public function getDriverId()
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getDriverLabel()
|
public function getDriverLabel()
|
||||||
{
|
{
|
||||||
return $this->label;
|
return $this->label;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function getDriverDesc()
|
public function getDriverDesc()
|
||||||
{
|
{
|
||||||
return $this->desc;
|
return $this->desc;
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Driver suffix
|
* @return string Driver suffix
|
||||||
*/
|
*/
|
||||||
function getDriverExtension()
|
public function getDriverExtension()
|
||||||
{
|
{
|
||||||
return $this->extension;
|
return $this->extension;
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Driver version
|
* @return string Driver version
|
||||||
*/
|
*/
|
||||||
function getDriverVersion()
|
public function getDriverVersion()
|
||||||
{
|
{
|
||||||
return $this->version;
|
return $this->version;
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Label of external lib
|
* @return string Label of external lib
|
||||||
*/
|
*/
|
||||||
function getLibLabel()
|
public function getLibLabel()
|
||||||
{
|
{
|
||||||
return $this->label_lib;
|
return $this->label_lib;
|
||||||
}
|
}
|
||||||
@@ -149,13 +149,13 @@ class ModeleImports
|
|||||||
*
|
*
|
||||||
* @return string Version of external lib
|
* @return string Version of external lib
|
||||||
*/
|
*/
|
||||||
function getLibVersion()
|
public function getLibVersion()
|
||||||
{
|
{
|
||||||
return $this->version_lib;
|
return $this->version_lib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Charge en memoire et renvoie la liste des modeles actifs
|
* Charge en memoire et renvoie la liste des modeles actifs
|
||||||
*
|
*
|
||||||
@@ -163,7 +163,7 @@ class ModeleImports
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
function liste_modeles($db, $maxfilenamelength = 0)
|
public function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
dol_syslog(get_class($this)."::liste_modeles");
|
dol_syslog(get_class($this)."::liste_modeles");
|
||||||
@@ -213,7 +213,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getPictoForKey($key)
|
public function getPictoForKey($key)
|
||||||
{
|
{
|
||||||
return $this->picto[$key];
|
return $this->picto[$key];
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDriverLabelForKey($key)
|
public function getDriverLabelForKey($key)
|
||||||
{
|
{
|
||||||
return $this->driverlabel[$key];
|
return $this->driverlabel[$key];
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDriverDescForKey($key)
|
public function getDriverDescForKey($key)
|
||||||
{
|
{
|
||||||
return $this->driverdesc[$key];
|
return $this->driverdesc[$key];
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDriverVersionForKey($key)
|
public function getDriverVersionForKey($key)
|
||||||
{
|
{
|
||||||
return $this->driverversion[$key];
|
return $this->driverversion[$key];
|
||||||
}
|
}
|
||||||
@@ -257,7 +257,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getLibLabelForKey($key)
|
public function getLibLabelForKey($key)
|
||||||
{
|
{
|
||||||
return $this->liblabel[$key];
|
return $this->liblabel[$key];
|
||||||
}
|
}
|
||||||
@@ -268,7 +268,7 @@ class ModeleImports
|
|||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getLibVersionForKey($key)
|
public function getLibVersionForKey($key)
|
||||||
{
|
{
|
||||||
return $this->libversion[$key];
|
return $this->libversion[$key];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
@@ -186,7 +186,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1=OK, 0=KO
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||||
@@ -637,7 +637,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show miscellaneous information (payment mode, payment term, ...)
|
* Show miscellaneous information (payment mode, payment term, ...)
|
||||||
*
|
*
|
||||||
@@ -647,7 +647,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
private function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
@@ -678,7 +678,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
* @param int $hidebottom Hide bottom bar of array
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
|
||||||
{
|
{
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
@@ -740,7 +740,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
@@ -918,7 +918,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return int Return height of bottom margin including footer text
|
* @return int Return height of bottom margin including footer text
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
||||||
@@ -76,7 +76,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
return $this->prefix."0501-0001";
|
return $this->prefix."0501-0001";
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
global $langs,$conf,$db;
|
global $langs,$conf,$db;
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
* @param Object $object Object we need next value for
|
* @param Object $object Object we need next value for
|
||||||
* @return string Value if KO, <0 if KO
|
* @return string Value if KO, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $object)
|
public function getNextValue($objsoc, $object)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -138,8 +138,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG);
|
dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj) $max = intval($obj->max);
|
if ($obj) $max = intval($obj->max);
|
||||||
else $max=0;
|
else $max=0;
|
||||||
@@ -161,7 +160,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return next free ref
|
* Return next free ref
|
||||||
*
|
*
|
||||||
@@ -169,7 +168,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
|
|||||||
* @param Object $object Object livraison
|
* @param Object $object Object livraison
|
||||||
* @return string Texte descriptif
|
* @return string Texte descriptif
|
||||||
*/
|
*/
|
||||||
function livraison_get_num($objsoc = 0, $object = '')
|
public function livraison_get_num($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $object);
|
return $this->getNextValue($objsoc, $object);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
* @param Object $object Object delivery
|
* @param Object $object Object delivery
|
||||||
* @return string Value if OK, 0 if KO
|
* @return string Value if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $object)
|
public function getNextValue($objsoc, $object)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -152,13 +152,13 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
* @param string $objforref Object for number to search
|
* @param string $objforref Object for number to search
|
||||||
* @return string Next free value
|
* @return string Next free value
|
||||||
*/
|
*/
|
||||||
function getNumRef($objsoc, $objforref)
|
public function getNumRef($objsoc, $objforref)
|
||||||
{
|
{
|
||||||
return $this->getNextValue($objsoc, $objforref);
|
return $this->getNextValue($objsoc, $objforref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return next free ref
|
* Return next free ref
|
||||||
*
|
*
|
||||||
@@ -166,7 +166,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
* @param Object $object Objet livraison
|
* @param Object $object Objet livraison
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function livraison_get_num($objsoc = 0, $object = '')
|
public function livraison_get_num($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $object);
|
return $this->getNextValue($objsoc, $object);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
@@ -49,7 +49,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -82,7 +82,7 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return boolean true if module can be used
|
* @return boolean true if module can be used
|
||||||
*/
|
*/
|
||||||
function isEnabled()
|
public function isEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
@@ -104,7 +104,7 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
@@ -117,7 +117,7 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
* @param Object $object Object delivery
|
* @param Object $object Object delivery
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc, $object)
|
public function getNextValue($objsoc, $object)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("NotAvailable");
|
return $langs->trans("NotAvailable");
|
||||||
@@ -140,15 +140,15 @@ abstract class ModeleNumRefDeliveryOrder
|
|||||||
*
|
*
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getVersion()
|
public function getVersion()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
|
||||||
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
|
||||||
if ($this->version == 'dolibarr') return DOL_VERSION;
|
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
||||||
if ($this->version) return $this->version;
|
elseif ($this->version) return $this->version;
|
||||||
return $langs->trans("NotAvailable");
|
else return $langs->trans("NotAvailable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_contacts1 extends MailingTargets
|
class mailing_contacts1 extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='ContactCompanies'; // Identifiant du module mailing
|
public $name='ContactCompanies'; // Identifiant du module mailing
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='Contacts of thirdparties (prospects, customers, suppliers...)';
|
public $desc='Contacts of thirdparties (prospects, customers, suppliers...)';
|
||||||
var $require_module=array("societe"); // Module mailing actif si modules require_module actifs
|
public $require_module=array("societe"); // Module mailing actif si modules require_module actifs
|
||||||
var $require_admin=0; // Module mailing actif pour user admin ou non
|
public $require_admin=0; // Module mailing actif pour user admin ou non
|
||||||
var $picto='contact';
|
public $picto='contact';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -50,7 +50,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string[] Array with SQL requests
|
* @return string[] Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
* @param string $sql Requete sql de comptage
|
* @param string $sql Requete sql de comptage
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -320,20 +320,20 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$id.'">'.img_object('', "contact").'</a>';
|
return '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$id.'">'.img_object('', "contact").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int <0 si erreur, nb ajout si ok
|
* @return int <0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@@ -26,17 +26,17 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
|||||||
class mailing_example extends MailingTargets
|
class mailing_example extends MailingTargets
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Put here a name not already used
|
// CHANGE THIS: Put here a name not already used
|
||||||
var $name='example';
|
public $name='example';
|
||||||
// CHANGE THIS: Put here a description of your selector module.
|
// CHANGE THIS: Put here a description of your selector module.
|
||||||
// This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='Put here a description';
|
public $desc='Put here a description';
|
||||||
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
||||||
var $require_admin=0;
|
public $require_admin=0;
|
||||||
// CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector
|
// CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector
|
||||||
var $tooltip='MyTooltipLangKey';
|
public $tooltip='MyTooltipLangKey';
|
||||||
|
|
||||||
var $require_module=array();
|
public $require_module=array();
|
||||||
var $picto='';
|
public $picto='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -50,20 +50,20 @@ class mailing_example extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* This is the main function that returns the array of emails
|
* This is the main function that returns the array of emails
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of mailing. No need to use it.
|
* @param int $mailing_id Id of mailing. No need to use it.
|
||||||
* @return int <0 if error, number of emails added if ok
|
* @return int <0 if error, number of emails added if ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$target = array();
|
$target = array();
|
||||||
@@ -92,7 +92,7 @@ class mailing_example extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array Array with SQL requests
|
* @return array Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ class mailing_example extends MailingTargets
|
|||||||
* @param string $sql Requete sql de comptage
|
* @param string $sql Requete sql de comptage
|
||||||
* @return int|string Number of recipient or '?'
|
* @return int|string Number of recipient or '?'
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class mailing_example extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string A html select zone
|
* @return string A html select zone
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ class mailing_example extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url link
|
* @return string Url link
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_fraise extends MailingTargets
|
class mailing_fraise extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='FundationMembers'; // Identifiant du module mailing
|
public $name='FundationMembers'; // Identifiant du module mailing
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='Foundation members with emails';
|
public $desc='Foundation members with emails';
|
||||||
// Set to 1 if selector is available for admin users only
|
// Set to 1 if selector is available for admin users only
|
||||||
var $require_admin=0;
|
public $require_admin=0;
|
||||||
|
|
||||||
var $require_module=array('adherent');
|
public $require_module=array('adherent');
|
||||||
var $picto='user';
|
public $picto='user';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -52,7 +52,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string[] Array with SQL requests
|
* @return string[] Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
* @param string $sql Requete sql de comptage
|
* @param string $sql Requete sql de comptage
|
||||||
* @return int Nb of recipients
|
* @return int Nb of recipients
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
$sql = "SELECT count(distinct(a.email)) as nb";
|
$sql = "SELECT count(distinct(a.email)) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||||
@@ -107,7 +107,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -214,20 +214,20 @@ class mailing_fraise extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$id.'">'.img_object('', "user").'</a>';
|
return '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$id.'">'.img_object('', "user").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int < 0 si erreur, nb ajout si ok
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$_POST;
|
global $langs,$_POST;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*
|
*
|
||||||
* @return string Return translation of module label. Try translation of $this->name then translation of 'MailingModuleDesc'.$this->name, or $this->desc if not found
|
* @return string Return translation of module label. Try translation of $this->name then translation of 'MailingModuleDesc'.$this->name, or $this->desc if not found
|
||||||
*/
|
*/
|
||||||
function getDesc()
|
public function getDesc()
|
||||||
{
|
{
|
||||||
global $langs, $form;
|
global $langs, $form;
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*
|
*
|
||||||
* @return integer Example
|
* @return integer Example
|
||||||
*/
|
*/
|
||||||
function getNbOfRecords()
|
public function getNbOfRecords()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
* @param string $sql Sql request to count
|
* @param string $sql Sql request to count
|
||||||
* @return int Nb of recipient, or <0 if error
|
* @return int Nb of recipient, or <0 if error
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql)
|
public function getNbOfRecipients($sql)
|
||||||
{
|
{
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -112,19 +112,19 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Met a jour nombre de destinataires
|
* Met a jour nombre de destinataires
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int < 0 si erreur, nb destinataires si ok
|
* @return int < 0 si erreur, nb destinataires si ok
|
||||||
*/
|
*/
|
||||||
function update_nb($mailing_id)
|
public function update_nb($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
// Mise a jour nombre de destinataire dans table des mailings
|
// Mise a jour nombre de destinataire dans table des mailings
|
||||||
@@ -151,7 +151,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
return $nb;
|
return $nb;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
@@ -159,7 +159,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
* @param array $cibles Array with targets
|
* @param array $cibles Array with targets
|
||||||
* @return int < 0 si erreur, nb ajout si ok
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id, $cibles)
|
public function add_to_target($mailing_id, $cibles)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -247,14 +247,14 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
return $j;
|
return $j;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Supprime tous les destinataires de la table des cibles
|
* Supprime tous les destinataires de la table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function clear_target($mailing_id)
|
public function clear_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_pomme extends MailingTargets
|
class mailing_pomme extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='DolibarrUsers'; // Identifiant du module mailing
|
public $name='DolibarrUsers'; // Identifiant du module mailing
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
||||||
var $require_module=array(); // Module mailing actif si modules require_module actifs
|
public $require_module=array(); // Module mailing actif si modules require_module actifs
|
||||||
var $require_admin=1; // Module mailing actif pour user admin ou non
|
public $require_admin=1; // Module mailing actif pour user admin ou non
|
||||||
var $picto='user';
|
public $picto='user';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -48,7 +48,7 @@ class mailing_pomme extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ class mailing_pomme extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string[] Array with SQL requests
|
* @return string[] Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ class mailing_pomme extends MailingTargets
|
|||||||
* @param string $sql SQL request to use to count
|
* @param string $sql SQL request to use to count
|
||||||
* @return int Number of recipients
|
* @return int Number of recipients
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class mailing_pomme extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -140,20 +140,20 @@ class mailing_pomme extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$id.'">'.img_object('', "user").'</a>';
|
return '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$id.'">'.img_object('', "user").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int < 0 si erreur, nb ajout si ok
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_thirdparties extends MailingTargets
|
class mailing_thirdparties extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='ThirdPartiesByCategories';
|
public $name='ThirdPartiesByCategories';
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc="Third parties (by categories)";
|
public $desc="Third parties (by categories)";
|
||||||
var $require_admin=0;
|
public $require_admin=0;
|
||||||
|
|
||||||
var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
|
public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
|
||||||
var $picto='company';
|
public $picto='company';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -43,7 +43,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@@ -52,14 +52,14 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* This is the main function that returns the array of emails
|
* This is the main function that returns the array of emails
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of mailing. No need to use it.
|
* @param int $mailing_id Id of mailing. No need to use it.
|
||||||
* @return int <0 if error, number of emails added if ok
|
* @return int <0 if error, number of emails added if ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -200,7 +200,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array Array with SQL requests
|
* @return array Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
* @param string $sql Requete sql de comptage
|
* @param string $sql Requete sql de comptage
|
||||||
* @return int Nb of recipients
|
* @return int Nb of recipients
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string A html select zone
|
* @return string A html select zone
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url link
|
* @return string Url link
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$id.'">'.img_object('', "company").'</a>';
|
return '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$id.'">'.img_object('', "company").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,20 +22,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_thirdparties_services_expired extends MailingTargets
|
class mailing_thirdparties_services_expired extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='DolibarrContractsLinesExpired';
|
public $name='DolibarrContractsLinesExpired';
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='Third parties with expired contract\'s lines';
|
public $desc='Third parties with expired contract\'s lines';
|
||||||
var $require_admin=0;
|
public $require_admin=0;
|
||||||
|
|
||||||
var $require_module=array('contrat');
|
public $require_module=array('contrat');
|
||||||
var $picto='company';
|
public $picto='company';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
var $arrayofproducts=array();
|
public $arrayofproducts=array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,7 +43,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -77,14 +77,14 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* This is the main function that returns the array of emails
|
* This is the main function that returns the array of emails
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of mailing. No need to use it.
|
* @param int $mailing_id Id of mailing. No need to use it.
|
||||||
* @return int <0 if error, number of emails added if ok
|
* @return int <0 if error, number of emails added if ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$key=GETPOST('filter', 'int');
|
$key=GETPOST('filter', 'int');
|
||||||
@@ -171,7 +171,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array Array with SQL requests
|
* @return array Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
|
|
||||||
//var $statssql=array();
|
//var $statssql=array();
|
||||||
@@ -189,7 +189,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
* @param string $sql SQL request to use to count
|
* @param string $sql SQL request to use to count
|
||||||
* @return int Number of recipients
|
* @return int Number of recipients
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string A html select zone
|
* @return string A html select zone
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url link
|
* @return string Url link
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$id.'">'.img_object('', "company").'</a>';
|
return '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$id.'">'.img_object('', "company").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_xinputfile extends MailingTargets
|
class mailing_xinputfile extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='EmailsFromFile'; // Identifiant du module mailing
|
public $name='EmailsFromFile'; // Identifiant du module mailing
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
||||||
var $require_module=array(); // Module mailing actif si modules require_module actifs
|
public $require_module=array(); // Module mailing actif si modules require_module actifs
|
||||||
var $require_admin=0; // Module mailing actif pour user admin ou non
|
public $require_admin=0; // Module mailing actif pour user admin ou non
|
||||||
var $picto='generic';
|
public $picto='generic';
|
||||||
var $tooltip='UseFormatFileEmailToTarget';
|
public $tooltip='UseFormatFileEmailToTarget';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,7 +44,7 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array Array with SQL requests
|
* @return array Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
@@ -76,7 +76,7 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
* @param string $sql Sql request to count
|
* @param string $sql Sql request to count
|
||||||
* @return string '' means NA
|
* @return string '' means NA
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans('LineInFile', $id);
|
return $langs->trans('LineInFile', $id);
|
||||||
@@ -101,7 +101,7 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -110,14 +110,14 @@ class mailing_xinputfile extends MailingTargets
|
|||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int < 0 si erreur, nb ajout si ok
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs,$_FILES;
|
global $conf,$langs,$_FILES;
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
*/
|
*/
|
||||||
class mailing_xinputuser extends MailingTargets
|
class mailing_xinputuser extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='EmailsFromUser'; // Identifiant du module mailing
|
public $name='EmailsFromUser'; // Identifiant du module mailing
|
||||||
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
|
||||||
var $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
||||||
var $require_module=array(); // Module mailing actif si modules require_module actifs
|
public $require_module=array(); // Module mailing actif si modules require_module actifs
|
||||||
var $require_admin=0; // Module mailing actif pour user admin ou non
|
public $require_admin=0; // Module mailing actif pour user admin ou non
|
||||||
var $picto='generic';
|
public $picto='generic';
|
||||||
var $tooltip='UseFormatInputEmailToTarget';
|
public $tooltip='UseFormatInputEmailToTarget';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,7 +44,7 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array Array with SQL requests
|
* @return array Array with SQL requests
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
@@ -76,7 +76,7 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
* @param string $sql Sql request to count
|
* @param string $sql Sql request to count
|
||||||
* @return string '' means NA
|
* @return string '' means NA
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql = '')
|
public function getNbOfRecipients($sql = '')
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -108,14 +108,14 @@ class mailing_xinputuser extends MailingTargets
|
|||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int < 0 si erreur, nb ajout si ok
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs,$_FILES;
|
global $conf,$langs,$_FILES;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
* @param Translate $langs Lang object to use for output
|
* @param Translate $langs Lang object to use for output
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
public function info($langs)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
return $texte;
|
return $texte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
@@ -197,7 +197,7 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
*
|
*
|
||||||
* @return string Text with description
|
* @return string Text with description
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
|
||||||
@@ -84,7 +84,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
return $this->prefix."0501-0001";
|
return $this->prefix."0501-0001";
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
*
|
*
|
||||||
* @return boolean false si conflit, true si ok
|
* @return boolean false si conflit, true si ok
|
||||||
*/
|
*/
|
||||||
function canBeActivated()
|
public function canBeActivated()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @return string Value if OK, 0 if KO
|
* @return string Value if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc = 0, $object = '')
|
public function getNextValue($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoie la reference de commande suivante non utilisee
|
* Renvoie la reference de commande suivante non utilisee
|
||||||
*
|
*
|
||||||
@@ -171,7 +171,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
|
|||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function commande_get_num($objsoc = 0, $object = '')
|
public function commande_get_num($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $object);
|
return $this->getNextValue($objsoc, $object);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$mysoc;
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @return string Value if OK, 0 if KO
|
* @return string Value if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc = 0, $object = '')
|
public function getNextValue($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoie la reference de commande suivante non utilisee
|
* Renvoie la reference de commande suivante non utilisee
|
||||||
*
|
*
|
||||||
@@ -154,7 +154,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function commande_get_num($objsoc = 0, $object = '')
|
public function commande_get_num($objsoc = 0, $object = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->getNextValue($objsoc, $object);
|
return $this->getNextValue($objsoc, $object);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation models
|
* Return list of active generation models
|
||||||
*
|
*
|
||||||
@@ -51,7 +51,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
@@ -209,7 +209,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1=OK, 0=KO
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs = '', $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs = '', $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$hookmanager,$mysoc,$nblignes;
|
global $user,$langs,$conf,$hookmanager,$mysoc,$nblignes;
|
||||||
@@ -708,7 +708,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show payments table
|
* Show payments table
|
||||||
*
|
*
|
||||||
@@ -718,13 +718,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param Translate $outputlangs Object langs for output
|
* @param Translate $outputlangs Object langs for output
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
private function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show miscellaneous information (payment mode, payment term, ...)
|
* Show miscellaneous information (payment mode, payment term, ...)
|
||||||
*
|
*
|
||||||
@@ -734,7 +734,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
private function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -789,7 +789,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
return $posy;
|
return $posy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show total to pay
|
* Show total to pay
|
||||||
*
|
*
|
||||||
@@ -800,7 +800,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param Translate $outputlangs Objet langs
|
* @param Translate $outputlangs Objet langs
|
||||||
* @return int Position pour suite
|
* @return int Position pour suite
|
||||||
*/
|
*/
|
||||||
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
@@ -1017,7 +1017,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param string $currency Currency code
|
* @param string $currency Currency code
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
|
private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1126,7 +1126,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
private function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $mysoc;
|
global $langs, $conf, $mysoc;
|
||||||
|
|
||||||
@@ -1371,7 +1371,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return int Return height of bottom margin including footer text
|
* @return int Return height of bottom margin including footer text
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -1500,7 +1500,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
* @param int $hidefreetext 1=Hide free text
|
* @param int $hidefreetext 1=Hide free text
|
||||||
* @return int Return height of bottom margin including footer text
|
* @return int Return height of bottom margin including footer text
|
||||||
*/
|
*/
|
||||||
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
* @param Translate $langs Lang object to use for output
|
* @param Translate $langs Lang object to use for output
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
public function info($langs)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
return $texte;
|
return $texte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
@@ -215,7 +215,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user, $langs, $conf, $mysoc, $hookmanager;
|
global $user, $langs, $conf, $mysoc, $hookmanager;
|
||||||
@@ -439,7 +439,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get substitution array for object
|
* get substitution array for object
|
||||||
*
|
*
|
||||||
@@ -448,7 +448,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
* @param string $array_key key for array
|
* @param string $array_key key for array
|
||||||
* @return array array of substitutions
|
* @return array array of substitutions
|
||||||
*/
|
*/
|
||||||
function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
|
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$array_other = array();
|
$array_other = array();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ abstract class ModelePDFUser extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
@@ -52,7 +52,7 @@ abstract class ModelePDFUser extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
* @param Translate $langs Lang object to use for output
|
* @param Translate $langs Lang object to use for output
|
||||||
* @return string Description
|
* @return string Description
|
||||||
*/
|
*/
|
||||||
function info($langs)
|
public function info($langs)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
return $texte;
|
return $texte;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to build a document on disk using the generic odt module.
|
* Function to build a document on disk using the generic odt module.
|
||||||
*
|
*
|
||||||
@@ -218,7 +218,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user, $langs, $conf, $mysoc, $hookmanager;
|
global $user, $langs, $conf, $mysoc, $hookmanager;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
@@ -52,7 +52,7 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -121,13 +121,20 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||||
|
|
||||||
// Filter by status
|
// Filter by status
|
||||||
if ($status == 'draft') $sql.= " AND t.fk_statut IN (0)";
|
if ($status == 'draft') {
|
||||||
if ($status == 'unpaid') $sql.= " AND t.fk_statut IN (1)";
|
$sql.= " AND t.fk_statut IN (0)";
|
||||||
if ($status == 'paid') $sql.= " AND t.fk_statut IN (2)";
|
}
|
||||||
if ($status == 'cancelled') $sql.= " AND t.fk_statut IN (3)";
|
if ($status == 'unpaid') {
|
||||||
|
$sql.= " AND t.fk_statut IN (1)";
|
||||||
|
}
|
||||||
|
if ($status == 'paid') {
|
||||||
|
$sql.= " AND t.fk_statut IN (2)";
|
||||||
|
}
|
||||||
|
if ($status == 'cancelled') {
|
||||||
|
$sql.= " AND t.fk_statut IN (3)";
|
||||||
|
}
|
||||||
// Insert sale filter
|
// Insert sale filter
|
||||||
if ($search_sale > 0)
|
if ($search_sale > 0) {
|
||||||
{
|
|
||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
}
|
}
|
||||||
// Add sql filters
|
// Add sql filters
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
|||||||
*/
|
*/
|
||||||
class Fournisseur extends Societe
|
class Fournisseur extends Societe
|
||||||
{
|
{
|
||||||
var $next_prev_filter="te.fournisseur = 1"; // Used to add a filter in Form::showrefnav method
|
public $next_prev_filter="te.fournisseur = 1"; // Used to add a filter in Form::showrefnav method
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +41,7 @@ class Fournisseur extends Societe
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ class Fournisseur extends Societe
|
|||||||
*
|
*
|
||||||
* @return int Nb of orders
|
* @return int Nb of orders
|
||||||
*/
|
*/
|
||||||
function getNbOfOrders()
|
public function getNbOfOrders()
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
||||||
@@ -81,7 +81,7 @@ class Fournisseur extends Societe
|
|||||||
*
|
*
|
||||||
* @return int Nb of ref prices, or <0 if error
|
* @return int Nb of ref prices, or <0 if error
|
||||||
*/
|
*/
|
||||||
function nbOfProductRefs()
|
public function nbOfProductRefs()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -102,13 +102,13 @@ class Fournisseur extends Societe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load statistics indicators
|
* Load statistics indicators
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function load_state_board()
|
public function load_state_board()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
@@ -145,7 +145,7 @@ class Fournisseur extends Societe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Create a supplier category
|
* Create a supplier category
|
||||||
*
|
*
|
||||||
@@ -153,7 +153,7 @@ class Fournisseur extends Societe
|
|||||||
* @param string $name Category name
|
* @param string $name Category name
|
||||||
* @return int <0 if KO, 0 if OK
|
* @return int <0 if KO, 0 if OK
|
||||||
*/
|
*/
|
||||||
function CreateCategory($user, $name)
|
public function CreateCategory($user, $name)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)";
|
||||||
@@ -175,13 +175,13 @@ class Fournisseur extends Societe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return the suppliers list
|
* Return the suppliers list
|
||||||
*
|
*
|
||||||
* @return array Array of suppliers
|
* @return array Array of suppliers
|
||||||
*/
|
*/
|
||||||
function ListArray()
|
public function ListArray()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -375,14 +375,14 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load array lines
|
* Load array lines
|
||||||
*
|
*
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
function fetch_lines($only_product = 0)
|
public function fetch_lines($only_product = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
//$result=$this->fetch_lines();
|
//$result=$this->fetch_lines();
|
||||||
@@ -616,7 +616,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
return $this->LibStatut($this->statut, $mode, $this->billed);
|
return $this->LibStatut($this->statut, $mode, $this->billed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of a status
|
* Return label of a status
|
||||||
*
|
*
|
||||||
@@ -625,7 +625,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param int $billed 1=Billed
|
* @param int $billed 1=Billed
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode = 0, $billed = 0)
|
public function LibStatut($statut, $mode = 0, $billed = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -1079,7 +1079,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
return $result ;
|
return $result ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Cancel an approved order.
|
* Cancel an approved order.
|
||||||
* The cancellation is done after approval
|
* The cancellation is done after approval
|
||||||
@@ -1088,7 +1088,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param int $idwarehouse Id warehouse to use for stock change (not used for supplier orders).
|
* @param int $idwarehouse Id warehouse to use for stock change (not used for supplier orders).
|
||||||
* @return int >0 if Ok, <0 if Ko
|
* @return int >0 if Ok, <0 if Ko
|
||||||
*/
|
*/
|
||||||
function Cancel($user, $idwarehouse = -1)
|
public function Cancel($user, $idwarehouse = -1)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
@@ -2006,13 +2006,13 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get list of order methods
|
* Get list of order methods
|
||||||
*
|
*
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function get_methodes_commande()
|
public function get_methodes_commande()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid, libelle";
|
$sql = "SELECT rowid, libelle";
|
||||||
@@ -2093,7 +2093,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set a delivery in database for this supplier order
|
* Set a delivery in database for this supplier order
|
||||||
*
|
*
|
||||||
@@ -2103,7 +2103,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param string $comment Comment
|
* @param string $comment Comment
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function Livraison($user, $date, $type, $comment)
|
public function Livraison($user, $date, $type, $comment)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -2210,7 +2210,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
return $result ;
|
return $result ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set the planned delivery date
|
* Set the planned delivery date
|
||||||
*
|
*
|
||||||
@@ -2219,7 +2219,7 @@ class CommandeFournisseur 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
|
||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
public function set_date_livraison($user, $date_livraison, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
@@ -2276,7 +2276,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set the id projet
|
* Set the id projet
|
||||||
*
|
*
|
||||||
@@ -2285,7 +2285,7 @@ class CommandeFournisseur 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
|
||||||
*/
|
*/
|
||||||
function set_id_projet($user, $id_projet, $notrigger = 0)
|
public function set_id_projet($user, $id_projet, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if ($user->rights->fournisseur->commande->creer)
|
if ($user->rights->fournisseur->commande->creer)
|
||||||
@@ -2739,13 +2739,13 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Charge indicateurs this->nb de tableau de bord
|
* Charge indicateurs this->nb de tableau de bord
|
||||||
*
|
*
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function load_state_board()
|
public function load_state_board()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
@@ -2782,14 +2782,14 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
* @param User $user Objet user
|
* @param User $user Objet user
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
function load_board($user)
|
public function load_board($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -3155,7 +3155,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param int $filtre_statut Filter on shipment status
|
* @param int $filtre_statut Filter on shipment status
|
||||||
* @return int <0 if KO, Nb of lines found if OK
|
* @return int <0 if KO, Nb of lines found if OK
|
||||||
*/
|
*/
|
||||||
function loadReceptions($filtre_statut = -1)
|
public function loadReceptions($filtre_statut = -1)
|
||||||
{
|
{
|
||||||
$this->receptions = array();
|
$this->receptions = array();
|
||||||
|
|
||||||
@@ -3579,7 +3579,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
* @param int $notrigger 1=Disable call to triggers
|
* @param int $notrigger 1=Disable call to triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($notrigger)
|
public function delete($notrigger)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file fourn/class/fournisseur.commande.dispatch.class.php
|
* \file htdocs/fourn/class/fournisseur.commande.dispatch.class.php
|
||||||
* \ingroup fournisseur stock
|
* \ingroup fournisseur stock
|
||||||
* \brief This file is an example for a CRUD class file (Create/Read/Update/Delete)
|
* \brief This file is an example for a CRUD class file (Create/Read/Update/Delete)
|
||||||
* Initialy built by build_class_from_table on 2015-02-24 10:38
|
* Initialy built by build_class_from_table on 2015-02-24 10:38
|
||||||
@@ -26,8 +26,6 @@
|
|||||||
// Put here all includes required by your class file
|
// Put here all includes required by your class file
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
|
require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
|
||||||
require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php";
|
require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php";
|
||||||
//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
|
||||||
//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,7 +112,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
@@ -135,7 +133,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -256,7 +254,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param string $ref Ref
|
* @param string $ref Ref
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $ref = '')
|
public function fetch($id, $ref = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
@@ -325,7 +323,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user, $notrigger = 0)
|
public function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -420,7 +418,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
public function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -477,7 +475,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $fromid Id of object to clone
|
* @param int $fromid Id of object to clone
|
||||||
* @return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($fromid)
|
public function createFromClone($fromid)
|
||||||
{
|
{
|
||||||
global $user,$langs;
|
global $user,$langs;
|
||||||
|
|
||||||
@@ -534,12 +532,12 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status, $mode);
|
return $this->LibStatut($this->status, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of a status
|
* Return label of a status
|
||||||
*
|
*
|
||||||
@@ -547,7 +545,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode = 0)
|
public function LibStatut($statut, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -568,20 +566,20 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
||||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8');
|
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
|
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8').' '.$langs->trans($this->statuts[$statut]);
|
elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]), 'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
||||||
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
elseif ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
||||||
if ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut8');
|
elseif ($statut==2) return '<span class="hideonsmartphone">'.$langs->trans($this->statutshort[$statut]).' </span>'.img_picto($langs->trans($this->statuts[$statut]), 'statut8');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +590,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
|
|
||||||
|
|||||||
@@ -707,13 +707,13 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load this->lines
|
* Load this->lines
|
||||||
*
|
*
|
||||||
* @return int 1 si ok, < 0 si erreur
|
* @return int 1 si ok, < 0 si erreur
|
||||||
*/
|
*/
|
||||||
function fetch_lines()
|
public function fetch_lines()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
@@ -934,14 +934,14 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount)
|
* Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount)
|
||||||
*
|
*
|
||||||
* @param int $idremise Id of absolute discount
|
* @param int $idremise Id of absolute discount
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function insert_discount($idremise)
|
public function insert_discount($idremise)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -1187,7 +1187,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag invoice as a payed invoice
|
* Tag invoice as a payed invoice
|
||||||
*
|
*
|
||||||
@@ -1196,7 +1196,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet. Not implementd yet.
|
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet. Not implementd yet.
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function set_paid($user, $close_code = '', $close_note = '')
|
public function set_paid($user, $close_code = '', $close_note = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -1237,7 +1237,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
||||||
* Fonction utilisee quand un paiement prelevement est refuse,
|
* Fonction utilisee quand un paiement prelevement est refuse,
|
||||||
@@ -1246,7 +1246,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* @param User $user Object user that change status
|
* @param User $user Object user that change status
|
||||||
* @return int <0 si ok, >0 si ok
|
* @return int <0 si ok, >0 si ok
|
||||||
*/
|
*/
|
||||||
function set_unpaid($user)
|
public function set_unpaid($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -1450,7 +1450,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
@@ -1458,7 +1458,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_draft($user, $idwarehouse = -1)
|
public function set_draft($user, $idwarehouse = -1)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -2033,7 +2033,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi liste des factures remplacables
|
* Renvoi liste des factures remplacables
|
||||||
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee
|
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee
|
||||||
@@ -2042,7 +2042,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* @return array|int Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
|
* @return array|int Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
|
||||||
* <0 if error
|
* <0 if error
|
||||||
*/
|
*/
|
||||||
function list_replacable_supplier_invoices($socid = 0)
|
public function list_replacable_supplier_invoices($socid = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -2084,7 +2084,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi liste des factures qualifiables pour correction par avoir
|
* Renvoi liste des factures qualifiables pour correction par avoir
|
||||||
* Les factures qui respectent les regles suivantes sont retournees:
|
* Les factures qui respectent les regles suivantes sont retournees:
|
||||||
@@ -2094,7 +2094,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
* @return array|int Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
* @return array|int Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
||||||
* <0 if error
|
* <0 if error
|
||||||
*/
|
*/
|
||||||
function list_qualified_avoir_supplier_invoices($socid = 0)
|
public function list_qualified_avoir_supplier_invoices($socid = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -2137,14 +2137,14 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
function load_board($user)
|
public function load_board($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -2246,8 +2246,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
if (! empty($this->total_ttc))
|
if (! empty($this->total_ttc))
|
||||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
|
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
|
||||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
|
elseif ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
|
||||||
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
|
elseif ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
|
||||||
if ($moretitle) $label.=' - '.$moretitle;
|
if ($moretitle) $label.=' - '.$moretitle;
|
||||||
|
|
||||||
$ref=$this->ref;
|
$ref=$this->ref;
|
||||||
@@ -2434,13 +2434,13 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->total_ttc = $xnbp*119.6;
|
$this->total_ttc = $xnbp*119.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function load_state_board()
|
public function load_state_board()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
@@ -3187,13 +3187,13 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Mise a jour de l'objet ligne de commande en base
|
* Mise a jour de l'objet ligne de commande en base
|
||||||
*
|
*
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function update_total()
|
public function update_total()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|||||||
@@ -156,14 +156,14 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Remove a price for a couple supplier-product
|
* Remove a price for a couple supplier-product
|
||||||
*
|
*
|
||||||
* @param int $rowid Line id of price
|
* @param int $rowid Line id of price
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function remove_product_fournisseur_price($rowid)
|
public function remove_product_fournisseur_price($rowid)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
@@ -202,7 +202,7 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Modify the purchase price for a supplier
|
* Modify the purchase price for a supplier
|
||||||
*
|
*
|
||||||
@@ -229,7 +229,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param string $desc_fourn Custom description for product_fourn_price
|
* @param string $desc_fourn Custom description for product_fourn_price
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '')
|
public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -473,7 +473,7 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Loads the price information of a provider
|
* Loads the price information of a provider
|
||||||
*
|
*
|
||||||
@@ -481,7 +481,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $ignore_expression Ignores the math expression for calculating price and uses the db value instead
|
* @param int $ignore_expression Ignores the math expression for calculating price and uses the db value instead
|
||||||
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch_product_fournisseur_price($rowid, $ignore_expression = 0)
|
public function fetch_product_fournisseur_price($rowid, $ignore_expression = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -563,7 +563,7 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* List all supplier prices of a product
|
* List all supplier prices of a product
|
||||||
*
|
*
|
||||||
@@ -574,7 +574,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $offset Offset
|
* @param int $offset Offset
|
||||||
* @return array Array of Products with new properties to define supplier price
|
* @return array Array of Products with new properties to define supplier price
|
||||||
*/
|
*/
|
||||||
function list_product_fournisseur_price($prodid, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0)
|
public function list_product_fournisseur_price($prodid, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -666,7 +666,7 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load properties for minimum price
|
* Load properties for minimum price
|
||||||
*
|
*
|
||||||
@@ -675,7 +675,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $socid get min price for specific supplier
|
* @param int $socid get min price for specific supplier
|
||||||
* @return int <0 if KO, 0=Not found of no product id provided, >0 if OK
|
* @return int <0 if KO, 0=Not found of no product id provided, >0 if OK
|
||||||
*/
|
*/
|
||||||
function find_min_price_product_fournisseur($prodid, $qty = 0, $socid = 0)
|
public function find_min_price_product_fournisseur($prodid, $qty = 0, $socid = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -810,7 +810,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $expression_id Expression
|
* @param int $expression_id Expression
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function setSupplierPriceExpression($expression_id)
|
public function setSupplierPriceExpression($expression_id)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -848,7 +848,7 @@ class ProductFournisseur extends Product
|
|||||||
* @return string String with supplier price
|
* @return string String with supplier price
|
||||||
* TODO Remove this method. Use getNomUrl directly.
|
* TODO Remove this method. Use getNomUrl directly.
|
||||||
*/
|
*/
|
||||||
function getSocNomUrl($withpicto = 0, $option = 'supplier', $maxlen = 0, $notooltip = 0)
|
public function getSocNomUrl($withpicto = 0, $option = 'supplier', $maxlen = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
$thirdparty = new Fournisseur($this->db);
|
$thirdparty = new Fournisseur($this->db);
|
||||||
$thirdparty->fetch($this->fourn_id);
|
$thirdparty->fetch($this->fourn_id);
|
||||||
@@ -856,7 +856,7 @@ class ProductFournisseur extends Product
|
|||||||
return $thirdparty->getNomUrl($withpicto, $option, $maxlen, $notooltip);
|
return $thirdparty->getNomUrl($withpicto, $option, $maxlen, $notooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Display price of product
|
* Display price of product
|
||||||
*
|
*
|
||||||
@@ -868,7 +868,7 @@ class ProductFournisseur extends Product
|
|||||||
* to display in table format.
|
* to display in table format.
|
||||||
* @return string String with supplier price
|
* @return string String with supplier price
|
||||||
*/
|
*/
|
||||||
function display_price_product_fournisseur($showunitprice = 1, $showsuptitle = 1, $maxlen = 0, $notooltip = 0, $productFournList = array())
|
public function display_price_product_fournisseur($showunitprice = 1, $showsuptitle = 1, $maxlen = 0, $notooltip = 0, $productFournList = array())
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -921,7 +921,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $offset Offset
|
* @param int $offset Offset
|
||||||
* @return array Array of Log prices
|
* @return array Array of Log prices
|
||||||
*/
|
*/
|
||||||
function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0)
|
public function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -967,7 +967,7 @@ class ProductFournisseur extends Product
|
|||||||
* to display in table format.
|
* to display in table format.
|
||||||
* @return string HTML String with supplier price
|
* @return string HTML String with supplier price
|
||||||
*/
|
*/
|
||||||
function displayPriceProductFournisseurLog($productFournLogList = array())
|
public function displayPriceProductFournisseurLog($productFournLogList = array())
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -1001,7 +1001,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @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
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
|
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ class Establishment extends CommonObject
|
|||||||
* @param int $id Id of record
|
* @param int $id Id of record
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
function getEstablishment($id)
|
public function getEstablishment($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT e.rowid, e.name, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity';
|
$sql = 'SELECT e.rowid, e.name, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
|
||||||
@@ -455,7 +455,7 @@ class Establishment extends CommonObject
|
|||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrlParent($id = 0, $withpicto = 0)
|
public function getNomUrlParent($id = 0, $withpicto = 0)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class Loan extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ class Loan extends CommonObject
|
|||||||
* @param int $id id object
|
* @param int $id id object
|
||||||
* @return int <0 error , >=0 no error
|
* @return int <0 error , >=0 no error
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note_private, l.note_public, l.insurance_amount,";
|
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note_private, l.note_public, l.insurance_amount,";
|
||||||
$sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest, l.fk_projet as fk_project";
|
$sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest, l.fk_projet as fk_project";
|
||||||
@@ -162,7 +162,7 @@ class Loan extends CommonObject
|
|||||||
* @param User $user User making creation
|
* @param User $user User making creation
|
||||||
* @return int <0 if KO, id if OK
|
* @return int <0 if KO, id if OK
|
||||||
*/
|
*/
|
||||||
function create($user)
|
public function create($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ class Loan extends CommonObject
|
|||||||
* @param User $user Object user making delete
|
* @param User $user Object user making delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
public function delete($user)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ class Loan extends CommonObject
|
|||||||
* @param User $user User who modified
|
* @param User $user User who modified
|
||||||
* @return int <0 if error, >0 if ok
|
* @return int <0 if error, >0 if ok
|
||||||
*/
|
*/
|
||||||
function update($user)
|
public function update($user)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@@ -364,14 +364,14 @@ class Loan extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag loan as payed completely
|
* Tag loan as payed completely
|
||||||
*
|
*
|
||||||
* @param User $user Object user making change
|
* @param User $user Object user making change
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_paid($user)
|
public function set_paid($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
|
||||||
@@ -393,12 +393,12 @@ class Loan extends CommonObject
|
|||||||
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0, $alreadypaid = -1)
|
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->paid, $mode, $alreadypaid);
|
return $this->LibStatut($this->paid, $mode, $alreadypaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label for given status
|
* Return label for given status
|
||||||
*
|
*
|
||||||
@@ -407,7 +407,7 @@ class Loan extends CommonObject
|
|||||||
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode = 0, $alreadypaid = -1)
|
public function LibStatut($statut, $mode = 0, $alreadypaid = -1)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -460,7 +460,7 @@ class Loan extends CommonObject
|
|||||||
* @param int $maxlen Label max length
|
* @param int $maxlen Label max length
|
||||||
* @return string Chaine with URL
|
* @return string Chaine with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $maxlen = 0)
|
public function getNomUrl($withpicto = 0, $maxlen = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -490,7 +490,7 @@ class Loan extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $user, $langs, $conf;
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ class Loan extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int Amount of payment already done, <0 if KO
|
* @return int Amount of payment already done, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getSumPayment()
|
public function getSumPayment()
|
||||||
{
|
{
|
||||||
$table='payment_loan';
|
$table='payment_loan';
|
||||||
$field='fk_loan';
|
$field='fk_loan';
|
||||||
@@ -552,7 +552,7 @@ class Loan extends CommonObject
|
|||||||
* @param int $id Id of record
|
* @param int $id Id of record
|
||||||
* @return integer|null
|
* @return integer|null
|
||||||
*/
|
*/
|
||||||
function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT l.rowid, l.datec, l.fk_user_author, l.fk_user_modif,';
|
$sql = 'SELECT l.rowid, l.datec, l.fk_user_author, l.fk_user_modif,';
|
||||||
$sql.= ' l.tms';
|
$sql.= ' l.tms';
|
||||||
|
|||||||
@@ -361,8 +361,7 @@ class LoanSchedule extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error)
|
if (! $error) {
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class PaymentLoan extends CommonObject
|
|||||||
* @param User $user User making payment
|
* @param User $user User making payment
|
||||||
* @return int <0 if KO, id of payment if OK
|
* @return int <0 if KO, id of payment if OK
|
||||||
*/
|
*/
|
||||||
function create($user)
|
public function create($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ class PaymentLoan extends CommonObject
|
|||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
@@ -273,7 +273,7 @@ class PaymentLoan extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
public function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -361,7 +361,7 @@ class PaymentLoan extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger = 0)
|
public function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -388,10 +388,10 @@ class PaymentLoan extends CommonObject
|
|||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
//if (! $error)
|
||||||
{
|
//{
|
||||||
if (! $notrigger)
|
// if (! $notrigger)
|
||||||
{
|
// {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action call a trigger.
|
// want this action call a trigger.
|
||||||
|
|
||||||
@@ -401,8 +401,8 @@ class PaymentLoan extends CommonObject
|
|||||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error)
|
if ($error)
|
||||||
@@ -435,7 +435,7 @@ class PaymentLoan extends CommonObject
|
|||||||
* @param string $emetteur_banque Name of bank
|
* @param string $emetteur_banque Name of bank
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
public function addPaymentToBank($user, $fk_loan, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -452,7 +452,7 @@ class PaymentLoan extends CommonObject
|
|||||||
if ($mode == 'payment_loan') $total=-$total;
|
if ($mode == 'payment_loan') $total=-$total;
|
||||||
|
|
||||||
// Insert payment into llx_bank
|
// Insert payment into llx_bank
|
||||||
$bank_line_id = $acc->addline(
|
$bank_line_id = $acc->addline(
|
||||||
$this->datep,
|
$this->datep,
|
||||||
$this->paymenttype, // Payment mode id or code ("CHQ or VIR for example")
|
$this->paymenttype, // Payment mode id or code ("CHQ or VIR for example")
|
||||||
$label,
|
$label,
|
||||||
@@ -513,14 +513,14 @@ $bank_line_id = $acc->addline(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update link between loan's payment and the line generate in llx_bank
|
* Update link between loan's payment and the line generate in llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id_bank Id if bank
|
* @param int $id_bank Id if bank
|
||||||
* @return int >0 if OK, <=0 if KO
|
* @return int >0 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function update_fk_bank($id_bank)
|
public function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_loan SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_loan SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
||||||
@@ -546,7 +546,7 @@ $bank_line_id = $acc->addline(
|
|||||||
* @param int $maxlen Max length label
|
* @param int $maxlen Max length label
|
||||||
* @return string Chaine with URL
|
* @return string Chaine with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $maxlen = 0)
|
public function getNomUrl($withpicto = 0, $maxlen = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
|
|
||||||
$sql.= $db->order($sortfield, $sortorder);
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
if ($limit) {
|
if ($limit) {
|
||||||
if ($page < 0)
|
if ($page < 0) {
|
||||||
{
|
|
||||||
$page = 0;
|
$page = 0;
|
||||||
}
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ dol_include_once("/mymodule/class/myobject.class.php");
|
|||||||
class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Put here a name not already used
|
// CHANGE THIS: Put here a name not already used
|
||||||
var $name='mailinglist_mymodule_myobject';
|
public $name='mailinglist_mymodule_myobject';
|
||||||
// CHANGE THIS: Put here a description of your selector module
|
// CHANGE THIS: Put here a description of your selector module
|
||||||
var $desc='My object emailing target selector';
|
public $desc='My object emailing target selector';
|
||||||
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
||||||
var $require_admin=0;
|
public $require_admin=0;
|
||||||
|
|
||||||
var $enabled=0;
|
public $enabled=0;
|
||||||
var $require_module=array();
|
public $require_module=array();
|
||||||
var $picto='mymodule@mymodule';
|
public $picto='mymodule@mymodule';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@@ -39,7 +39,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
@@ -86,20 +86,20 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
* @param int $id ID
|
* @param int $id ID
|
||||||
* @return string Url lien
|
* @return string Url lien
|
||||||
*/
|
*/
|
||||||
function url($id)
|
public function url($id)
|
||||||
{
|
{
|
||||||
return '<a href="'.dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id.'">'.img_object('', "generic").'</a>';
|
return '<a href="'.dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id.'">'.img_object('', "generic").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* This is the main function that returns the array of emails
|
* This is the main function that returns the array of emails
|
||||||
*
|
*
|
||||||
* @param int $mailing_id Id of emailing
|
* @param int $mailing_id Id of emailing
|
||||||
* @return int <0 if error, number of emails added if ok
|
* @return int <0 if error, number of emails added if ok
|
||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id)
|
public function add_to_target($mailing_id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$target = array();
|
$target = array();
|
||||||
@@ -172,7 +172,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
* @param string $option Options
|
* @param string $option Options
|
||||||
* @return int Nb of recipients or -1 if KO
|
* @return int Nb of recipients or -1 if KO
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($filter = 1, $option = '')
|
public function getNbOfRecipients($filter = 1, $option = '')
|
||||||
{
|
{
|
||||||
$a=parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''");
|
$a=parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''");
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ class modMyModule extends DolibarrModules
|
|||||||
),
|
),
|
||||||
'entity' => '0',
|
'entity' => '0',
|
||||||
),
|
),
|
||||||
'moduleforexternal' => 0 // Set this to 1 if feature of module are opened to external users
|
// Set this to 1 if feature of module are opened to external users
|
||||||
|
'moduleforexternal' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Data directories to create when module is enabled.
|
// Data directories to create when module is enabled.
|
||||||
@@ -126,8 +127,10 @@ class modMyModule extends DolibarrModules
|
|||||||
$this->config_page_url = array("setup.php@mymodule");
|
$this->config_page_url = array("setup.php@mymodule");
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->hidden = false; // A condition to hide module
|
// A condition to hide module
|
||||||
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
$this->hidden = false;
|
||||||
|
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
||||||
|
$this->depends = array();
|
||||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||||
$this->langfiles = array("mymodule@mymodule");
|
$this->langfiles = array("mymodule@mymodule");
|
||||||
@@ -144,7 +147,7 @@ class modMyModule extends DolibarrModules
|
|||||||
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||||
// );
|
// );
|
||||||
$this->const = array(
|
$this->const = array(
|
||||||
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
1 => array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Some keys to add into the overwriting translation tables
|
// Some keys to add into the overwriting translation tables
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ class MultiCurrency extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int -1 if KO, 1 if OK, 2 if label found and OK
|
* @return int -1 if KO, 1 if OK, 2 if label found and OK
|
||||||
*/
|
*/
|
||||||
function addRateFromDolibarr($code, $rate)
|
public function addRateFromDolibarr($code, $rate)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create(User $user, $notrigger = 0)
|
public function create(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param string $numsurvey Ref of survey (admin or not)
|
* @param string $numsurvey Ref of survey (admin or not)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $numsurvey = '')
|
public function fetch($id, $numsurvey = '')
|
||||||
{
|
{
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.id_sondage,";
|
$sql.= " t.id_sondage,";
|
||||||
@@ -283,7 +283,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update(User $user, $notrigger = 0)
|
public function update(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -356,7 +356,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param string $numsondage Num sondage admin to delete
|
* @param string $numsondage Num sondage admin to delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete(User $user, $notrigger = 0, $numsondage = '')
|
public function delete(User $user, $notrigger = 0, $numsondage = '')
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -424,7 +424,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @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
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@@ -472,13 +472,13 @@ class Opensurveysondage extends CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return array of lines
|
* Return array of lines
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch_lines()
|
public function fetch_lines()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$ret=array();
|
$ret=array();
|
||||||
@@ -513,7 +513,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
|
|
||||||
@@ -624,12 +624,12 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle
|
* @return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode)
|
public function getLibStatut($mode)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status, $mode);
|
return $this->LibStatut($this->status, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of status
|
* Return label of status
|
||||||
*
|
*
|
||||||
@@ -637,7 +637,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($status, $mode)
|
public function LibStatut($status, $mode)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
@@ -646,38 +646,38 @@ class Opensurveysondage extends CommonObject
|
|||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
|
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
|
||||||
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
|
elseif ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
|
||||||
if ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
|
elseif ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
|
||||||
}
|
}
|
||||||
elseif ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
|
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
|
||||||
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
|
elseif ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
|
||||||
if ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
|
elseif ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
|
||||||
}
|
}
|
||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0').' '.$langs->trans('Draft');
|
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0').' '.$langs->trans('Draft');
|
||||||
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'), 'statut1').' '.$langs->trans('Opened');
|
elseif ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'), 'statut1').' '.$langs->trans('Opened');
|
||||||
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6').' '.$langs->trans('Closed');
|
elseif ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6').' '.$langs->trans('Closed');
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0');
|
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0');
|
||||||
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'), 'statut1');
|
elseif ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'), 'statut1');
|
||||||
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6');
|
elseif ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0').' '.$langs->trans('Draft');
|
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'), 'statut0').' '.$langs->trans('Draft');
|
||||||
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened').$billedtext, 'statut1').' '.$langs->trans('Opened');
|
elseif ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened').$billedtext, 'statut1').' '.$langs->trans('Opened');
|
||||||
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6').' '.$langs->trans('Closed');
|
elseif ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'), 'statut6').' '.$langs->trans('Closed');
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($status==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('Draft').' </span>'.img_picto($langs->trans('Draft'), 'statut0');
|
if ($status==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('Draft').' </span>'.img_picto($langs->trans('Draft'), 'statut0');
|
||||||
if ($status==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('Opened').' </span>'.img_picto($langs->trans('Opened'), 'statut1');
|
elseif ($status==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('Opened').' </span>'.img_picto($langs->trans('Opened'), 'statut1');
|
||||||
if ($status==self::STATUS_CLOSED) return '<span class="hideonsmartphone">'.$langs->trans('Closed').' </span>'.img_picto($langs->trans('Closed'), 'statut6');
|
elseif ($status==self::STATUS_CLOSED) return '<span class="hideonsmartphone">'.$langs->trans('Closed').' </span>'.img_picto($langs->trans('Closed'), 'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||||||
*/
|
*/
|
||||||
class ActionsCardProduct
|
class ActionsCardProduct
|
||||||
{
|
{
|
||||||
var $targetmodule;
|
public $targetmodule;
|
||||||
var $canvas;
|
public $canvas;
|
||||||
var $card;
|
public $card;
|
||||||
|
|
||||||
//! Template container
|
//! Template container
|
||||||
var $tpl = array();
|
public $tpl = array();
|
||||||
|
|
||||||
// List of fiels for action=list
|
// List of fiels for action=list
|
||||||
var $field_list =array();
|
public $field_list =array();
|
||||||
public $list_datas = array();
|
public $list_datas = array();
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class ActionsCardProduct
|
|||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
|
public function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->dirmodule = $dirmodule;
|
$this->dirmodule = $dirmodule;
|
||||||
@@ -64,7 +64,7 @@ class ActionsCardProduct
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Assign custom values for canvas (for example into this->tpl to be used by templates)
|
* Assign custom values for canvas (for example into this->tpl to be used by templates)
|
||||||
*
|
*
|
||||||
@@ -73,7 +73,7 @@ class ActionsCardProduct
|
|||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function assign_values(&$action, $id = 0, $ref = '')
|
public function assign_values(&$action, $id = 0, $ref = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
global $limit, $offset, $sortfield, $sortorder;
|
||||||
@@ -86,8 +86,7 @@ class ActionsCardProduct
|
|||||||
|
|
||||||
//parent::assign_values($action);
|
//parent::assign_values($action);
|
||||||
|
|
||||||
foreach($this->object as $key => $value)
|
foreach($this->object as $key => $value) {
|
||||||
{
|
|
||||||
$this->tpl[$key] = $value;
|
$this->tpl[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +295,7 @@ class ActionsCardProduct
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch datas list and save into ->list_datas
|
* Fetch datas list and save into ->list_datas
|
||||||
*
|
*
|
||||||
@@ -306,7 +305,7 @@ class ActionsCardProduct
|
|||||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
public function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||||||
*/
|
*/
|
||||||
class ActionsCardService
|
class ActionsCardService
|
||||||
{
|
{
|
||||||
var $targetmodule;
|
public $targetmodule;
|
||||||
var $canvas;
|
public $canvas;
|
||||||
var $card;
|
public $card;
|
||||||
|
|
||||||
//! Template container
|
//! Template container
|
||||||
var $tpl = array();
|
public $tpl = array();
|
||||||
|
|
||||||
// List of fiels for action=list
|
// List of fiels for action=list
|
||||||
var $field_list =array();
|
public $field_list =array();
|
||||||
public $list_datas = array();
|
public $list_datas = array();
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class ActionsCardService
|
|||||||
* @param string $canvas Name of canvas
|
* @param string $canvas Name of canvas
|
||||||
* @param string $card Name of tab (sub-canvas)
|
* @param string $card Name of tab (sub-canvas)
|
||||||
*/
|
*/
|
||||||
function __construct($db, $targetmodule, $canvas, $card)
|
public function __construct($db, $targetmodule, $canvas, $card)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->targetmodule = $targetmodule;
|
$this->targetmodule = $targetmodule;
|
||||||
@@ -63,7 +63,7 @@ class ActionsCardService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Assign custom values for canvas (for example into this->tpl to be used by templates)
|
* Assign custom values for canvas (for example into this->tpl to be used by templates)
|
||||||
*
|
*
|
||||||
@@ -72,7 +72,7 @@ class ActionsCardService
|
|||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function assign_values(&$action, $id = 0, $ref = '')
|
public function assign_values(&$action, $id = 0, $ref = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
global $limit, $offset, $sortfield, $sortorder;
|
||||||
@@ -274,7 +274,7 @@ class ActionsCardService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch datas list and save into ->list_datas
|
* Fetch datas list and save into ->list_datas
|
||||||
*
|
*
|
||||||
@@ -284,7 +284,7 @@ class ActionsCardService
|
|||||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
public function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class FormProduct
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class PriceExpression
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ class PriceExpression
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -101,8 +101,8 @@ class PriceExpression
|
|||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||||
|
|
||||||
if (! $notrigger)
|
//if (! $notrigger)
|
||||||
{
|
//{
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ class PriceExpression
|
|||||||
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@@ -138,7 +138,7 @@ class PriceExpression
|
|||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($id))
|
if (empty($id))
|
||||||
@@ -175,13 +175,13 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* List all price expressions
|
* List all price expressions
|
||||||
*
|
*
|
||||||
* @return array Array of price expressions
|
* @return array Array of price expressions
|
||||||
*/
|
*/
|
||||||
function list_price_expression()
|
public function list_price_expression()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid, title, expression";
|
$sql = "SELECT rowid, title, expression";
|
||||||
@@ -214,14 +214,14 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns any existing rowid with specified title
|
* Returns any existing rowid with specified title
|
||||||
*
|
*
|
||||||
* @param String $title Title of expression
|
* @param String $title Title of expression
|
||||||
* @return int < 0 if KO, 0 if OK but not found, > 0 rowid
|
* @return int < 0 if KO, 0 if OK but not found, > 0 rowid
|
||||||
*/
|
*/
|
||||||
function find_title($title)
|
public function find_title($title)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
@@ -257,7 +257,7 @@ class PriceExpression
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
public function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ class PriceExpression
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete(User $user, $notrigger = 0)
|
public function delete(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -325,10 +325,10 @@ class PriceExpression
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error)
|
//if (! $error)
|
||||||
{
|
//{
|
||||||
if (! $notrigger)
|
// if (! $notrigger)
|
||||||
{
|
// {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@@ -336,8 +336,8 @@ class PriceExpression
|
|||||||
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@@ -373,7 +373,7 @@ class PriceExpression
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->expression='';
|
$this->expression='';
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class PriceGlobalVariable
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ class PriceGlobalVariable
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ class PriceGlobalVariable
|
|||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT code, description, value";
|
$sql = "SELECT code, description, value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@@ -182,7 +182,7 @@ class PriceGlobalVariable
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
public function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ class PriceGlobalVariable
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $user, $notrigger = 0)
|
public function delete($rowid, $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ class PriceGlobalVariable
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->code='';
|
$this->code='';
|
||||||
@@ -309,7 +309,7 @@ class PriceGlobalVariable
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function checkParameters()
|
public function checkParameters()
|
||||||
{
|
{
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->code)) $this->code=trim($this->code);
|
if (isset($this->code)) $this->code=trim($this->code);
|
||||||
@@ -324,7 +324,7 @@ class PriceGlobalVariable
|
|||||||
*
|
*
|
||||||
* @return array Array of price global variables
|
* @return array Array of price global variables
|
||||||
*/
|
*/
|
||||||
function listGlobalVariables()
|
public function listGlobalVariables()
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, code, description, value";
|
$sql = "SELECT rowid, code, description, value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
* @return int < 0 if KO, 0 if OK but not found, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
public function fetch($id)
|
||||||
{
|
{
|
||||||
$sql = "SELECT type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
$sql = "SELECT type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@@ -202,7 +202,7 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = 0, $notrigger = 0)
|
public function update($user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -265,16 +265,16 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $user, $notrigger = 0)
|
public function delete($rowid, $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error)
|
//if (! $error)
|
||||||
{
|
//{
|
||||||
if (! $notrigger)
|
// if (! $notrigger)
|
||||||
{
|
// {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@@ -282,8 +282,8 @@ class PriceGlobalVariableUpdater
|
|||||||
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@@ -319,7 +319,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->type=0;
|
$this->type=0;
|
||||||
@@ -336,7 +336,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getLastUpdated()
|
public function getLastUpdated()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$last = $this->next_update - ($this->update_interval * 60);
|
$last = $this->next_update - ($this->update_interval * 60);
|
||||||
@@ -352,7 +352,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function checkParameters()
|
public function checkParameters()
|
||||||
{
|
{
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->description)) $this->description=trim($this->description);
|
if (isset($this->description)) $this->description=trim($this->description);
|
||||||
@@ -371,7 +371,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return array Array of price global variable updaters
|
* @return array Array of price global variable updaters
|
||||||
*/
|
*/
|
||||||
function listUpdaters()
|
public function listUpdaters()
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
$sql = "SELECT rowid, type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@@ -412,7 +412,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return array Array of price global variable updaters
|
* @return array Array of price global variable updaters
|
||||||
*/
|
*/
|
||||||
function listPendingUpdaters()
|
public function listPendingUpdaters()
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
$sql = "SELECT rowid, type, description, parameters, fk_variable, update_interval, next_update, last_status";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@@ -454,7 +454,7 @@ class PriceGlobalVariableUpdater
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if OK but no global variable found, >0 if OK
|
* @return int <0 if KO, 0 if OK but no global variable found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function process()
|
public function process()
|
||||||
{
|
{
|
||||||
global $langs, $user;
|
global $langs, $user;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@@ -560,7 +560,7 @@ class PriceGlobalVariableUpdater
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update next_update into database
|
* Update next_update into database
|
||||||
*
|
*
|
||||||
@@ -569,7 +569,7 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_next_update($next_update, $user = 0, $notrigger = 0)
|
public function update_next_update($next_update, $user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -606,7 +606,7 @@ class PriceGlobalVariableUpdater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update last_status into database
|
* Update last_status into database
|
||||||
*
|
*
|
||||||
@@ -615,7 +615,7 @@ class PriceGlobalVariableUpdater
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update_status($last_status, $user = 0, $notrigger = 0)
|
public function update_status($last_status, $user = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class PriceParser
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ class PriceParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Accessible product values by expressions
|
//Accessible product values by expressions
|
||||||
$values = array_merge($values, array(
|
$values = array_merge($values, array(
|
||||||
"tva_tx" => $product->tva_tx,
|
"tva_tx" => $product->tva_tx,
|
||||||
"localtax1_tx" => $product->localtax1_tx,
|
"localtax1_tx" => $product->localtax1_tx,
|
||||||
"localtax2_tx" => $product->localtax2_tx,
|
"localtax2_tx" => $product->localtax2_tx,
|
||||||
@@ -264,7 +264,7 @@ $values = array_merge($values, array(
|
|||||||
$supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
|
$supplier_min_price = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
|
||||||
|
|
||||||
//Accessible values by expressions
|
//Accessible values by expressions
|
||||||
$extra_values = array_merge($extra_values, array(
|
$extra_values = array_merge($extra_values, array(
|
||||||
"supplier_min_price" => $supplier_min_price,
|
"supplier_min_price" => $supplier_min_price,
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ $extra_values = array_merge($extra_values, array(
|
|||||||
$product_supplier->fetch($product_supplier->id, '', '', 1);
|
$product_supplier->fetch($product_supplier->id, '', '', 1);
|
||||||
|
|
||||||
//Accessible values by expressions
|
//Accessible values by expressions
|
||||||
$extra_values = array_merge($extra_values, array(
|
$extra_values = array_merge($extra_values, array(
|
||||||
"supplier_quantity" => $product_supplier->fourn_qty,
|
"supplier_quantity" => $product_supplier->fourn_qty,
|
||||||
"supplier_tva_tx" => $product_supplier->fourn_tva_tx,
|
"supplier_tva_tx" => $product_supplier->fourn_tva_tx,
|
||||||
));
|
));
|
||||||
@@ -324,12 +324,12 @@ $extra_values = array_merge($extra_values, array(
|
|||||||
$product->fetch($product_id, '', '', 1);
|
$product->fetch($product_id, '', '', 1);
|
||||||
|
|
||||||
//Values for product expressions
|
//Values for product expressions
|
||||||
$extra_values = array_merge($extra_values, array(
|
$extra_values = array_merge($extra_values, array(
|
||||||
"supplier_min_price" => 1,
|
"supplier_min_price" => 1,
|
||||||
));
|
));
|
||||||
|
|
||||||
//Values for supplier product expressions
|
//Values for supplier product expressions
|
||||||
$extra_values = array_merge($extra_values, array(
|
$extra_values = array_merge($extra_values, array(
|
||||||
"supplier_quantity" => 2,
|
"supplier_quantity" => 2,
|
||||||
"supplier_tva_tx" => 3,
|
"supplier_tva_tx" => 3,
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ class Inventory extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @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
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@@ -370,12 +370,12 @@ class Inventory extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status, $mode);
|
return $this->LibStatut($this->status, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return the status
|
* Return the status
|
||||||
*
|
*
|
||||||
@@ -383,7 +383,7 @@ class Inventory extends CommonObject
|
|||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto, 6=Long label + Picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto, 6=Long label + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
static function LibStatut($status, $mode = 0)
|
public static function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -439,7 +439,7 @@ class Inventory extends CommonObject
|
|||||||
* @param int $id Id of order
|
* @param int $id Id of order
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function info($id)
|
public function info($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
|
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
|
||||||
$sql.= ' fk_user_creat, fk_user_modif';
|
$sql.= ' fk_user_creat, fk_user_modif';
|
||||||
|
|||||||
@@ -50,29 +50,29 @@ class Reception extends CommonObject
|
|||||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
public $picto = 'reception';
|
public $picto = 'reception';
|
||||||
|
|
||||||
var $socid;
|
public $socid;
|
||||||
var $ref_supplier;
|
public $ref_supplier;
|
||||||
var $ref_int;
|
public $ref_int;
|
||||||
var $brouillon;
|
public $brouillon;
|
||||||
var $entrepot_id;
|
public $entrepot_id;
|
||||||
var $lines=array();
|
public $lines=array();
|
||||||
var $tracking_number;
|
public $tracking_number;
|
||||||
var $tracking_url;
|
public $tracking_url;
|
||||||
var $billed;
|
public $billed;
|
||||||
var $model_pdf;
|
public $model_pdf;
|
||||||
|
|
||||||
var $trueWeight;
|
public $trueWeight;
|
||||||
var $weight_units;
|
public $weight_units;
|
||||||
var $trueWidth;
|
public $trueWidth;
|
||||||
var $width_units;
|
public $width_units;
|
||||||
var $trueHeight;
|
public $trueHeight;
|
||||||
var $height_units;
|
public $height_units;
|
||||||
var $trueDepth;
|
public $trueDepth;
|
||||||
var $depth_units;
|
public $depth_units;
|
||||||
// A denormalized value
|
// A denormalized value
|
||||||
var $trueSize;
|
public $trueSize;
|
||||||
|
|
||||||
var $date_delivery; // Date delivery planed
|
public $date_delivery; // Date delivery planed
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,11 +80,11 @@ class Reception extends CommonObject
|
|||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $date_reception;
|
public $date_reception;
|
||||||
var $date_creation;
|
public $date_creation;
|
||||||
var $date_valid;
|
public $date_valid;
|
||||||
|
|
||||||
var $meths;
|
public $meths;
|
||||||
var $listmeths; // List of carriers
|
public $listmeths; // List of carriers
|
||||||
|
|
||||||
|
|
||||||
const STATUS_DRAFT = 0;
|
const STATUS_DRAFT = 0;
|
||||||
@@ -98,7 +98,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
@@ -118,7 +118,7 @@ class Reception extends CommonObject
|
|||||||
* @param Societe $soc Thirdparty object
|
* @param Societe $soc Thirdparty object
|
||||||
* @return string Free reference for contract
|
* @return string Free reference for contract
|
||||||
*/
|
*/
|
||||||
function getNextNumRef($soc)
|
public function getNextNumRef($soc)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
$langs->load("receptions");
|
$langs->load("receptions");
|
||||||
@@ -176,7 +176,7 @@ class Reception extends CommonObject
|
|||||||
* @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 erreur, id reception creee si ok
|
* @return int <0 si erreur, id reception creee si ok
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger = 0)
|
public function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $hookmanager;
|
global $conf, $hookmanager;
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ class Reception extends CommonObject
|
|||||||
* @param string $ref_int Internal reference of other object
|
* @param string $ref_int Internal reference of other object
|
||||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($id, $ref = '', $ref_ext = '', $ref_int = '')
|
public function fetch($id, $ref = '', $ref_ext = '', $ref_int = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -488,7 +488,7 @@ class Reception extends CommonObject
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
function valid($user, $notrigger = 0)
|
public function valid($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ class Reception extends CommonObject
|
|||||||
* @param string $batch Lot number
|
* @param string $batch Lot number
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '')
|
public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
@@ -763,7 +763,7 @@ class Reception extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = null, $notrigger = 0)
|
public function update($user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -864,7 +864,7 @@ class Reception extends CommonObject
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||||
*/
|
*/
|
||||||
function delete(User $user)
|
public function delete(User $user)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@@ -1014,13 +1014,13 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load lines
|
* Load lines
|
||||||
*
|
*
|
||||||
* @return int >0 if OK, Otherwise if KO
|
* @return int >0 if OK, Otherwise if KO
|
||||||
*/
|
*/
|
||||||
function fetch_lines()
|
public function fetch_lines()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $db;
|
global $db;
|
||||||
@@ -1082,7 +1082,7 @@ class Reception extends CommonObject
|
|||||||
* @param int $notooltip 1=No tooltip
|
* @param int $notooltip 1=No tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$result='';
|
$result='';
|
||||||
@@ -1123,12 +1123,12 @@ class Reception extends CommonObject
|
|||||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
||||||
* @return string Libelle
|
* @return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode = 0)
|
public function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut, $mode);
|
return $this->LibStatut($this->statut, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of a status
|
* Return label of a status
|
||||||
*
|
*
|
||||||
@@ -1136,7 +1136,7 @@ class Reception extends CommonObject
|
|||||||
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut, $mode)
|
public function LibStatut($statut, $mode)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -1144,32 +1144,32 @@ class Reception extends CommonObject
|
|||||||
if ($mode==0)
|
if ($mode==0)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $langs->trans($this->statuts[$statut]);
|
if ($statut==0) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return $langs->trans($this->statuts[$statut]);
|
elseif ($statut==1) return $langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2) return $langs->trans($this->statuts[$statut]);
|
elseif ($statut==2) return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode==1)
|
elseif ($mode==1)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $langs->trans('StatusReceptionDraftShort');
|
if ($statut==0) return $langs->trans('StatusReceptionDraftShort');
|
||||||
if ($statut==1) return $langs->trans('StatusReceptionValidatedShort');
|
elseif ($statut==1) return $langs->trans('StatusReceptionValidatedShort');
|
||||||
if ($statut==2) return $langs->trans('StatusReceptionProcessedShort');
|
elseif ($statut==2) return $langs->trans('StatusReceptionProcessedShort');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6');
|
elseif ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
|
elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]), 'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6').' '.$langs->trans('StatusReceptionProcessed');
|
elseif ($statut==2) return img_picto($langs->trans('StatusReceptionProcessed'), 'statut6').' '.$langs->trans('StatusReceptionProcessed');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $langs->trans('StatusReceptionDraftShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
if ($statut==0) return $langs->trans('StatusReceptionDraftShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
|
||||||
if ($statut==1) return $langs->trans('StatusReceptionValidatedShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
elseif ($statut==1) return $langs->trans('StatusReceptionValidatedShort').' '.img_picto($langs->trans($this->statuts[$statut]), 'statut4');
|
||||||
if ($statut==2) return $langs->trans('StatusReceptionProcessedShort').' '.img_picto($langs->trans('StatusReceptionProcessedShort'), 'statut6');
|
elseif ($statut==2) return $langs->trans('StatusReceptionProcessedShort').' '.img_picto($langs->trans('StatusReceptionProcessedShort'), 'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1180,7 +1180,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php');
|
dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php');
|
||||||
@@ -1251,7 +1251,7 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set the planned delivery date
|
* Set the planned delivery date
|
||||||
*
|
*
|
||||||
@@ -1259,7 +1259,7 @@ class Reception extends CommonObject
|
|||||||
* @param timestamp $date_livraison Date de livraison
|
* @param timestamp $date_livraison Date de livraison
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_date_livraison($user, $date_livraison)
|
public function set_date_livraison($user, $date_livraison)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if ($user->rights->reception->creer)
|
if ($user->rights->reception->creer)
|
||||||
@@ -1287,13 +1287,13 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch deliveries method and return an array. Load array this->meths(rowid=>label).
|
* Fetch deliveries method and return an array. Load array this->meths(rowid=>label).
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fetch_delivery_methods()
|
public function fetch_delivery_methods()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -1315,14 +1315,14 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch all deliveries method and return an array. Load array this->listmeths.
|
* Fetch all deliveries method and return an array. Load array this->listmeths.
|
||||||
*
|
*
|
||||||
* @param int $id only this carrier, all if none
|
* @param int $id only this carrier, all if none
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function list_delivery_methods($id = '')
|
public function list_delivery_methods($id = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -1335,10 +1335,8 @@ class Reception extends CommonObject
|
|||||||
if ($id!='') $sql.= " WHERE em.rowid=".$id;
|
if ($id!='') $sql.= " WHERE em.rowid=".$id;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
|
||||||
{
|
|
||||||
$this->listmeths[$i]['rowid'] = $obj->rowid;
|
$this->listmeths[$i]['rowid'] = $obj->rowid;
|
||||||
$this->listmeths[$i]['code'] = $obj->code;
|
$this->listmeths[$i]['code'] = $obj->code;
|
||||||
$label=$langs->trans('ReceptionMethod'.$obj->code);
|
$label=$langs->trans('ReceptionMethod'.$obj->code);
|
||||||
@@ -1351,7 +1349,7 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update/create delivery method.
|
* Update/create delivery method.
|
||||||
*
|
*
|
||||||
@@ -1359,7 +1357,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function update_delivery_method($id = '')
|
public function update_delivery_method($id = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if ($id=='')
|
if ($id=='')
|
||||||
@@ -1381,7 +1379,7 @@ class Reception extends CommonObject
|
|||||||
if ($resql < 0) dol_print_error($this->db, '');
|
if ($resql < 0) dol_print_error($this->db, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Activate delivery method.
|
* Activate delivery method.
|
||||||
*
|
*
|
||||||
@@ -1389,7 +1387,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function activ_delivery_method($id)
|
public function activ_delivery_method($id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1';
|
||||||
@@ -1398,7 +1396,7 @@ class Reception extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* DesActivate delivery method.
|
* DesActivate delivery method.
|
||||||
*
|
*
|
||||||
@@ -1406,7 +1404,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function disable_delivery_method($id)
|
public function disable_delivery_method($id)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0';
|
||||||
@@ -1422,7 +1420,7 @@ class Reception extends CommonObject
|
|||||||
* @param string $value Value
|
* @param string $value Value
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getUrlTrackingStatus($value = '')
|
public function getUrlTrackingStatus($value = '')
|
||||||
{
|
{
|
||||||
if (! empty($this->shipping_method_id))
|
if (! empty($this->shipping_method_id))
|
||||||
{
|
{
|
||||||
@@ -1456,7 +1454,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function setClosed()
|
public function setClosed()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
global $conf,$langs,$user;
|
||||||
|
|
||||||
@@ -1597,13 +1595,13 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on)
|
* Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on)
|
||||||
*
|
*
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function set_billed()
|
public function set_billed()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
@@ -1648,7 +1646,7 @@ class Reception extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function reOpen()
|
public function reOpen()
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
global $conf,$langs,$user;
|
||||||
|
|
||||||
@@ -1766,14 +1764,14 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set draft status
|
* Set draft status
|
||||||
*
|
*
|
||||||
* @param User $user Object user that modify
|
* @param User $user Object user that modify
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_draft($user)
|
public function set_draft($user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -1912,7 +1910,7 @@ class Reception extends CommonObject
|
|||||||
$this->statut=self::STATUS_DRAFT;
|
$this->statut=self::STATUS_DRAFT;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ class ReceptionStats extends Stats
|
|||||||
{
|
{
|
||||||
public $table_element;
|
public $table_element;
|
||||||
|
|
||||||
var $socid;
|
public $socid;
|
||||||
var $userid;
|
public $userid;
|
||||||
|
|
||||||
var $from;
|
public $from;
|
||||||
var $field;
|
public $field;
|
||||||
var $where;
|
public $where;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ class ReceptionStats extends Stats
|
|||||||
* @param string $mode Option (not used)
|
* @param string $mode Option (not used)
|
||||||
* @param int $userid Id user for filter (creation user)
|
* @param int $userid Id user for filter (creation user)
|
||||||
*/
|
*/
|
||||||
function __construct($db, $socid, $mode, $userid = 0)
|
public function __construct($db, $socid, $mode, $userid = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
@@ -84,13 +84,15 @@ class ReceptionStats extends Stats
|
|||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
* @return array Array with number by month
|
* @return array Array with number by month
|
||||||
*/
|
*/
|
||||||
function getNbByMonth($year)
|
public function getNbByMonth($year)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb";
|
$sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$this->socid) {
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
}
|
||||||
$sql.= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql.= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
@@ -106,7 +108,7 @@ class ReceptionStats extends Stats
|
|||||||
* @return array Array with number by year
|
* @return array Array with number by year
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getNbByYear()
|
public function getNbByYear()
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -125,7 +127,7 @@ class ReceptionStats extends Stats
|
|||||||
*
|
*
|
||||||
* @return array Array of values
|
* @return array Array of values
|
||||||
*/
|
*/
|
||||||
function getAllByYear()
|
public function getAllByYear()
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user = null, $notrigger = 0)
|
public function update($user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -405,7 +405,7 @@ class Dolresource extends CommonObject
|
|||||||
* @param int $notrigger Disable all triggers
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $notrigger = 0)
|
public function delete($rowid, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class ActionsStripeconnect
|
|||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ class ActionsStripeconnect
|
|||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function formObjectOptions($parameters, &$object, &$action)
|
public function formObjectOptions($parameters, &$object, &$action)
|
||||||
{
|
{
|
||||||
global $db,$conf,$user,$langs,$form;
|
global $db,$conf,$user,$langs,$form;
|
||||||
|
|
||||||
@@ -123,8 +123,7 @@ class ActionsStripeconnect
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$customer=$stripe->customerStripe($object->thirdparty, $stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object->thirdparty, $stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
@@ -141,13 +140,11 @@ class ActionsStripeconnect
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$customer=$stripe->customerStripe($object, $stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object, $stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
}
|
} elseif (is_object($object) && $object->element == 'adherent_type'){
|
||||||
elseif (is_object($object) && $object->element == 'adherent_type'){
|
|
||||||
$this->resprints.= '<tr><td>';
|
$this->resprints.= '<tr><td>';
|
||||||
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
$this->resprints.= '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||||
$this->resprints.= $langs->trans('PlanStripe');
|
$this->resprints.= $langs->trans('PlanStripe');
|
||||||
@@ -161,8 +158,7 @@ class ActionsStripeconnect
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$customer=$stripe->customerStripe($object, $stripe->getStripeAccount($service));
|
$customer=$stripe->customerStripe($object, $stripe->getStripeAccount($service));
|
||||||
$this->resprints.= $customer->id;
|
$this->resprints.= $customer->id;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->resprints.= $langs->trans("NoStripe");
|
$this->resprints.= $langs->trans("NoStripe");
|
||||||
}
|
}
|
||||||
$this->resprints.= '</td></tr>';
|
$this->resprints.= '</td></tr>';
|
||||||
@@ -178,7 +174,7 @@ class ActionsStripeconnect
|
|||||||
* @param string $action action
|
* @param string $action action
|
||||||
* @return int 0
|
* @return int 0
|
||||||
*/
|
*/
|
||||||
function addMoreActionsButtons($parameters, &$object, &$action)
|
public function addMoreActionsButtons($parameters, &$object, &$action)
|
||||||
{
|
{
|
||||||
global $db,$conf,$user,$langs,$form;
|
global $db,$conf,$user,$langs,$form;
|
||||||
if (is_object($object) && $object->element == 'facture'){
|
if (is_object($object) && $object->element == 'facture'){
|
||||||
|
|||||||
@@ -91,17 +91,14 @@ class Stripe extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
if ($this->db->num_rows($result)) {
|
||||||
if ($this->db->num_rows($result))
|
|
||||||
{
|
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
$tokenstring=$obj->tokenstring;
|
$tokenstring=$obj->tokenstring;
|
||||||
|
|
||||||
$tmparray = dol_json_decode($tokenstring);
|
$tmparray = dol_json_decode($tokenstring);
|
||||||
$key = $tmparray->stripe_user_id;
|
$key = $tmparray->stripe_user_id;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$tokenstring='';
|
$tokenstring='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,8 +308,7 @@ class Stripe extends CommonObject
|
|||||||
$fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
|
$fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100);
|
||||||
if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
|
if ($fee >= ($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100) && $conf->global->STRIPE_APPLICATION_FEE_MAXIMAL>$conf->global->STRIPE_APPLICATION_FEE_MINIMAL) {
|
||||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
|
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MAXIMAL * 100);
|
||||||
}
|
} elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
||||||
elseif ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) {
|
|
||||||
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
|
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user