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');
|
||||||
@@ -77,7 +77,7 @@ class PrestaShopWebservice
|
|||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
$this->debug = $debug;
|
$this->debug = $debug;
|
||||||
$this->version = 'unknown';
|
$this->version = 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take the status code and throw an exception if the server didn't return 200 or 201 code
|
* Take the status code and throw an exception if the server didn't return 200 or 201 code
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -291,44 +291,44 @@ class Dolistore
|
|||||||
</td>
|
</td>
|
||||||
<td class="margeCote">'.$download_link.'</td>
|
<td class="margeCote">'.$download_link.'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
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();
|
||||||
if ($this->start < $this->per_page) {
|
if ($this->start < $this->per_page) {
|
||||||
@@ -343,15 +343,15 @@ class Dolistore
|
|||||||
}
|
}
|
||||||
$param = http_build_query($param_array);
|
$param = http_build_query($param_array);
|
||||||
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);
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class Proposals extends DolibarrApi
|
|||||||
* @return int ID of proposal
|
* @return int ID of proposal
|
||||||
*/
|
*/
|
||||||
public function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ class Proposals extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->propal->id;
|
return $this->propal->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get lines of a commercial proposal
|
* Get lines of a commercial proposal
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -300,20 +300,20 @@ class BonPrelevement extends CommonObject
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->ref;
|
$this->ref = $obj->ref;
|
||||||
$this->amount = $obj->amount;
|
$this->amount = $obj->amount;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
$this->datec = $this->db->jdate($obj->dc);
|
$this->datec = $this->db->jdate($obj->dc);
|
||||||
|
|
||||||
$this->date_trans = $this->db->jdate($obj->date_trans);
|
$this->date_trans = $this->db->jdate($obj->date_trans);
|
||||||
$this->method_trans = $obj->method_trans;
|
$this->method_trans = $obj->method_trans;
|
||||||
$this->user_trans = $obj->fk_user_trans;
|
$this->user_trans = $obj->fk_user_trans;
|
||||||
|
|
||||||
$this->date_credit = $this->db->jdate($obj->date_credit);
|
$this->date_credit = $this->db->jdate($obj->date_credit);
|
||||||
$this->user_credit = $obj->fk_user_credit;
|
$this->user_credit = $obj->fk_user_credit;
|
||||||
|
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
|
|
||||||
$this->fetched = 1;
|
$this->fetched = 1;
|
||||||
|
|
||||||
@@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -29,138 +29,137 @@ include_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php
|
|||||||
*/
|
*/
|
||||||
class SalariesStats extends Stats
|
class SalariesStats extends Stats
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
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
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param int $socid Id third party
|
* @param int $socid Id third party
|
||||||
* @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;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->socid = $socid;
|
$this->socid = $socid;
|
||||||
$this->userid = $userid;
|
$this->userid = $userid;
|
||||||
|
|
||||||
$object=new PaymentSalary($this->db);
|
$object=new PaymentSalary($this->db);
|
||||||
$this->from = MAIN_DB_PREFIX.$object->table_element;
|
$this->from = MAIN_DB_PREFIX.$object->table_element;
|
||||||
$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).')';
|
elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
|
||||||
elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of salary by year
|
* Return the number of salary by year
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm DESC";
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
|
|
||||||
return $this->_getNbByYear($sql);
|
return $this->_getNbByYear($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of salary by month, for a given year
|
* Return the number of salary by month, for a given year
|
||||||
*
|
*
|
||||||
* @param string $year Year to scan
|
* @param string $year Year to scan
|
||||||
* @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;
|
||||||
$sql.= " WHERE YEAR(datep) = ".$year;
|
$sql.= " WHERE YEAR(datep) = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= $this->db->order('dm', 'DESC');
|
$sql.= $this->db->order('dm', 'DESC');
|
||||||
|
|
||||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return amount of salaries by month for a given year
|
* Return amount of salaries by month for a given year
|
||||||
*
|
*
|
||||||
* @param int $year Year to scan
|
* @param int $year Year to scan
|
||||||
* @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;
|
||||||
$sql.= " WHERE date_format(datep,'%Y') = '".$year."'";
|
$sql.= " WHERE date_format(datep,'%Y') = '".$year."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= $this->db->order('dm', 'DESC');
|
$sql.= $this->db->order('dm', 'DESC');
|
||||||
|
|
||||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return average amount
|
* Return average amount
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
$sql.= " WHERE date_format(datep,'%Y') = '".$year."'";
|
$sql.= " WHERE date_format(datep,'%Y') = '".$year."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= $this->db->order('dm', 'DESC');
|
$sql.= $this->db->order('dm', 'DESC');
|
||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return nb, total and average
|
* Return nb, total and average
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY year";
|
$sql.= " GROUP BY year";
|
||||||
$sql.= $this->db->order('year', 'DESC');
|
$sql.= $this->db->order('year', 'DESC');
|
||||||
|
|
||||||
return $this->_getAllByYear($sql);
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +191,9 @@ 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.
|
||||||
*
|
*
|
||||||
* @param Commande $object Object source to build document
|
* @param Commande $object Object source to build document
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
@@ -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;
|
||||||
@@ -338,7 +338,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
// Open and load template
|
// Open and load template
|
||||||
require_once ODTPHP_PATH.'odf.php';
|
require_once ODTPHP_PATH.'odf.php';
|
||||||
try {
|
try {
|
||||||
$odfHandler = new odf(
|
$odfHandler = new odf(
|
||||||
$srctemplatepath,
|
$srctemplatepath,
|
||||||
array(
|
array(
|
||||||
'PATH_TO_TMP' => $conf->commande->dir_temp,
|
'PATH_TO_TMP' => $conf->commande->dir_temp,
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -337,7 +337,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||||||
// Open and load template
|
// Open and load template
|
||||||
require_once ODTPHP_PATH.'odf.php';
|
require_once ODTPHP_PATH.'odf.php';
|
||||||
try {
|
try {
|
||||||
$odfHandler = new odf(
|
$odfHandler = new odf(
|
||||||
$srctemplatepath,
|
$srctemplatepath,
|
||||||
array(
|
array(
|
||||||
'PATH_TO_TMP' => $conf->expedition->dir_temp,
|
'PATH_TO_TMP' => $conf->expedition->dir_temp,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -1107,15 +1107,15 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param PDF $pdf PDF
|
||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @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");
|
||||||
|
|||||||
@@ -114,13 +114,13 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|
||||||
// Translations
|
// Translations
|
||||||
@@ -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;
|
||||||
|
|
||||||
@@ -1054,15 +1052,15 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param PDF $pdf PDF
|
||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @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,10 +59,10 @@ 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;
|
||||||
|
|
||||||
@@ -116,15 +116,15 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
|||||||
return $numExample;
|
return $numExample;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return next free value
|
* Return next free value
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
@@ -154,5 +154,5 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport
|
|||||||
$numFinal=get_next_value($db, $mask, 'expensereport', 'ref', '', null, $date, 'next', true, $fuser);
|
$numFinal=get_next_value($db, $mask, 'expensereport', 'ref', '', null, $date, 'next', true, $fuser);
|
||||||
|
|
||||||
return $numFinal;
|
return $numFinal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,8 +67,7 @@ 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");
|
||||||
@@ -140,20 +138,20 @@ abstract class ModeleNumRefExpenseReport
|
|||||||
return $langs->trans("NotAvailable");
|
return $langs->trans("NotAvailable");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the version of the numbering module
|
* Returns the version of the numbering module
|
||||||
*
|
*
|
||||||
* @return string Value
|
* @return string Value
|
||||||
*/
|
*/
|
||||||
public 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,20 +174,20 @@ 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
|
||||||
*
|
*
|
||||||
* @param Object $object Object to generate
|
* @param Object $object Object to generate
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @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;
|
||||||
|
|
||||||
@@ -910,18 +910,18 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param PDF $pdf PDF
|
||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @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;
|
||||||
return pdf_pagefoot($pdf, $outputlangs, 'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
|
return pdf_pagefoot($pdf, $outputlangs, 'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,15 +160,15 @@ 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
|
||||||
*
|
*
|
||||||
* @param Societe $objsoc Object thirdparty
|
* @param Societe $objsoc Object thirdparty
|
||||||
* @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,8 +60,8 @@ 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;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -36,119 +36,119 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
|
abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
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
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @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;
|
||||||
|
|
||||||
$type='delivery';
|
$type='delivery';
|
||||||
$liste=array();
|
$liste=array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$liste=getListOfModels($db, $type, $maxfilenamelength);
|
$liste=getListOfModels($db, $type, $maxfilenamelength);
|
||||||
|
|
||||||
return $liste;
|
return $liste;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class ModeleNumRefDeliveryOrder
|
* \class ModeleNumRefDeliveryOrder
|
||||||
* \brief Classe mere des modeles de numerotation des references de bon de livraison
|
* \brief Classe mere des modeles de numerotation des references de bon de livraison
|
||||||
*/
|
*/
|
||||||
abstract class ModeleNumRefDeliveryOrder
|
abstract class ModeleNumRefDeliveryOrder
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return if a module can be used or not
|
* Return if a module can be used or not
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoi la description par defaut du modele de numerotation
|
* Renvoi la description par defaut du modele de numerotation
|
||||||
*
|
*
|
||||||
* @return string Texte descripif
|
* @return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
return $langs->trans("NoDescription");
|
return $langs->trans("NoDescription");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoi un exemple de numerotation
|
* Renvoi un exemple de numerotation
|
||||||
*
|
*
|
||||||
* @return string Example
|
* @return string Example
|
||||||
*/
|
*/
|
||||||
function getExample()
|
public function getExample()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
return $langs->trans("NoExample");
|
return $langs->trans("NoExample");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test si les numeros deja en vigueur dans la base ne provoquent pas d
|
* Test si les numeros deja en vigueur dans la base ne provoquent pas d
|
||||||
* de conflits qui empechera cette numerotation de fonctionner.
|
* de conflits qui empechera cette numerotation de fonctionner.
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoi prochaine valeur attribuee
|
* Renvoi prochaine valeur attribuee
|
||||||
*
|
*
|
||||||
* @param Societe $objsoc Object third party
|
* @param Societe $objsoc Object third party
|
||||||
* @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");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoi version du module numerotation
|
* Renvoi version du module numerotation
|
||||||
*
|
*
|
||||||
* @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.
|
||||||
@@ -45,15 +45,15 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,8 +64,8 @@ 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;
|
||||||
|
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
@@ -80,7 +80,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
$statssql[0].= " AND c.statut = 1";
|
$statssql[0].= " AND c.statut = 1";
|
||||||
|
|
||||||
return $statssql;
|
return $statssql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,8 +91,8 @@ 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;
|
||||||
|
|
||||||
$sql = "SELECT count(distinct(c.email)) as nb";
|
$sql = "SELECT count(distinct(c.email)) as nb";
|
||||||
@@ -105,7 +105,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
|
|
||||||
// The request must return a field called "nb" to be understandable by parent::getNbOfRecipients
|
// The request must return a field called "nb" to be understandable by parent::getNbOfRecipients
|
||||||
return parent::getNbOfRecipients($sql);
|
return parent::getNbOfRecipients($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,8 +113,8 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
*
|
*
|
||||||
* @return string Retourne zone select
|
* @return string Retourne zone select
|
||||||
*/
|
*/
|
||||||
function formFilter()
|
public function formFilter()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
@@ -311,7 +311,7 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
$s.='</select>';
|
$s.='</select>';
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -320,21 +320,21 @@ 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;
|
||||||
|
|
||||||
@@ -448,5 +448,5 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
return parent::add_to_target($mailing_id, $cibles);
|
return parent::add_to_target($mailing_id, $cibles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -103,14 +103,14 @@ class mailing_example extends MailingTargets
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return here number of distinct emails returned by your selector.
|
* Return here number of distinct emails returned by your selector.
|
||||||
* For example if this selector is used to extract 500 different
|
* For example if this selector is used to extract 500 different
|
||||||
* emails from a text file, this function must return 500.
|
* emails from a text file, this function must return 500.
|
||||||
*
|
*
|
||||||
* @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
|
||||||
|
|
||||||
@@ -121,11 +121,11 @@ class mailing_example extends MailingTargets
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is to add a form filter to provide variant of selector
|
* This is to add a form filter to provide variant of selector
|
||||||
* If used, the HTML select must be called "filter"
|
* If used, the HTML select must be called "filter"
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
@@ -191,17 +191,17 @@ class mailing_pomme extends MailingTargets
|
|||||||
if ($old <> $obj->email)
|
if ($old <> $obj->email)
|
||||||
{
|
{
|
||||||
$cibles[$j] = array(
|
$cibles[$j] = array(
|
||||||
'email' => $obj->email,
|
'email' => $obj->email,
|
||||||
'fk_contact' => $obj->fk_contact,
|
'fk_contact' => $obj->fk_contact,
|
||||||
'lastname' => $obj->lastname,
|
'lastname' => $obj->lastname,
|
||||||
'firstname' => $obj->firstname,
|
'firstname' => $obj->firstname,
|
||||||
'other' =>
|
'other' =>
|
||||||
($langs->transnoentities("Login").'='.$obj->login).';'.
|
($langs->transnoentities("Login").'='.$obj->login).';'.
|
||||||
($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'.
|
($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'.
|
||||||
($langs->transnoentities("PhonePro").'='.$obj->office_phone),
|
($langs->transnoentities("PhonePro").'='.$obj->office_phone),
|
||||||
'source_url' => $this->url($obj->id),
|
'source_url' => $this->url($obj->id),
|
||||||
'source_id' => $obj->id,
|
'source_id' => $obj->id,
|
||||||
'source_type' => 'user'
|
'source_type' => 'user'
|
||||||
);
|
);
|
||||||
$old = $obj->email;
|
$old = $obj->email;
|
||||||
$j++;
|
$j++;
|
||||||
@@ -218,5 +218,5 @@ class mailing_pomme extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
return parent::add_to_target($mailing_id, $cibles);
|
return parent::add_to_target($mailing_id, $cibles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,24 +30,24 @@ 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';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @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,8 +58,8 @@ 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;
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
@@ -94,18 +94,18 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
// Recupere emetteur
|
// Recupere emetteur
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
|
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return description of a module
|
* Return description of a module
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@@ -183,22 +183,22 @@ class doc_generic_reception_odt extends ModelePdfReception
|
|||||||
$texte.= '</form>';
|
$texte.= '</form>';
|
||||||
|
|
||||||
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.
|
||||||
*
|
*
|
||||||
* @param Reception $object Object source to build document
|
* @param Reception $object Object source to build document
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @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;
|
||||||
|
|
||||||
@@ -1363,15 +1363,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param PDF $pdf PDF
|
||||||
* @param CommandeFournisseur $object Object to show
|
* @param CommandeFournisseur $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @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;
|
||||||
|
|||||||
@@ -1491,16 +1491,16 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
return $top_shift;
|
return $top_shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show footer of page. Need this->emetteur object
|
* Show footer of page. Need this->emetteur object
|
||||||
*
|
*
|
||||||
* @param PDF $pdf PDF
|
* @param PDF $pdf PDF
|
||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @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,9 +203,9 @@ 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.
|
||||||
*
|
*
|
||||||
* @param User $object Object source to build document
|
* @param User $object Object source to build document
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
@@ -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;
|
||||||
@@ -330,7 +330,7 @@ class doc_generic_user_odt extends ModelePDFUser
|
|||||||
// Open and load template
|
// Open and load template
|
||||||
require_once ODTPHP_PATH.'odf.php';
|
require_once ODTPHP_PATH.'odf.php';
|
||||||
try {
|
try {
|
||||||
$odfHandler = new odf(
|
$odfHandler = new odf(
|
||||||
$srctemplatepath,
|
$srctemplatepath,
|
||||||
array(
|
array(
|
||||||
'PATH_TO_TMP' => $conf->user->dir_temp,
|
'PATH_TO_TMP' => $conf->user->dir_temp,
|
||||||
@@ -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;
|
||||||
@@ -353,7 +353,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
// Open and load template
|
// Open and load template
|
||||||
require_once ODTPHP_PATH.'odf.php';
|
require_once ODTPHP_PATH.'odf.php';
|
||||||
try {
|
try {
|
||||||
$odfHandler = new odf(
|
$odfHandler = new odf(
|
||||||
$srctemplatepath,
|
$srctemplatepath,
|
||||||
array(
|
array(
|
||||||
'PATH_TO_TMP' => $conf->user->dir_temp,
|
'PATH_TO_TMP' => $conf->user->dir_temp,
|
||||||
@@ -527,6 +527,6 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,30 +38,30 @@
|
|||||||
*/
|
*/
|
||||||
abstract class ModelePDFUserGroup extends CommonDocGenerator
|
abstract class ModelePDFUserGroup extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var string Error code (or message)
|
|
||||||
*/
|
|
||||||
public $error='';
|
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* @var string Error code (or message)
|
||||||
*
|
*/
|
||||||
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
/**
|
||||||
|
* Return list of active generation modules
|
||||||
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @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;
|
||||||
|
|
||||||
$type = 'group';
|
$type = 'group';
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$list = getListOfModels($db, $type, $maxfilenamelength);
|
$list = getListOfModels($db, $type, $maxfilenamelength);
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -63,21 +63,21 @@ class SupplierOrders extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->lire) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->order->fetch($id);
|
$result = $this->order->fetch($id);
|
||||||
if ( ! $result ) {
|
if ( ! $result ) {
|
||||||
throw new RestException(404, 'Supplier order not found');
|
throw new RestException(404, 'Supplier order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
if ( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->order->fetchObjectLinked();
|
$this->order->fetchObjectLinked();
|
||||||
return $this->_cleanObjectDatas($this->order);
|
return $this->_cleanObjectDatas($this->order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,7 +94,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
|
||||||
* @return array Array of order objects
|
* @return array Array of order objects
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '')
|
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '')
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||||
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') $sql.= " AND t.fk_statut IN (0)";
|
||||||
if ($status == 'validated') $sql.= " AND t.fk_statut IN (1)";
|
if ($status == 'validated') $sql.= " AND t.fk_statut IN (1)";
|
||||||
if ($status == 'approved') $sql.= " AND t.fk_statut IN (2)";
|
if ($status == 'approved') $sql.= " AND t.fk_statut IN (2)";
|
||||||
@@ -141,7 +141,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
{
|
{
|
||||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||||
}
|
}
|
||||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
if( ! count($obj_ret)) {
|
if( ! count($obj_ret)) {
|
||||||
throw new RestException(404, 'No supplier order found');
|
throw new RestException(404, 'No supplier order found');
|
||||||
}
|
}
|
||||||
return $obj_ret;
|
return $obj_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -234,9 +234,9 @@ class SupplierOrders extends DolibarrApi
|
|||||||
throw new RestException(404, 'Supplier order not found');
|
throw new RestException(404, 'Supplier order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($request_data as $field => $value) {
|
foreach($request_data as $field => $value) {
|
||||||
if ($field == 'id') continue;
|
if ($field == 'id') continue;
|
||||||
@@ -265,9 +265,9 @@ class SupplierOrders extends DolibarrApi
|
|||||||
throw new RestException(404, 'Supplier order not found');
|
throw new RestException(404, 'Supplier order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
if ( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->order->delete(DolibarrApiAccess::$user) < 0) {
|
if ( $this->order->delete(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(500);
|
throw new RestException(500);
|
||||||
@@ -302,32 +302,32 @@ class SupplierOrders extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function validate($id, $idwarehouse = 0, $notrigger = 0)
|
public function validate($id, $idwarehouse = 0, $notrigger = 0)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$result = $this->order->fetch($id);
|
$result = $this->order->fetch($id);
|
||||||
if( ! $result ) {
|
if( ! $result ) {
|
||||||
throw new RestException(404, 'Order not found');
|
throw new RestException(404, 'Order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->order->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger);
|
$result = $this->order->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger);
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||||
}
|
}
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when validating Order: '.$this->order->error);
|
throw new RestException(500, 'Error when validating Order: '.$this->order->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'message' => 'Order validated (Ref='.$this->order->ref.')'
|
'message' => 'Order validated (Ref='.$this->order->ref.')'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -262,7 +262,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= " c.date_commande as date_commande, c.date_livraison as date_livraison, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_input_method,";
|
$sql.= " c.date_commande as date_commande, c.date_livraison as date_livraison, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_input_method,";
|
||||||
$sql.= " c.fk_account,";
|
$sql.= " c.fk_account,";
|
||||||
$sql.= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,";
|
$sql.= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,";
|
||||||
$sql.= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,";
|
$sql.= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,";
|
||||||
$sql.= " cm.libelle as methode_commande,";
|
$sql.= " cm.libelle as methode_commande,";
|
||||||
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle,";
|
$sql.= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle,";
|
||||||
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
|
$sql.= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle";
|
||||||
@@ -272,7 +272,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON c.fk_cond_reglement = cr.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
|
||||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||||
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
||||||
else $sql.= " AND c.rowid=".$id;
|
else $sql.= " AND c.rowid=".$id;
|
||||||
@@ -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,12 +1088,12 @@ 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;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
//dol_syslog("CommandeFournisseur::Cancel");
|
//dol_syslog("CommandeFournisseur::Cancel");
|
||||||
$result = 0;
|
$result = 0;
|
||||||
@@ -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)
|
||||||
@@ -2469,7 +2469,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
|
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
|
||||||
{
|
{
|
||||||
global $mysoc, $conf;
|
global $mysoc, $conf;
|
||||||
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
|
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
@@ -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;
|
||||||
@@ -2918,7 +2918,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @return Translated string
|
* @return Translated string
|
||||||
*/
|
*/
|
||||||
public function getMaxDeliveryTimeDay($langs)
|
public function getMaxDeliveryTimeDay($langs)
|
||||||
{
|
{
|
||||||
if (empty($this->lines)) return '';
|
if (empty($this->lines)) return '';
|
||||||
|
|
||||||
$obj = new ProductFournisseur($this->db);
|
$obj = new ProductFournisseur($this->db);
|
||||||
@@ -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,21 +17,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 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";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage table commandefournisseurdispatch
|
* Class to manage table commandefournisseurdispatch
|
||||||
*/
|
*/
|
||||||
class CommandeFournisseurDispatch extends CommonObject
|
class CommandeFournisseurDispatch extends CommonObject
|
||||||
{
|
{
|
||||||
@@ -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;
|
||||||
|
|
||||||
@@ -531,15 +529,15 @@ class CommandeFournisseurDispatch extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return label of the status of object
|
* Return label of the status of object
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/fourn/class/fournisseur.facture.class.php
|
* \file htdocs/fourn/class/fournisseur.facture.class.php
|
||||||
* \ingroup fournisseur,facture
|
* \ingroup fournisseur,facture
|
||||||
* \brief File of class to manage suppliers invoices
|
* \brief File of class to manage suppliers invoices
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
||||||
@@ -53,14 +53,14 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
public $table_element='facture_fourn';
|
public $table_element='facture_fourn';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Name of subtable line
|
* @var int Name of subtable line
|
||||||
*/
|
*/
|
||||||
public $table_element_line='facture_fourn_det';
|
public $table_element_line='facture_fourn_det';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var int Field with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element='fk_facture_fourn';
|
public $fk_element='fk_facture_fourn';
|
||||||
|
|
||||||
public $picto='bill';
|
public $picto='bill';
|
||||||
|
|
||||||
@@ -707,22 +707,22 @@ 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();
|
||||||
|
|
||||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx';
|
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx';
|
||||||
$sql.= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn ';
|
$sql.= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn ';
|
||||||
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||||
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc';
|
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc';
|
||||||
$sql.= ', f.fk_multicurrency, f.multicurrency_code, f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc';
|
$sql.= ', f.fk_multicurrency, f.multicurrency_code, f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
|
||||||
$sql.= ' WHERE fk_facture_fourn='.$this->id;
|
$sql.= ' WHERE fk_facture_fourn='.$this->id;
|
||||||
@@ -783,12 +783,12 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$line->fk_unit = $obj->fk_unit;
|
$line->fk_unit = $obj->fk_unit;
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency
|
||||||
$line->fk_multicurrency = $obj->fk_multicurrency;
|
$line->fk_multicurrency = $obj->fk_multicurrency;
|
||||||
$line->multicurrency_code = $obj->multicurrency_code;
|
$line->multicurrency_code = $obj->multicurrency_code;
|
||||||
$line->multicurrency_subprice = $obj->multicurrency_subprice;
|
$line->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||||
$line->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
$line->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||||
$line->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
$line->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||||
$line->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
$line->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
|
|
||||||
@@ -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,16 +1187,16 @@ 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
|
||||||
*
|
*
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet. Not implementd yet.
|
* @param string $close_code Code renseigne si on classe a payee completement 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.
|
* @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,13 +455,13 @@ 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;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$obj = $this->getEstablishment(($id>0)?$id:$conf->entity);
|
$obj = $this->getEstablishment(($id>0)?$id:$conf->entity);
|
||||||
|
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$obj->rowid.'">';
|
$link = '<a href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$obj->rowid.'">';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class Loan extends CommonObject
|
|||||||
public $date_creation;
|
public $date_creation;
|
||||||
public $date_modification;
|
public $date_modification;
|
||||||
public $date_validation;
|
public $date_validation;
|
||||||
|
|
||||||
public $insurance_amount;
|
public $insurance_amount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -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';
|
||||||
@@ -597,5 +597,5 @@ class Loan extends CommonObject
|
|||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -354,22 +354,21 @@ class LoanSchedule 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
|
||||||
*/
|
*/
|
||||||
public function delete($user, $notrigger = 0)
|
public function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$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;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@@ -403,7 +402,7 @@ class LoanSchedule extends CommonObject
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate Monthly Payments
|
* Calculate Monthly Payments
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -17,46 +17,46 @@ 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.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
if (is_array($conf->modules))
|
if (is_array($conf->modules))
|
||||||
{
|
{
|
||||||
$this->enabled=in_array('mymodule', $conf->modules)?1:0;
|
$this->enabled=in_array('mymodule', $conf->modules)?1:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
|
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
|
||||||
*
|
*
|
||||||
* @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");
|
||||||
@@ -71,7 +71,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
$s.='<option value="none"> </option>';
|
$s.='<option value="none"> </option>';
|
||||||
foreach($arraystatus as $status)
|
foreach($arraystatus as $status)
|
||||||
{
|
{
|
||||||
$s.='<option value="'.$status.'">'.$status.'</option>';
|
$s.='<option value="'.$status.'">'.$status.'</option>';
|
||||||
}
|
}
|
||||||
$s.='</select>';
|
$s.='</select>';
|
||||||
$s.='<br>';
|
$s.='<br>';
|
||||||
@@ -81,122 +81,122 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie url lien vers fiche de la source du destinataire du mailing
|
* Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||||
*
|
*
|
||||||
* @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();
|
||||||
$j = 0;
|
$j = 0;
|
||||||
|
|
||||||
|
|
||||||
$sql = " select rowid as id, email, firstname, lastname, plan, partner";
|
$sql = " select rowid as id, email, firstname, lastname, plan, partner";
|
||||||
$sql.= " from ".MAIN_DB_PREFIX."myobject";
|
$sql.= " from ".MAIN_DB_PREFIX."myobject";
|
||||||
$sql.= " where email IS NOT NULL AND email != ''";
|
$sql.= " where email IS NOT NULL AND email != ''";
|
||||||
if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'";
|
if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'";
|
||||||
$sql.= " ORDER BY email";
|
$sql.= " ORDER BY email";
|
||||||
|
|
||||||
// Stocke destinataires dans target
|
// Stocke destinataires dans target
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
dol_syslog("mailinglist_mymodule_myobject.modules.php: mailing ".$num." targets found");
|
dol_syslog("mailinglist_mymodule_myobject.modules.php: mailing ".$num." targets found");
|
||||||
|
|
||||||
$old = '';
|
$old = '';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
if ($old <> $obj->email)
|
if ($old <> $obj->email)
|
||||||
{
|
{
|
||||||
$target[$j] = array(
|
$target[$j] = array(
|
||||||
'email' => $obj->email,
|
'email' => $obj->email,
|
||||||
'name' => $obj->lastname,
|
'name' => $obj->lastname,
|
||||||
'id' => $obj->id,
|
'id' => $obj->id,
|
||||||
'firstname' => $obj->firstname,
|
'firstname' => $obj->firstname,
|
||||||
'other' => $obj->plan.';'.$obj->partner,
|
'other' => $obj->plan.';'.$obj->partner,
|
||||||
'source_url' => $this->url($obj->id),
|
'source_url' => $this->url($obj->id),
|
||||||
'source_id' => $obj->id,
|
'source_id' => $obj->id,
|
||||||
'source_type' => 'dolicloud'
|
'source_type' => 'dolicloud'
|
||||||
);
|
);
|
||||||
$old = $obj->email;
|
$old = $obj->email;
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog($this->db->error());
|
dol_syslog($this->db->error());
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// You must fill the $target array with record like this
|
// You must fill the $target array with record like this
|
||||||
// $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0');
|
// $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0');
|
||||||
// ...
|
// ...
|
||||||
// $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n');
|
// $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n');
|
||||||
|
|
||||||
// Example: $target[0]=array('email'=>'myemail@mydomain.com','name'=>'Doe','firstname'=>'John');
|
// Example: $target[0]=array('email'=>'myemail@mydomain.com','name'=>'Doe','firstname'=>'John');
|
||||||
|
|
||||||
// ----- Your code end here -----
|
// ----- Your code end here -----
|
||||||
|
|
||||||
return parent::add_to_target($mailing_id, $target);
|
return parent::add_to_target($mailing_id, $target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On the main mailing area, there is a box with statistics.
|
* On the main mailing area, there is a box with statistics.
|
||||||
* If you want to add a line in this report you must provide an
|
* If you want to add a line in this report you must provide an
|
||||||
* array of SQL request that returns two field:
|
* array of SQL request that returns two field:
|
||||||
* One called "label", One called "nb".
|
* One called "label", One called "nb".
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
public function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
// CHANGE THIS: Optionnal
|
// CHANGE THIS: Optionnal
|
||||||
|
|
||||||
//var $statssql=array();
|
//var $statssql=array();
|
||||||
//$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
|
//$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
|
||||||
|
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return here number of distinct emails returned by your selector.
|
* Return here number of distinct emails returned by your selector.
|
||||||
* For example if this selector is used to extract 500 different
|
* For example if this selector is used to extract 500 different
|
||||||
* emails from a text file, this function must return 500.
|
* emails from a text file, this function must return 500.
|
||||||
*
|
*
|
||||||
* @param string $filter Filter
|
* @param string $filter Filter
|
||||||
* @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 != ''");
|
||||||
|
|
||||||
if ($a < 0) return -1;
|
if ($a < 0) return -1;
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +429,9 @@ 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;
|
||||||
|
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
$currency->code = $code;
|
$currency->code = $code;
|
||||||
@@ -455,7 +455,7 @@ class MultiCurrency extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add new entry into llx_multicurrency_rate to historise
|
* Add new entry into llx_multicurrency_rate to historise
|
||||||
@@ -463,9 +463,9 @@ class MultiCurrency extends CommonObject
|
|||||||
* @param double $rate rate value
|
* @param double $rate rate value
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateRate($rate)
|
public function updateRate($rate)
|
||||||
{
|
{
|
||||||
return $this->addRate($rate);
|
return $this->addRate($rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,8 +474,8 @@ class MultiCurrency extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function getRate()
|
public function getRate()
|
||||||
{
|
{
|
||||||
$sql = 'SELECT cr.rowid';
|
$sql = 'SELECT cr.rowid';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr';
|
||||||
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
$sql.= ' WHERE cr.fk_multicurrency = '.$this->id;
|
||||||
@@ -497,8 +497,8 @@ class MultiCurrency extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return 0 if not found, >0 if OK
|
* @return 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public static function getIdFromCode(&$db, $code)
|
public static function getIdFromCode(&$db, $code)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity;
|
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity;
|
||||||
@@ -519,8 +519,8 @@ class MultiCurrency extends CommonObject
|
|||||||
* @return array [0] => id currency
|
* @return array [0] => id currency
|
||||||
* [1] => rate
|
* [1] => rate
|
||||||
*/
|
*/
|
||||||
public static function getIdAndTxFromCode(&$db, $code, $date_document = '')
|
public static function getIdAndTxFromCode(&$db, $code, $date_document = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
|
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -28,29 +28,29 @@ 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();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param string $dirmodule Name of directory of module
|
* @param string $dirmodule Name of directory of module
|
||||||
* @param string $targetmodule Name of directory where canvas is stored
|
* @param string $targetmodule Name of directory where canvas is stored
|
||||||
* @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;
|
||||||
$this->targetmodule = $targetmodule;
|
$this->targetmodule = $targetmodule;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,25 +29,25 @@
|
|||||||
*/
|
*/
|
||||||
class PriceExpression
|
class PriceExpression
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string[] Error codes (or messages)
|
|
||||||
*/
|
|
||||||
public $errors = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $errors = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
public $title;
|
public $title;
|
||||||
public $expression;
|
public $expression;
|
||||||
@@ -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,60 +75,60 @@ 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;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->title)) $this->title=trim($this->title);
|
if (isset($this->title)) $this->title=trim($this->title);
|
||||||
if (isset($this->expression)) $this->expression=trim($this->expression);
|
if (isset($this->expression)) $this->expression=trim($this->expression);
|
||||||
|
|
||||||
// Insert request
|
// Insert request
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." (";
|
||||||
$sql.= "title, expression";
|
$sql.= "title, expression";
|
||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= " ".(isset($this->title)?"'".$this->db->escape($this->title)."'":"''").",";
|
$sql.= " ".(isset($this->title)?"'".$this->db->escape($this->title)."'":"''").",";
|
||||||
$sql.= " ".(isset($this->expression)?"'".$this->db->escape($this->expression)."'":"''");
|
$sql.= " ".(isset($this->expression)?"'".$this->db->escape($this->expression)."'":"''");
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$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.
|
||||||
|
|
||||||
//// Call triggers
|
//// Call triggers
|
||||||
//$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
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
foreach($this->errors as $errmsg)
|
foreach($this->errors as $errmsg)
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1*$error;
|
return -1*$error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -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))
|
||||||
@@ -151,7 +151,7 @@ class PriceExpression
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE rowid = ".$id;
|
$sql.= " WHERE rowid = ".$id;
|
||||||
|
|
||||||
dol_syslog(__METHOD__);
|
dol_syslog(__METHOD__);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@@ -170,18 +170,18 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error="Error ".$this->db->lasterror();
|
$this->error="Error ".$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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";
|
||||||
@@ -199,7 +199,7 @@ class PriceExpression
|
|||||||
$price_expression_obj = new PriceExpression($this->db);
|
$price_expression_obj = new PriceExpression($this->db);
|
||||||
$price_expression_obj->id = $record["rowid"];
|
$price_expression_obj->id = $record["rowid"];
|
||||||
$price_expression_obj->title = $record["title"];
|
$price_expression_obj->title = $record["title"];
|
||||||
$price_expression_obj->expression = $record["expression"];
|
$price_expression_obj->expression = $record["expression"];
|
||||||
$retarray[]=$price_expression_obj;
|
$retarray[]=$price_expression_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,28 +214,28 @@ 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";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE title = '".$this->db->escape($title)."'";
|
$sql.= " WHERE title = '".$this->db->escape($title)."'";
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
return (int) $obj->rowid;
|
return (int) $obj->rowid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -244,7 +244,7 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error="Error ".$this->db->lasterror();
|
$this->error="Error ".$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,125 +257,125 @@ 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;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->title)) $this->title=trim($this->title);
|
if (isset($this->title)) $this->title=trim($this->title);
|
||||||
if (isset($this->expression)) $this->expression=trim($this->expression);
|
if (isset($this->expression)) $this->expression=trim($this->expression);
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||||
$sql.= " title = ".(isset($this->title)?"'".$this->db->escape($this->title)."'":"''").",";
|
$sql.= " title = ".(isset($this->title)?"'".$this->db->escape($this->title)."'":"''").",";
|
||||||
$sql.= " expression = ".(isset($this->expression)?"'".$this->db->escape($this->expression)."'":"''")."";
|
$sql.= " expression = ".(isset($this->expression)?"'".$this->db->escape($this->expression)."'":"''")."";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
dol_syslog(__METHOD__);
|
dol_syslog(__METHOD__);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
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 calls a trigger.
|
// // want this action calls a trigger.
|
||||||
|
|
||||||
// //// Call triggers
|
// //// Call triggers
|
||||||
// //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
// //$result=$this->call_trigger('MYOBJECT_MODIFY',$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
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
foreach($this->errors as $errmsg)
|
foreach($this->errors as $errmsg)
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1*$error;
|
return -1*$error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete object in database
|
* Delete object in database
|
||||||
*
|
*
|
||||||
* @param User $user User that deletes
|
* @param User $user User that deletes
|
||||||
* @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;
|
||||||
|
|
||||||
$rowid = $this->id;
|
$rowid = $this->id;
|
||||||
|
|
||||||
$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.
|
||||||
|
|
||||||
//// Call triggers
|
//// Call triggers
|
||||||
//$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)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " WHERE rowid = ".$rowid;
|
$sql.= " WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
dol_syslog(__METHOD__);
|
dol_syslog(__METHOD__);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
foreach($this->errors as $errmsg)
|
foreach($this->errors as $errmsg)
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1*$error;
|
return -1*$error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise object with example values
|
* Initialise object with example values
|
||||||
* Id must be 0 if object instance is a specimen
|
* Id must be 0 if object instance is a specimen
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->expression='';
|
$this->expression='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,40 +35,40 @@ class PriceGlobalVariable
|
|||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $errors = array();
|
public $errors = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
public $code;
|
public $code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string description
|
* @var string description
|
||||||
*/
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
public $value;
|
public $value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = "c_price_global_variable";
|
public $table_element = "c_price_global_variable";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|||||||
@@ -35,29 +35,29 @@ class PriceGlobalVariableUpdater
|
|||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $errors = array();
|
public $errors = array();
|
||||||
|
|
||||||
public $types=array(0, 1); //!< Updater types
|
public $types=array(0, 1); //!< Updater types
|
||||||
public $update_min = 5; //!< Minimal update rate
|
public $update_min = 5; //!< Minimal update rate
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
public $type;
|
public $type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string description
|
* @var string description
|
||||||
*/
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
public $parameters;
|
public $parameters;
|
||||||
|
|
||||||
@@ -71,16 +71,16 @@ class PriceGlobalVariableUpdater
|
|||||||
public $last_status;
|
public $last_status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = "c_price_global_variable_updater";
|
public $table_element = "c_price_global_variable_updater";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
@@ -332,11 +332,11 @@ class PriceGlobalVariableUpdater
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last updated time in string html format, returns "never" if its less than 1
|
* Returns the last updated time in string html format, returns "never" if its less than 1
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
@@ -450,11 +450,11 @@ class PriceGlobalVariableUpdater
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the processing of this updater
|
* Handles the processing of this updater
|
||||||
*
|
*
|
||||||
* @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;
|
||||||
|
|||||||
@@ -32,167 +32,167 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
|||||||
*/
|
*/
|
||||||
class PriceParser
|
class PriceParser
|
||||||
{
|
{
|
||||||
protected $db;
|
protected $db;
|
||||||
// Limit of expressions per price
|
// Limit of expressions per price
|
||||||
public $limit = 100;
|
public $limit = 100;
|
||||||
// The error that occurred when parsing price
|
// The error that occurred when parsing price
|
||||||
public $error_parser;
|
public $error_parser;
|
||||||
// The expression that caused the error
|
// The expression that caused the error
|
||||||
public $error_expr;
|
public $error_expr;
|
||||||
//The special char
|
//The special char
|
||||||
public $special_chr = "#";
|
public $special_chr = "#";
|
||||||
//The separator char
|
//The separator char
|
||||||
public $separator_chr = ";";
|
public $separator_chr = ";";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns translated error
|
* Returns translated error
|
||||||
*
|
*
|
||||||
* @return string Translated error
|
* @return string Translated error
|
||||||
*/
|
*/
|
||||||
public function translatedError()
|
public function translatedError()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
/*
|
/*
|
||||||
-No arg
|
-No arg
|
||||||
9, an unexpected error occured
|
9, an unexpected error occured
|
||||||
14, division by zero
|
14, division by zero
|
||||||
19, expression not found
|
19, expression not found
|
||||||
20, empty expression
|
20, empty expression
|
||||||
|
|
||||||
-1 Arg
|
-1 Arg
|
||||||
1, cannot assign to constant '%s'
|
1, cannot assign to constant '%s'
|
||||||
2, cannot redefine built-in function '%s'
|
2, cannot redefine built-in function '%s'
|
||||||
3, undefined variable '%s' in function definition
|
3, undefined variable '%s' in function definition
|
||||||
4, illegal character '%s'
|
4, illegal character '%s'
|
||||||
5, unexpected '%s'
|
5, unexpected '%s'
|
||||||
8, unexpected operator '%s'
|
8, unexpected operator '%s'
|
||||||
10, operator '%s' lacks operand
|
10, operator '%s' lacks operand
|
||||||
11, expecting '%s'
|
11, expecting '%s'
|
||||||
17, undefined variable '%s'
|
17, undefined variable '%s'
|
||||||
21, empty result '%s'
|
21, empty result '%s'
|
||||||
22, negative result '%s'
|
22, negative result '%s'
|
||||||
24, variable '%s' exists but has no value
|
24, variable '%s' exists but has no value
|
||||||
|
|
||||||
-2 Args
|
-2 Args
|
||||||
6, wrong number of arguments (%s given, %s expected)
|
6, wrong number of arguments (%s given, %s expected)
|
||||||
23, unknown or non set variable '%s' after %s
|
23, unknown or non set variable '%s' after %s
|
||||||
|
|
||||||
-internal errors
|
-internal errors
|
||||||
7, internal error
|
7, internal error
|
||||||
12, internal error
|
12, internal error
|
||||||
13, internal error
|
13, internal error
|
||||||
15, internal error
|
15, internal error
|
||||||
16, internal error
|
16, internal error
|
||||||
18, internal error
|
18, internal error
|
||||||
*/
|
*/
|
||||||
if (empty($this->error_parser)) {
|
if (empty($this->error_parser)) {
|
||||||
return $langs->trans("ErrorPriceExpressionUnknown", 0); //this is not supposed to happen
|
return $langs->trans("ErrorPriceExpressionUnknown", 0); //this is not supposed to happen
|
||||||
}
|
}
|
||||||
list($code, $info) = $this->error_parser;
|
list($code, $info) = $this->error_parser;
|
||||||
if (in_array($code, array(9, 14, 19, 20))) //Errors which have 0 arg
|
if (in_array($code, array(9, 14, 19, 20))) //Errors which have 0 arg
|
||||||
{
|
{
|
||||||
return $langs->trans("ErrorPriceExpression".$code);
|
return $langs->trans("ErrorPriceExpression".$code);
|
||||||
}
|
}
|
||||||
elseif (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg
|
elseif (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg
|
||||||
{
|
{
|
||||||
return $langs->trans("ErrorPriceExpression".$code, $info);
|
return $langs->trans("ErrorPriceExpression".$code, $info);
|
||||||
}
|
}
|
||||||
elseif (in_array($code, array(6, 23))) //Errors which have 2 args
|
elseif (in_array($code, array(6, 23))) //Errors which have 2 args
|
||||||
{
|
{
|
||||||
return $langs->trans("ErrorPriceExpression".$code, $info[0], $info[1]);
|
return $langs->trans("ErrorPriceExpression".$code, $info[0], $info[1]);
|
||||||
}
|
}
|
||||||
elseif (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors
|
elseif (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors
|
||||||
{
|
{
|
||||||
return $langs->trans("ErrorPriceExpressionInternal", $code);
|
return $langs->trans("ErrorPriceExpressionInternal", $code);
|
||||||
}
|
}
|
||||||
else //Unknown errors
|
else //Unknown errors
|
||||||
{
|
{
|
||||||
return $langs->trans("ErrorPriceExpressionUnknown", $code);
|
return $langs->trans("ErrorPriceExpressionUnknown", $code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates price based on expression
|
* Calculates price based on expression
|
||||||
*
|
*
|
||||||
* @param Product $product The Product object to get information
|
* @param Product $product The Product object to get information
|
||||||
* @param String $expression The expression to parse
|
* @param String $expression The expression to parse
|
||||||
* @param array $values Strings to replaces
|
* @param array $values Strings to replaces
|
||||||
* @return int > 0 if OK, < 1 if KO
|
* @return int > 0 if OK, < 1 if KO
|
||||||
*/
|
*/
|
||||||
public function parseExpression($product, $expression, $values)
|
public function parseExpression($product, $expression, $values)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
//Check if empty
|
//Check if empty
|
||||||
$expression = trim($expression);
|
$expression = trim($expression);
|
||||||
if (empty($expression))
|
if (empty($expression))
|
||||||
{
|
{
|
||||||
$this->error_parser = array(20, null);
|
$this->error_parser = array(20, null);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//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,
|
||||||
"weight" => $product->weight,
|
"weight" => $product->weight,
|
||||||
"length" => $product->length,
|
"length" => $product->length,
|
||||||
"surface" => $product->surface,
|
"surface" => $product->surface,
|
||||||
"price_min" => $product->price_min,
|
"price_min" => $product->price_min,
|
||||||
));
|
));
|
||||||
|
|
||||||
//Retrieve all extrafield for product and add it to values
|
//Retrieve all extrafield for product and add it to values
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
|
||||||
$product->fetch_optionals();
|
$product->fetch_optionals();
|
||||||
foreach ($extrafields->attributes[$product->table_element]['label'] as $key=>$label)
|
foreach ($extrafields->attributes[$product->table_element]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
$values["extrafield_".$key] = $product->array_options['options_'.$key];
|
$values["extrafield_".$key] = $product->array_options['options_'.$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Process any pending updaters
|
//Process any pending updaters
|
||||||
$price_updaters = new PriceGlobalVariableUpdater($this->db);
|
$price_updaters = new PriceGlobalVariableUpdater($this->db);
|
||||||
foreach ($price_updaters->listPendingUpdaters() as $entry) {
|
foreach ($price_updaters->listPendingUpdaters() as $entry) {
|
||||||
//Schedule the next update by adding current timestamp (secs) + interval (mins)
|
//Schedule the next update by adding current timestamp (secs) + interval (mins)
|
||||||
$entry->update_next_update(dol_now() + ($entry->update_interval * 60), $user);
|
$entry->update_next_update(dol_now() + ($entry->update_interval * 60), $user);
|
||||||
//Do processing
|
//Do processing
|
||||||
$res = $entry->process();
|
$res = $entry->process();
|
||||||
//Store any error or clear status if OK
|
//Store any error or clear status if OK
|
||||||
$entry->update_status($res < 1?$entry->error:'', $user);
|
$entry->update_status($res < 1?$entry->error:'', $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get all global values
|
//Get all global values
|
||||||
$price_globals = new PriceGlobalVariable($this->db);
|
$price_globals = new PriceGlobalVariable($this->db);
|
||||||
foreach ($price_globals->listGlobalVariables() as $entry)
|
foreach ($price_globals->listGlobalVariables() as $entry)
|
||||||
{
|
{
|
||||||
$values["global_".$entry->code] = $entry->value;
|
$values["global_".$entry->code] = $entry->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remove internal variables
|
//Remove internal variables
|
||||||
unset($values["supplier_id"]);
|
unset($values["supplier_id"]);
|
||||||
|
|
||||||
//Prepare the lib, parameters and values
|
//Prepare the lib, parameters and values
|
||||||
$em = new EvalMath();
|
$em = new EvalMath();
|
||||||
$em->suppress_errors = true; //Don't print errors on page
|
$em->suppress_errors = true; //Don't print errors on page
|
||||||
$this->error_expr = null;
|
$this->error_expr = null;
|
||||||
$last_result = null;
|
$last_result = null;
|
||||||
|
|
||||||
//Fill each variable in expression from values
|
//Fill each variable in expression from values
|
||||||
$expression = str_replace("\n", $this->separator_chr, $expression);
|
$expression = str_replace("\n", $this->separator_chr, $expression);
|
||||||
foreach ($values as $key => $value)
|
foreach ($values as $key => $value)
|
||||||
{
|
{
|
||||||
if ($value === null && strpos($expression, $key) !== false) {
|
if ($value === null && strpos($expression, $key) !== false) {
|
||||||
$this->error_parser = array(24, $key);
|
$this->error_parser = array(24, $key);
|
||||||
return -7;
|
return -7;
|
||||||
@@ -200,139 +200,139 @@ $values = array_merge($values, array(
|
|||||||
$expression = str_replace($this->special_chr.$key.$this->special_chr, strval($value), $expression);
|
$expression = str_replace($this->special_chr.$key.$this->special_chr, strval($value), $expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if there is unfilled variable
|
//Check if there is unfilled variable
|
||||||
if (strpos($expression, $this->special_chr) !== false)
|
if (strpos($expression, $this->special_chr) !== false)
|
||||||
{
|
{
|
||||||
$data = explode($this->special_chr, $expression);
|
$data = explode($this->special_chr, $expression);
|
||||||
$variable = $this->special_chr.$data[1];
|
$variable = $this->special_chr.$data[1];
|
||||||
if (isset($data[2])) $variable.= $this->special_chr;
|
if (isset($data[2])) $variable.= $this->special_chr;
|
||||||
$this->error_parser = array(23, array($variable, $expression));
|
$this->error_parser = array(23, array($variable, $expression));
|
||||||
return -6;
|
return -6;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Iterate over each expression splitted by $separator_chr
|
//Iterate over each expression splitted by $separator_chr
|
||||||
$expressions = explode($this->separator_chr, $expression);
|
$expressions = explode($this->separator_chr, $expression);
|
||||||
$expressions = array_slice($expressions, 0, $this->limit);
|
$expressions = array_slice($expressions, 0, $this->limit);
|
||||||
foreach ($expressions as $expr) {
|
foreach ($expressions as $expr) {
|
||||||
$expr = trim($expr);
|
$expr = trim($expr);
|
||||||
if (!empty($expr))
|
if (!empty($expr))
|
||||||
{
|
{
|
||||||
$last_result = $em->evaluate($expr);
|
$last_result = $em->evaluate($expr);
|
||||||
$this->error_parser = $em->last_error_code;
|
$this->error_parser = $em->last_error_code;
|
||||||
if ($this->error_parser !== null) { //$em->last_error_code is null if no error happened, so just check if error_parser is not null
|
if ($this->error_parser !== null) { //$em->last_error_code is null if no error happened, so just check if error_parser is not null
|
||||||
$this->error_expr = $expr;
|
$this->error_expr = $expr;
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$vars = $em->vars();
|
$vars = $em->vars();
|
||||||
if (empty($vars["price"])) {
|
if (empty($vars["price"])) {
|
||||||
$vars["price"] = $last_result;
|
$vars["price"] = $last_result;
|
||||||
}
|
}
|
||||||
if (!isset($vars["price"]))
|
if (!isset($vars["price"]))
|
||||||
{
|
{
|
||||||
$this->error_parser = array(21, $expression);
|
$this->error_parser = array(21, $expression);
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
if ($vars["price"] < 0)
|
if ($vars["price"] < 0)
|
||||||
{
|
{
|
||||||
$this->error_parser = array(22, $expression);
|
$this->error_parser = array(22, $expression);
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
return $vars["price"];
|
return $vars["price"];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates product price based on product id and associated expression
|
* Calculates product price based on product id and associated expression
|
||||||
*
|
*
|
||||||
* @param Product $product The Product object to get information
|
* @param Product $product The Product object to get information
|
||||||
* @param array $extra_values Any aditional values for expression
|
* @param array $extra_values Any aditional values for expression
|
||||||
* @return int > 0 if OK, < 1 if KO
|
* @return int > 0 if OK, < 1 if KO
|
||||||
*/
|
*/
|
||||||
public function parseProduct($product, $extra_values = array())
|
public function parseProduct($product, $extra_values = array())
|
||||||
{
|
{
|
||||||
//Get the expression from db
|
//Get the expression from db
|
||||||
$price_expression = new PriceExpression($this->db);
|
$price_expression = new PriceExpression($this->db);
|
||||||
$res = $price_expression->fetch($product->fk_price_expression);
|
$res = $price_expression->fetch($product->fk_price_expression);
|
||||||
if ($res < 1) {
|
if ($res < 1) {
|
||||||
$this->error_parser = array(19, null);
|
$this->error_parser = array(19, null);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the supplier min
|
//Get the supplier min
|
||||||
$productFournisseur = new ProductFournisseur($this->db);
|
$productFournisseur = new ProductFournisseur($this->db);
|
||||||
$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,
|
||||||
));
|
));
|
||||||
|
|
||||||
//Parse the expression and return the price, if not error occurred check if price is higher than min
|
//Parse the expression and return the price, if not error occurred check if price is higher than min
|
||||||
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
|
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
|
||||||
if (empty($this->error_parser)) {
|
if (empty($this->error_parser)) {
|
||||||
if ($result < $product->price_min) {
|
if ($result < $product->price_min) {
|
||||||
$result = $product->price_min;
|
$result = $product->price_min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates supplier product price based on product supplier price and associated expression
|
* Calculates supplier product price based on product supplier price and associated expression
|
||||||
*
|
*
|
||||||
* @param ProductFournisseur $product_supplier The Product supplier object to get information
|
* @param ProductFournisseur $product_supplier The Product supplier object to get information
|
||||||
* @param array $extra_values Any aditional values for expression
|
* @param array $extra_values Any aditional values for expression
|
||||||
* @return int > 0 if OK, < 1 if KO
|
* @return int > 0 if OK, < 1 if KO
|
||||||
*/
|
*/
|
||||||
public function parseProductSupplier($product_supplier, $extra_values = array())
|
public function parseProductSupplier($product_supplier, $extra_values = array())
|
||||||
{
|
{
|
||||||
//Get the expression from db
|
//Get the expression from db
|
||||||
$price_expression = new PriceExpression($this->db);
|
$price_expression = new PriceExpression($this->db);
|
||||||
$res = $price_expression->fetch($product_supplier->fk_supplier_price_expression);
|
$res = $price_expression->fetch($product_supplier->fk_supplier_price_expression);
|
||||||
if ($res < 1)
|
if ($res < 1)
|
||||||
{
|
{
|
||||||
$this->error_parser = array(19, null);
|
$this->error_parser = array(19, null);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the product data (use ignore_expression to avoid possible recursion)
|
//Get the product data (use ignore_expression to avoid possible recursion)
|
||||||
$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,
|
||||||
));
|
));
|
||||||
|
|
||||||
//Parse the expression and return the price
|
//Parse the expression and return the price
|
||||||
return $this->parseExpression($product_supplier, $price_expression->expression, $extra_values);
|
return $this->parseExpression($product_supplier, $price_expression->expression, $extra_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests string expression for validity
|
* Tests string expression for validity
|
||||||
*
|
*
|
||||||
* @param int $product_id The Product id to get information
|
* @param int $product_id The Product id to get information
|
||||||
* @param string $expression The expression to parse
|
* @param string $expression The expression to parse
|
||||||
* @param array $extra_values Any aditional values for expression
|
* @param array $extra_values Any aditional values for expression
|
||||||
* @return int > 0 if OK, < 1 if KO
|
* @return int > 0 if OK, < 1 if KO
|
||||||
*/
|
*/
|
||||||
public function testExpression($product_id, $expression, $extra_values = array())
|
public function testExpression($product_id, $expression, $extra_values = array())
|
||||||
{
|
{
|
||||||
//Get the product data
|
//Get the product data
|
||||||
$product = new Product($this->db);
|
$product = new Product($this->db);
|
||||||
$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,
|
||||||
));
|
));
|
||||||
return $this->parseExpression($product, $expression, $extra_values);
|
return $this->parseExpression($product, $expression, $extra_values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,40 +1136,40 @@ 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;
|
||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1179,9 +1179,9 @@ class Reception extends CommonObject
|
|||||||
* id must be 0 if object instance is a specimen.
|
* id must be 0 if object instance is a specimen.
|
||||||
*
|
*
|
||||||
* @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');
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
@@ -1232,8 +1232,8 @@ class Reception extends CommonObject
|
|||||||
$this->origin_id = 1;
|
$this->origin_id = 1;
|
||||||
$this->origin = 'commande';
|
$this->origin = 'commande';
|
||||||
|
|
||||||
$this->note_private = 'Private note';
|
$this->note_private = 'Private note';
|
||||||
$this->note_public = 'Public note';
|
$this->note_public = 'Public note';
|
||||||
|
|
||||||
$nbp = 5;
|
$nbp = 5;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
@@ -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,16 +1315,16 @@ 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;
|
||||||
|
|
||||||
$this->listmeths = array();
|
$this->listmeths = array();
|
||||||
@@ -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;
|
||||||
@@ -1908,13 +1906,13 @@ class Reception extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->statut=self::STATUS_DRAFT;
|
$this->statut=self::STATUS_DRAFT;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
|||||||
*/
|
*/
|
||||||
class ReceptionStats extends Stats
|
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;
|
||||||
|
|
||||||
@@ -121,11 +123,11 @@ class ReceptionStats extends Stats
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return nb, total and average
|
* Return nb, total and average
|
||||||
*
|
*
|
||||||
* @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,10 +53,10 @@ 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,8 +67,8 @@ 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;
|
||||||
|
|
||||||
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')))
|
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')))
|
||||||
@@ -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,14 +158,13 @@ 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>';
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addMoreActionsButtons
|
* addMoreActionsButtons
|
||||||
@@ -178,8 +174,8 @@ 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'){
|
||||||
// On verifie si la facture a des paiements
|
// On verifie si la facture a des paiements
|
||||||
@@ -234,5 +230,5 @@ class ActionsStripeconnect
|
|||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("StripeAutoSubscription")).'">'.$langs->trans("StripeAutoSubscription").'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("StripeAutoSubscription")).'">'.$langs->trans("StripeAutoSubscription").'</a>';
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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