move phpcs:ignore
This commit is contained in:
parent
4ea582ad4a
commit
04c1a7d4af
@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
*/
|
*/
|
||||||
public static $user = '';
|
public static $user = '';
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||||
/**
|
/**
|
||||||
* Check access
|
* Check access
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
|
||||||
public function __isAllowed()
|
public function __isAllowed()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $db;
|
global $conf, $db;
|
||||||
|
|
||||||
$login = '';
|
$login = '';
|
||||||
@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||||
/**
|
/**
|
||||||
* @return string string to be used with WWW-Authenticate header
|
* @return string string to be used with WWW-Authenticate header
|
||||||
* @example Basic
|
* @example Basic
|
||||||
* @example Digest
|
* @example Digest
|
||||||
* @example OAuth
|
* @example OAuth
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
|
||||||
public function __getWWWAuthenticateString()
|
public function __getWWWAuthenticateString()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -304,7 +304,7 @@ class Account extends CommonObject
|
|||||||
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
||||||
* @return int <0 if KO, id line if OK
|
* @return int <0 if KO, id line if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function add_url_line($line_id, $url_id, $url, $label, $type)
|
function add_url_line($line_id, $url_id, $url, $label, $type)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
|
||||||
@ -343,7 +343,7 @@ class Account extends CommonObject
|
|||||||
* @param string $type To search using type
|
* @param string $type To search using type
|
||||||
* @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
|
* @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function get_url($fk_bank='', $url_id='', $type='')
|
function get_url($fk_bank='', $url_id='', $type='')
|
||||||
{
|
{
|
||||||
$lines = array();
|
$lines = array();
|
||||||
@ -790,7 +790,7 @@ class Account extends CommonObject
|
|||||||
* @param User $user Object user making update
|
* @param User $user Object user making update
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function update_bban(User $user = null)
|
function update_bban(User $user = null)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@ -1078,7 +1078,7 @@ class Account 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function LibStatut($statut, $mode = 0)
|
function LibStatut($statut, $mode = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -1114,7 +1114,7 @@ class Account extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return boolean vrai si peut etre supprime, faux sinon
|
* @return boolean vrai si peut etre supprime, faux sinon
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function can_be_deleted()
|
function can_be_deleted()
|
||||||
{
|
{
|
||||||
$can_be_deleted=false;
|
$can_be_deleted=false;
|
||||||
@ -1184,7 +1184,7 @@ class Account extends CommonObject
|
|||||||
* @param int $filteraccountid To get info for a particular account id
|
* @param int $filteraccountid To get info for a particular account id
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function load_board(User $user, $filteraccountid = 0)
|
function load_board(User $user, $filteraccountid = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@ -1238,7 +1238,7 @@ class Account extends CommonObject
|
|||||||
* @param int $filteraccountid To get info for a particular account id
|
* @param int $filteraccountid To get info for a particular account id
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
function load_state_board($filteraccountid = 0)
|
function load_state_board($filteraccountid = 0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
@ -1884,15 +1884,16 @@ class AccountLine extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete bank line records
|
* Delete bank line records
|
||||||
*
|
*
|
||||||
* @param User $user User object that delete
|
* @param User $user User object that delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_urls(User $user = null)
|
function delete_urls(User $user = null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$nbko=0;
|
$nbko=0;
|
||||||
|
|
||||||
if ($this->rappro)
|
if ($this->rappro)
|
||||||
@ -1955,6 +1956,7 @@ class AccountLine extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update conciliation field
|
* Update conciliation field
|
||||||
*
|
*
|
||||||
@ -1962,9 +1964,9 @@ class AccountLine extends CommonObject
|
|||||||
* @param int $cat Category id
|
* @param int $cat Category id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_conciliation(User $user, $cat)
|
function update_conciliation(User $user, $cat)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -2018,6 +2020,7 @@ class AccountLine extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Increase/decrease value date of a rowid
|
* Increase/decrease value date of a rowid
|
||||||
*
|
*
|
||||||
@ -2025,9 +2028,9 @@ class AccountLine extends CommonObject
|
|||||||
* @param int $sign 1 or -1
|
* @param int $sign 1 or -1
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function datev_change($rowid,$sign=1)
|
function datev_change($rowid,$sign=1)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
$sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -2057,31 +2060,34 @@ class AccountLine extends CommonObject
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Increase value date of a rowid
|
* Increase value date of a rowid
|
||||||
*
|
*
|
||||||
* @param int $id Id of line to change
|
* @param int $id Id of line to change
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function datev_next($id)
|
function datev_next($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->datev_change($id,1);
|
return $this->datev_change($id,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Decrease value date of a rowid
|
* Decrease value date of a rowid
|
||||||
*
|
*
|
||||||
* @param int $id Id of line to change
|
* @param int $id Id of line to change
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function datev_previous($id)
|
function datev_previous($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->datev_change($id,-1);
|
return $this->datev_change($id,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Increase/decrease operation date of a rowid
|
* Increase/decrease operation date of a rowid
|
||||||
*
|
*
|
||||||
@ -2089,9 +2095,9 @@ class AccountLine extends CommonObject
|
|||||||
* @param int $sign 1 or -1
|
* @param int $sign 1 or -1
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function dateo_change($rowid,$sign=1)
|
function dateo_change($rowid,$sign=1)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -2121,27 +2127,29 @@ class AccountLine extends CommonObject
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Increase operation date of a rowid
|
* Increase operation date of a rowid
|
||||||
*
|
*
|
||||||
* @param int $id Id of line to change
|
* @param int $id Id of line to change
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function dateo_next($id)
|
function dateo_next($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->dateo_change($id,1);
|
return $this->dateo_change($id,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Decrease operation date of a rowid
|
* Decrease operation date of a rowid
|
||||||
*
|
*
|
||||||
* @param int $id Id of line to change
|
* @param int $id Id of line to change
|
||||||
* @return int >0 if OK, 0 if KO
|
* @return int >0 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function dateo_previous($id)
|
function dateo_previous($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->dateo_change($id,-1);
|
return $this->dateo_change($id,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2248,6 +2256,7 @@ class AccountLine extends CommonObject
|
|||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -2255,9 +2264,9 @@ class AccountLine 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load('companies');
|
//$langs->load('companies');
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -451,15 +451,16 @@ class PaymentVarious extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update link between payment various and line generate into llx_bank
|
* Update link between payment various and line generate into llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id_bank Id bank account
|
* @param int $id_bank Id bank account
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_fk_bank($id_bank)
|
function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank;
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -486,6 +487,7 @@ class PaymentVarious extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -493,38 +495,38 @@ class PaymentVarious 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $langs->trans($this->statuts[$statut]);
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
return $langs->trans($this->statuts_short[$statut]);
|
return $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
|
|||||||
@ -300,6 +300,7 @@ class Deplacement extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -307,38 +308,38 @@ class Deplacement 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
return $langs->trans($this->statuts[$statut]);
|
return $langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
return $langs->trans($this->statuts_short[$statut]);
|
return $langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
|
|||||||
@ -702,15 +702,16 @@ class Paiement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Mise a jour du lien entre le paiement et la ligne generee dans llx_bank
|
* Mise a jour du lien entre le paiement et la ligne generee dans llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id_bank Id compte bancaire
|
* @param int $id_bank Id compte bancaire
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_fk_bank($id_bank)
|
function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
@ -728,15 +729,16 @@ class Paiement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Updates the payment date
|
* Updates the payment date
|
||||||
*
|
*
|
||||||
* @param int $date New date
|
* @param int $date New date
|
||||||
* @return int <0 if KO, 0 if OK
|
* @return int <0 if KO, 0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_date($date)
|
function update_date($date)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (!empty($date) && $this->statut!=1)
|
if (!empty($date) && $this->statut!=1)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@ -760,15 +762,16 @@ class Paiement extends CommonObject
|
|||||||
return -1; //no date given or already validated
|
return -1; //no date given or already validated
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Updates the payment number
|
* Updates the payment number
|
||||||
*
|
*
|
||||||
* @param string $num New num
|
* @param string $num New num
|
||||||
* @return int <0 if KO, 0 if OK
|
* @return int <0 if KO, 0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_num($num)
|
function update_num($num)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if(!empty($num) && $this->statut!=1)
|
if(!empty($num) && $this->statut!=1)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
@ -1123,6 +1126,7 @@ class Paiement extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -1130,9 +1134,9 @@ class Paiement 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($status,$mode=0)
|
function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// 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
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
@ -1174,15 +1178,16 @@ class Paiement extends CommonObject
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load the third party of object, from id into this->thirdparty
|
* Load the third party of object, from id into this->thirdparty
|
||||||
*
|
*
|
||||||
* @param int $force_thirdparty_id Force thirdparty id
|
* @param int $force_thirdparty_id Force thirdparty id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_thirdparty($force_thirdparty_id=0)
|
function fetch_thirdparty($force_thirdparty_id=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
if (empty($force_thirdparty_id))
|
if (empty($force_thirdparty_id))
|
||||||
|
|||||||
@ -109,6 +109,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$this->_fetched = 0;
|
$this->_fetched = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add invoice to withdrawal
|
* Add invoice to withdrawal
|
||||||
*
|
*
|
||||||
@ -122,9 +123,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
$line_id = 0;
|
$line_id = 0;
|
||||||
|
|
||||||
@ -328,14 +329,15 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_credite()
|
function set_credite()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user,$conf;
|
global $user,$conf;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -406,6 +408,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set direct debit order to "credited" status.
|
* Set direct debit order to "credited" status.
|
||||||
*
|
*
|
||||||
@ -413,9 +416,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_infocredit($user, $date)
|
function set_infocredit($user, $date)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -553,6 +556,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set withdrawal to transmited status
|
* Set withdrawal to transmited status
|
||||||
*
|
*
|
||||||
@ -561,9 +565,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_infotrans($user, $date, $method)
|
function set_infotrans($user, $date, $method)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -678,14 +682,15 @@ class BonPrelevement extends CommonObject
|
|||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns amount of withdrawal
|
* Returns amount of withdrawal
|
||||||
*
|
*
|
||||||
* @return double Total amount
|
* @return double Total amount
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function SommeAPrelever()
|
function SommeAPrelever()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT sum(pfd.amount) as nb";
|
$sql = "SELECT sum(pfd.amount) as nb";
|
||||||
@ -716,6 +721,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@ -724,9 +730,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function NbFactureAPrelever($banque=0,$agence=0)
|
function NbFactureAPrelever($banque=0,$agence=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT count(f.rowid) as nb";
|
$sql = "SELECT count(f.rowid) as nb";
|
||||||
@ -758,6 +764,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Create a withdraw
|
* Create a withdraw
|
||||||
* TODO delete params banque and agence when not necesary
|
* TODO delete params banque and agence when not necesary
|
||||||
@ -769,9 +776,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function Create($banque=0, $agence=0, $mode='real', $format='ALL',$executiondate='')
|
function Create($banque=0, $agence=0, $mode='real', $format='ALL',$executiondate='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
|
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
|
||||||
@ -1194,15 +1201,16 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function DeleteNotificationById($rowid)
|
function DeleteNotificationById($rowid)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||||
@ -1218,6 +1226,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete a notification
|
* Delete a notification
|
||||||
*
|
*
|
||||||
@ -1225,9 +1234,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function DeleteNotification($user, $action)
|
function DeleteNotification($user, $action)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||||
@ -1243,6 +1252,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add a notification
|
* Add a notification
|
||||||
*
|
*
|
||||||
@ -1251,9 +1261,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function AddNotification($db, $user, $action)
|
function AddNotification($db, $user, $action)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
if ($this->DeleteNotification($user, $action) == 0)
|
if ($this->DeleteNotification($user, $action) == 0)
|
||||||
@ -1469,6 +1479,7 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write recipient of request (customer)
|
* Write recipient of request (customer)
|
||||||
*
|
*
|
||||||
@ -1483,9 +1494,9 @@ class BonPrelevement extends CommonObject
|
|||||||
* @param string $rib_dom rib domiciliation
|
* @param string $rib_dom rib domiciliation
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='')
|
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
fputs($this->file, "06");
|
fputs($this->file, "06");
|
||||||
fputs($this->file, "08"); // Prelevement ordinaire
|
fputs($this->file, "08"); // Prelevement ordinaire
|
||||||
|
|
||||||
@ -1556,6 +1567,7 @@ class BonPrelevement extends CommonObject
|
|||||||
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
|
||||||
/**
|
/**
|
||||||
* Write recipient of request (customer)
|
* Write recipient of request (customer)
|
||||||
*
|
*
|
||||||
@ -1577,9 +1589,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
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_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
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_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$CrLf = "\n";
|
$CrLf = "\n";
|
||||||
$Rowing = sprintf("%06d", $row_idfac);
|
$Rowing = sprintf("%06d", $row_idfac);
|
||||||
|
|
||||||
@ -1634,14 +1646,15 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write sender of request (me)
|
* Write sender of request (me)
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function EnregEmetteur()
|
function EnregEmetteur()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
fputs($this->file, "03");
|
fputs($this->file, "03");
|
||||||
fputs($this->file, "08"); // Prelevement ordinaire
|
fputs($this->file, "08"); // Prelevement ordinaire
|
||||||
|
|
||||||
@ -1700,6 +1713,7 @@ class BonPrelevement extends CommonObject
|
|||||||
fputs($this->file, "\n");
|
fputs($this->file, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@ -1712,9 +1726,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST')
|
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// SEPA INITIALISATION
|
// SEPA INITIALISATION
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1822,15 +1836,16 @@ class BonPrelevement extends CommonObject
|
|||||||
return $XML_SEPA_INFO;
|
return $XML_SEPA_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write end
|
* Write end
|
||||||
*
|
*
|
||||||
* @param int $total total amount
|
* @param int $total total amount
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function EnregTotal($total)
|
function EnregTotal($total)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
fputs($this->file, "08");
|
fputs($this->file, "08");
|
||||||
fputs($this->file, "08"); // Prelevement ordinaire
|
fputs($this->file, "08"); // Prelevement ordinaire
|
||||||
|
|
||||||
@ -1895,6 +1910,7 @@ class BonPrelevement extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return status label for a status
|
* Return status label for a status
|
||||||
*
|
*
|
||||||
@ -1902,9 +1918,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (empty($this->labelstatut))
|
if (empty($this->labelstatut))
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -1914,39 +1930,35 @@ class BonPrelevement extends CommonObject
|
|||||||
$this->labelstatut[2]=$langs->trans("StatusCredited");
|
$this->labelstatut[2]=$langs->trans("StatusCredited");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
{
|
||||||
return $this->labelstatut[$statut];
|
return $this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 2)
|
||||||
{
|
|
||||||
return $this->labelstatut[$statut];
|
|
||||||
}
|
|
||||||
if ($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];
|
if ($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];
|
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
if ($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');
|
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3');
|
||||||
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6');
|
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
if ($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];
|
if ($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];
|
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
if ($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');
|
if ($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');
|
if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
if ($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');
|
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3');
|
||||||
|
|||||||
@ -486,15 +486,16 @@ class PaymentSalary extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update link between payment salary and line generate into llx_bank
|
* Update link between payment salary and line generate into llx_bank
|
||||||
*
|
*
|
||||||
* @param int $id_bank Id bank account
|
* @param int $id_bank Id bank account
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_fk_bank($id_bank)
|
function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -584,6 +585,7 @@ class PaymentSalary extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -591,9 +593,9 @@ class PaymentSalary extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($status,$mode=0)
|
function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// 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
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
|
|||||||
@ -461,6 +461,7 @@ class Cchargesociales
|
|||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un status donne
|
* Renvoi le libelle d'un status donne
|
||||||
*
|
*
|
||||||
@ -468,9 +469,9 @@ class Cchargesociales
|
|||||||
* @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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($status,$mode=0)
|
function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
|
|||||||
@ -367,15 +367,16 @@ class ChargeSociales extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag social contribution as payed completely
|
* Tag social contribution 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_paid($user)
|
function set_paid($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
||||||
$sql.= " paye = 1";
|
$sql.= " paye = 1";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
@ -383,15 +384,17 @@ class ChargeSociales extends CommonObject
|
|||||||
if ($return) return 1;
|
if ($return) return 1;
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Remove tag payed on social contribution
|
* Remove tag payed on social contribution
|
||||||
*
|
*
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_unpaid($user)
|
function set_unpaid($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
|
||||||
$sql.= " paye = 0";
|
$sql.= " paye = 0";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
@ -412,6 +415,7 @@ class ChargeSociales extends CommonObject
|
|||||||
return $this->LibStatut($this->paye,$mode,$alreadypaid);
|
return $this->LibStatut($this->paye,$mode,$alreadypaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -420,55 +424,50 @@ class ChargeSociales extends CommonObject
|
|||||||
* @param double $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 double $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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0,$alreadypaid=-1)
|
function LibStatut($statut,$mode=0,$alreadypaid=-1)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load('customers');
|
$langs->load('customers');
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return $langs->trans("Unpaid");
|
if ($statut == 0) return $langs->trans("Unpaid");
|
||||||
if ($statut == 1) return $langs->trans("Paid");
|
if ($statut == 1) return $langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 2)
|
||||||
{
|
|
||||||
if ($statut == 0) return $langs->trans("Unpaid");
|
|
||||||
if ($statut == 1) return $langs->trans("Paid");
|
|
||||||
}
|
|
||||||
if ($mode == 2)
|
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Error, mode/status not found";
|
else return "Error, mode/status not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -600,15 +600,16 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee
|
* Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee
|
||||||
*
|
*
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_fk_bank($id_bank)
|
function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
|
||||||
@ -636,6 +637,7 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$mode);
|
return $this->LibStatut($this->statut,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -643,9 +645,9 @@ class PaymentSocialContribution 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($status,$mode=0)
|
function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// 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
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
|
|||||||
@ -192,15 +192,16 @@ class CSMSFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write content of a SendSms request into a dump file (mode = all)
|
* Write content of a SendSms request into a dump file (mode = all)
|
||||||
* Used for debugging.
|
* Used for debugging.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function dump_sms()
|
function dump_sms()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$dolibarr_main_data_root;
|
global $conf,$dolibarr_main_data_root;
|
||||||
|
|
||||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||||
@ -222,6 +223,7 @@ class CSMSFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Write content of a SendSms result into a dump file (mode = all)
|
* Write content of a SendSms result into a dump file (mode = all)
|
||||||
* Used for debugging.
|
* Used for debugging.
|
||||||
@ -229,9 +231,9 @@ class CSMSFile
|
|||||||
* @param int $result Result of sms sending
|
* @param int $result Result of sms sending
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function dump_sms_result($result)
|
function dump_sms_result($result)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$dolibarr_main_data_root;
|
global $conf,$dolibarr_main_data_root;
|
||||||
|
|
||||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
||||||
|
|||||||
@ -713,6 +713,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add a link between element $this->element and a contact
|
* Add a link between element $this->element and a contact
|
||||||
*
|
*
|
||||||
@ -722,9 +723,9 @@ abstract class CommonObject
|
|||||||
* @param int $notrigger Disable all triggers
|
* @param int $notrigger Disable all triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user,$langs;
|
global $user,$langs;
|
||||||
|
|
||||||
|
|
||||||
@ -836,6 +837,7 @@ abstract class CommonObject
|
|||||||
} else return 0;
|
} else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Copy contact from one element to current
|
* Copy contact from one element to current
|
||||||
*
|
*
|
||||||
@ -843,9 +845,9 @@ abstract class CommonObject
|
|||||||
* @param string $source Nature of contact ('internal' or 'external')
|
* @param string $source Nature of contact ('internal' or 'external')
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function copy_linked_contact($objFrom, $source='internal')
|
function copy_linked_contact($objFrom, $source='internal')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$contacts = $objFrom->liste_contact(-1, $source);
|
$contacts = $objFrom->liste_contact(-1, $source);
|
||||||
foreach($contacts as $contact)
|
foreach($contacts as $contact)
|
||||||
{
|
{
|
||||||
@ -858,6 +860,7 @@ abstract class CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update a link to contact line
|
* Update a link to contact line
|
||||||
*
|
*
|
||||||
@ -867,9 +870,9 @@ abstract class CommonObject
|
|||||||
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
|
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
|
||||||
* @return int <0 if KO, >= 0 if OK
|
* @return int <0 if KO, >= 0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
|
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Insert into database
|
// Insert into database
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
|
||||||
$sql.= " statut = ".$statut;
|
$sql.= " statut = ".$statut;
|
||||||
@ -888,6 +891,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete a link to contact line
|
* Delete a link to contact line
|
||||||
*
|
*
|
||||||
@ -895,9 +899,9 @@ abstract class 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_contact($rowid, $notrigger=0)
|
function delete_contact($rowid, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|
||||||
@ -926,6 +930,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete all links between an object $this and all its contacts
|
* Delete all links between an object $this and all its contacts
|
||||||
*
|
*
|
||||||
@ -933,9 +938,9 @@ abstract class CommonObject
|
|||||||
* @param string $code Type of contact (code or id)
|
* @param string $code Type of contact (code or id)
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_linked_contact($source='',$code='')
|
function delete_linked_contact($source='',$code='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$temp = array();
|
$temp = array();
|
||||||
$typeContact = $this->liste_type_contact($source,'',0,0,$code);
|
$typeContact = $this->liste_type_contact($source,'',0,0,$code);
|
||||||
|
|
||||||
@ -962,6 +967,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get array of all contacts for an object
|
* Get array of all contacts for an object
|
||||||
*
|
*
|
||||||
@ -971,9 +977,9 @@ abstract class CommonObject
|
|||||||
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
||||||
* @return array Array of contacts
|
* @return array Array of contacts
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function liste_contact($statut=-1,$source='external',$list=0,$code='')
|
function liste_contact($statut=-1,$source='external',$list=0,$code='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$tab=array();
|
$tab=array();
|
||||||
@ -1070,6 +1076,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return array with list of possible values for type of contacts
|
* Return array with list of possible values for type of contacts
|
||||||
*
|
*
|
||||||
@ -1080,9 +1087,9 @@ abstract class CommonObject
|
|||||||
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
|
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
|
||||||
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
|
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='')
|
function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (empty($order)) $order='position';
|
if (empty($order)) $order='position';
|
||||||
@ -1184,15 +1191,16 @@ abstract class CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load object contact with id=$this->contactid into $this->contact
|
* Load object contact with id=$this->contactid into $this->contact
|
||||||
*
|
*
|
||||||
* @param int $contactid Id du contact. Use this->contactid if empty.
|
* @param int $contactid Id du contact. Use this->contactid if empty.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_contact($contactid=null)
|
function fetch_contact($contactid=null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (empty($contactid)) $contactid=$this->contactid;
|
if (empty($contactid)) $contactid=$this->contactid;
|
||||||
|
|
||||||
if (empty($contactid)) return 0;
|
if (empty($contactid)) return 0;
|
||||||
@ -1204,15 +1212,16 @@ abstract class CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
||||||
*
|
*
|
||||||
* @param int $force_thirdparty_id Force thirdparty id
|
* @param int $force_thirdparty_id Force thirdparty id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_thirdparty($force_thirdparty_id=0)
|
function fetch_thirdparty($force_thirdparty_id=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id))
|
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id))
|
||||||
@ -1266,6 +1275,7 @@ abstract class CommonObject
|
|||||||
return $this->fetch($result->rowid);
|
return $this->fetch($result->rowid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load data for barcode into properties ->barcode_type*
|
* Load data for barcode into properties ->barcode_type*
|
||||||
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
|
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
|
||||||
@ -1273,9 +1283,9 @@ abstract class CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
|
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_barcode()
|
function fetch_barcode()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
|
dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
|
||||||
@ -1316,14 +1326,15 @@ abstract class CommonObject
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load the project with id $this->fk_project into this->project
|
* Load the project with id $this->fk_project into this->project
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_projet()
|
function fetch_projet()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility
|
if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility
|
||||||
@ -1337,14 +1348,15 @@ abstract class CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load the product with id $this->fk_product into this->product
|
* Load the product with id $this->fk_product into this->product
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_product()
|
function fetch_product()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
if (empty($this->fk_product)) return 0;
|
if (empty($this->fk_product)) return 0;
|
||||||
@ -1356,29 +1368,31 @@ abstract class CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load the user with id $userid into this->user
|
* Load the user with id $userid into this->user
|
||||||
*
|
*
|
||||||
* @param int $userid Id du contact
|
* @param int $userid Id du contact
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_user($userid)
|
function fetch_user($userid)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$user = new User($this->db);
|
$user = new User($this->db);
|
||||||
$result=$user->fetch($userid);
|
$result=$user->fetch($userid);
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Read linked origin object
|
* Read linked origin object
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_origin()
|
function fetch_origin()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if ($this->origin == 'shipping') $this->origin = 'expedition';
|
if ($this->origin == 'shipping') $this->origin = 'expedition';
|
||||||
if ($this->origin == 'delivery') $this->origin = 'livraison';
|
if ($this->origin == 'delivery') $this->origin = 'livraison';
|
||||||
|
|
||||||
@ -1538,6 +1552,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load properties id_previous and id_next by comparing $fieldid with $this->ref
|
* Load properties id_previous and id_next by comparing $fieldid with $this->ref
|
||||||
*
|
*
|
||||||
@ -1546,9 +1561,9 @@ abstract class CommonObject
|
|||||||
* @param int $nodbprefix Do not include DB prefix to forge table name
|
* @param int $nodbprefix Do not include DB prefix to forge table name
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function load_previous_next_ref($filter, $fieldid, $nodbprefix=0)
|
function load_previous_next_ref($filter, $fieldid, $nodbprefix=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
if (! $this->table_element)
|
if (! $this->table_element)
|
||||||
@ -2173,6 +2188,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
// TODO: Move line related operations to CommonObjectLine?
|
// TODO: Move line related operations to CommonObjectLine?
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Save a new position (field rang) for details lines.
|
* Save a new position (field rang) for details lines.
|
||||||
* You can choose to set position for lines with already a position or lines without any position defined.
|
* You can choose to set position for lines with already a position or lines without any position defined.
|
||||||
@ -2182,9 +2198,9 @@ abstract class CommonObject
|
|||||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true)
|
function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (! $this->table_element_line)
|
if (! $this->table_element_line)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR);
|
dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR);
|
||||||
@ -2293,6 +2309,7 @@ abstract class CommonObject
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update a line to have a lower rank
|
* Update a line to have a lower rank
|
||||||
*
|
*
|
||||||
@ -2300,9 +2317,9 @@ abstract class CommonObject
|
|||||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function line_up($rowid, $fk_parent_line=true)
|
function line_up($rowid, $fk_parent_line=true)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$this->line_order(false, 'ASC', $fk_parent_line);
|
$this->line_order(false, 'ASC', $fk_parent_line);
|
||||||
|
|
||||||
// Get rang of line
|
// Get rang of line
|
||||||
@ -2312,6 +2329,7 @@ abstract class CommonObject
|
|||||||
$this->updateLineUp($rowid, $rang);
|
$this->updateLineUp($rowid, $rang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update a line to have a higher rank
|
* Update a line to have a higher rank
|
||||||
*
|
*
|
||||||
@ -2319,9 +2337,9 @@ abstract class CommonObject
|
|||||||
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
* @param boolean $fk_parent_line Table with fk_parent_line field or not
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function line_down($rowid, $fk_parent_line=true)
|
function line_down($rowid, $fk_parent_line=true)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$this->line_order(false, 'ASC', $fk_parent_line);
|
$this->line_order(false, 'ASC', $fk_parent_line);
|
||||||
|
|
||||||
// Get rang of line
|
// Get rang of line
|
||||||
@ -2356,15 +2374,16 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update position of line with ajax (rang)
|
* Update position of line with ajax (rang)
|
||||||
*
|
*
|
||||||
* @param array $rows Array of rows
|
* @param array $rows Array of rows
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function line_ajaxorder($rows)
|
function line_ajaxorder($rows)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$num = count($rows);
|
$num = count($rows);
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
for ($i = 0 ; $i < $num ; $i++)
|
||||||
{
|
{
|
||||||
@ -2472,15 +2491,16 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get max value used for position of line (rang)
|
* Get max value used for position of line (rang)
|
||||||
*
|
*
|
||||||
* @param int $fk_parent_line Parent line id
|
* @param int $fk_parent_line Parent line id
|
||||||
* @return int Max value of rang in table of lines
|
* @return int Max value of rang in table of lines
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function line_max($fk_parent_line=0)
|
function line_max($fk_parent_line=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Search the last rang with fk_parent_line
|
// Search the last rang with fk_parent_line
|
||||||
if ($fk_parent_line)
|
if ($fk_parent_line)
|
||||||
{
|
{
|
||||||
@ -2519,15 +2539,16 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update external ref of element
|
* Update external ref of element
|
||||||
*
|
*
|
||||||
* @param string $ref_ext Update field ref_ext
|
* @param string $ref_ext Update field ref_ext
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_ref_ext($ref_ext)
|
function update_ref_ext($ref_ext)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (! $this->table_element)
|
if (! $this->table_element)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR);
|
dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR);
|
||||||
@ -2551,6 +2572,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update note of element
|
* Update note of element
|
||||||
*
|
*
|
||||||
@ -2558,9 +2580,9 @@ abstract class CommonObject
|
|||||||
* @param string $suffix '', '_public' or '_private'
|
* @param string $suffix '', '_public' or '_private'
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_note($note, $suffix='')
|
function update_note($note, $suffix='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if (! $this->table_element)
|
if (! $this->table_element)
|
||||||
@ -2603,6 +2625,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update public note (kept for backward compatibility)
|
* Update public note (kept for backward compatibility)
|
||||||
*
|
*
|
||||||
@ -2611,12 +2634,13 @@ abstract class CommonObject
|
|||||||
* @deprecated
|
* @deprecated
|
||||||
* @see update_note()
|
* @see update_note()
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_note_public($note)
|
function update_note_public($note)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->update_note($note,'_public');
|
return $this->update_note($note,'_public');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines).
|
* Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines).
|
||||||
* Must be called at end of methods addline or updateline.
|
* Must be called at end of methods addline or updateline.
|
||||||
@ -2627,9 +2651,9 @@ abstract class CommonObject
|
|||||||
* @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object.
|
* @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null)
|
function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $hookmanager, $action;
|
global $conf, $hookmanager, $action;
|
||||||
|
|
||||||
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
|
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
|
||||||
@ -2856,6 +2880,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add objects linked in llx_element_element.
|
* Add objects linked in llx_element_element.
|
||||||
*
|
*
|
||||||
@ -2864,9 +2889,9 @@ abstract class CommonObject
|
|||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
* @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked
|
* @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_object_linked($origin=null, $origin_id=null)
|
function add_object_linked($origin=null, $origin_id=null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$origin = (! empty($origin) ? $origin : $this->origin);
|
$origin = (! empty($origin) ? $origin : $this->origin);
|
||||||
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
|
||||||
|
|
||||||
@ -3617,15 +3642,16 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return incoterms informations
|
* Return incoterms informations
|
||||||
* TODO Use a cache for label get
|
* TODO Use a cache for label get
|
||||||
*
|
*
|
||||||
* @return string incoterms info
|
* @return string incoterms info
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function display_incoterms()
|
function display_incoterms()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$out = '';
|
$out = '';
|
||||||
$this->libelle_incoterms = '';
|
$this->libelle_incoterms = '';
|
||||||
if (!empty($this->fk_incoterms))
|
if (!empty($this->fk_incoterms))
|
||||||
@ -4225,6 +4251,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add resources to the current object : add entry into llx_element_resources
|
* Add resources to the current object : add entry into llx_element_resources
|
||||||
* Need $this->element & $this->id
|
* Need $this->element & $this->id
|
||||||
@ -4235,9 +4262,9 @@ abstract class CommonObject
|
|||||||
* @param int $mandatory Mandatory or not
|
* @param int $mandatory Mandatory or not
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0)
|
function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources (";
|
||||||
@ -4270,6 +4297,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete a link to resource line
|
* Delete a link to resource line
|
||||||
*
|
*
|
||||||
@ -4278,9 +4306,9 @@ abstract class 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_resource($rowid, $element, $notrigger=0)
|
function delete_resource($rowid, $element, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -4653,6 +4681,7 @@ abstract class CommonObject
|
|||||||
/* For triggers */
|
/* For triggers */
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Call trigger based on this instance.
|
* Call trigger based on this instance.
|
||||||
* Some context information may also be provided into array property this->context.
|
* Some context information may also be provided into array property this->context.
|
||||||
@ -4663,9 +4692,9 @@ abstract class CommonObject
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @return int Result of run_triggers
|
* @return int Result of run_triggers
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function call_trigger($trigger_name, $user)
|
function call_trigger($trigger_name, $user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
@ -4690,6 +4719,7 @@ abstract class CommonObject
|
|||||||
/* Functions for extrafields */
|
/* Functions for extrafields */
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to get extra fields of an object into $this->array_options
|
* Function to get extra fields of an object into $this->array_options
|
||||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||||
@ -4698,9 +4728,9 @@ abstract class CommonObject
|
|||||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
||||||
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_optionals($rowid=null, $optionsArray=null)
|
function fetch_optionals($rowid=null, $optionsArray=null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (empty($rowid)) $rowid=$this->id;
|
if (empty($rowid)) $rowid=$this->id;
|
||||||
|
|
||||||
// To avoid SQL errors. Probably not the better solution though
|
// To avoid SQL errors. Probably not the better solution though
|
||||||
@ -6462,6 +6492,7 @@ abstract class CommonObject
|
|||||||
return $buyPrice;
|
return $buyPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show photos of an object (nbmax maximum), into several columns
|
* Show photos of an object (nbmax maximum), into several columns
|
||||||
*
|
*
|
||||||
@ -6479,9 +6510,9 @@ abstract class CommonObject
|
|||||||
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
|
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
|
||||||
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
|
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0)
|
function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||||
|
|||||||
@ -333,15 +333,16 @@ class Loan extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function set_paid($user)
|
function set_paid($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
|
||||||
$sql.= " paid = 1";
|
$sql.= " paid = 1";
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
@ -366,6 +367,7 @@ class Loan extends CommonObject
|
|||||||
return $this->LibStatut($this->paid,$mode,$alreadypaid);
|
return $this->LibStatut($this->paid,$mode,$alreadypaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label for given status
|
* Return label for given status
|
||||||
*
|
*
|
||||||
@ -374,54 +376,49 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0,$alreadypaid=-1)
|
function LibStatut($statut,$mode=0,$alreadypaid=-1)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->loadLangs(array("customers","bills"));
|
$langs->loadLangs(array("customers","bills"));
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return $langs->trans("Unpaid");
|
if ($statut == 0) return $langs->trans("Unpaid");
|
||||||
if ($statut == 1) return $langs->trans("Paid");
|
if ($statut == 1) return $langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 2)
|
||||||
{
|
|
||||||
if ($statut == 0) return $langs->trans("Unpaid");
|
|
||||||
if ($statut == 1) return $langs->trans("Paid");
|
|
||||||
}
|
|
||||||
if ($mode == 2)
|
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Error, mode/status not found";
|
else return "Error, mode/status not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -478,15 +478,16 @@ class PaymentLoan extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_fk_bank($id_bank)
|
function update_fk_bank($id_bank)
|
||||||
{
|
{
|
||||||
|
// 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;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
|
||||||
|
|||||||
@ -223,6 +223,7 @@ class Propalmergepdfproduct extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
@ -230,9 +231,9 @@ class Propalmergepdfproduct extends CommonObject
|
|||||||
* @param string $lang Lang string code
|
* @param string $lang Lang string code
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_by_product($product_id, $lang='')
|
function fetch_by_product($product_id, $lang='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
@ -436,6 +437,7 @@ class Propalmergepdfproduct extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete object in database
|
* Delete object in database
|
||||||
*
|
*
|
||||||
@ -445,9 +447,9 @@ class Propalmergepdfproduct 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_by_product($user, $product_id, $lang_id='', $notrigger=0)
|
function delete_by_product($user, $product_id, $lang_id='', $notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -501,15 +503,16 @@ class Propalmergepdfproduct extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete object in database
|
* Delete object in database
|
||||||
*
|
*
|
||||||
* @param User $user User that deletes
|
* @param User $user User that deletes
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_by_file($user)
|
function delete_by_file($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@ -176,14 +176,15 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* List all price expressions
|
* List all price expressions
|
||||||
*
|
*
|
||||||
* @return array Array of price expressions
|
* @return array Array of price expressions
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function list_price_expression()
|
function list_price_expression()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid, title, expression";
|
$sql = "SELECT rowid, title, expression";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " ORDER BY title";
|
$sql.= " ORDER BY title";
|
||||||
@ -214,15 +215,16 @@ class PriceExpression
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function find_title($title)
|
function find_title($title)
|
||||||
{
|
{
|
||||||
|
// 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)."'";
|
||||||
|
|||||||
@ -551,6 +551,7 @@ class PriceGlobalVariableUpdater
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update next_update into database
|
* Update next_update into database
|
||||||
*
|
*
|
||||||
@ -559,9 +560,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_next_update($next_update, $user=0, $notrigger=0)
|
function update_next_update($next_update, $user=0, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->next_update = $next_update;
|
$this->next_update = $next_update;
|
||||||
@ -596,6 +597,7 @@ class PriceGlobalVariableUpdater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update last_status into database
|
* Update last_status into database
|
||||||
*
|
*
|
||||||
@ -604,9 +606,9 @@ 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
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_status($last_status, $user=0, $notrigger=0)
|
function update_status($last_status, $user=0, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->last_status = $last_status;
|
$this->last_status = $last_status;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user