diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 6c5b6c020c7..35834419a74 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -162,7 +162,6 @@ class Commande extends CommonOrder
}
$obj = new $classname();
- $numref = "";
$numref = $obj->getNextValue($soc,$this);
if ($numref != "")
@@ -1079,19 +1078,19 @@ class Commande extends CommonOrder
* Add an order line into database (linked to product/service or not)
*
* @param string $desc Description of line
- * @param double $pu_ht Unit price (without tax)
- * @param double $qty Quantite
- * @param double $txtva Taux de tva force, sinon -1
- * @param double $txlocaltax1 Local tax 1 rate
- * @param double $txlocaltax2 Local tax 2 rate
+ * @param float $pu_ht Unit price (without tax)
+ * @param float $qty Quantite
+ * @param float $txtva Taux de tva force, sinon -1
+ * @param float $txlocaltax1 Local tax 1 rate
+ * @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id du produit/service predefini
- * @param double $remise_percent Pourcentage de remise de la ligne
+ * @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes
* @param int $fk_remise_except Id remise
* @param string $price_base_type HT or TTC
- * @param double $pu_ttc Prix unitaire TTC
- * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
- * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * @param float $pu_ttc Prix unitaire TTC
+ * @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $type Type of line (0=product, 1=service)
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
@@ -1285,16 +1284,16 @@ class Commande extends CommonOrder
* $this->client must be loaded
*
* @param int $idproduct Product Id
- * @param double $qty Quantity
- * @param double $remise_percent Product discount relative
- * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
- * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * @param float $qty Quantity
+ * @param float $remise_percent Product discount relative
+ * @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @return void
*
* TODO Remplacer les appels a cette fonction par generation objet Ligne
* insere dans tableau $this->products
*/
- function add_product($idproduct, $qty, $remise_percent=0, $date_start='', $date_end='')
+ function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='')
{
global $conf, $mysoc;
@@ -1692,7 +1691,6 @@ class Commande extends CommonOrder
*/
function loadExpeditions($filtre_statut=-1)
{
- $num=0;
$this->expeditions = array();
$sql = 'SELECT cd.rowid, cd.fk_product,';
@@ -1961,7 +1959,7 @@ class Commande extends CommonOrder
* Set the order date
*
* @param User $user Object user making change
- * @param timestamp $date Date
+ * @param int $date Date
* @return int <0 if KO, >0 if OK
*/
function set_date($user, $date)
@@ -1995,7 +1993,7 @@ class Commande extends CommonOrder
* Set the planned delivery date
*
* @param User $user Objet utilisateur qui modifie
- * @param timestamp $date_livraison Date de livraison
+ * @param int $date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
*/
function set_date_livraison($user, $date_livraison)
@@ -2324,16 +2322,16 @@ class Commande extends CommonOrder
*
* @param int $rowid Id of line to update
* @param string $desc Description de la ligne
- * @param double $pu Prix unitaire
- * @param double $qty Quantity
- * @param double $remise_percent Pourcentage de remise de la ligne
- * @param double $txtva Taux TVA
- * @param double $txlocaltax1 Local tax 1 rate
- * @param double $txlocaltax2 Local tax 2 rate
+ * @param float $pu Prix unitaire
+ * @param float $qty Quantity
+ * @param float $remise_percent Pourcentage de remise de la ligne
+ * @param float $txtva Taux TVA
+ * @param float $txlocaltax1 Local tax 1 rate
+ * @param float $txlocaltax2 Local tax 2 rate
* @param string $price_base_type HT or TTC
* @param int $info_bits Miscellaneous informations on line
- * @param timestamp $date_start Start date of the line
- * @param timestamp $date_end End date of the line
+ * @param int $date_start Start date of the line
+ * @param int $date_end End date of the line
* @param int $type Type of line (0=product, 1=service)
* @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines).
* @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules)
@@ -2344,7 +2342,7 @@ class Commande extends CommonOrder
* @param array $array_option extrafields array
* @return int < 0 if KO, > 0 if OK
*/
- function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
+ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
{
global $conf, $mysoc;
@@ -2578,6 +2576,8 @@ class Commande extends CommonOrder
*/
function update_extrafields($user)
{
+ global $hookmanager, $conf;
+
$action='create';
// Actions on extra fields (by external module or standard code)
@@ -3167,7 +3167,7 @@ class Commande extends CommonOrder
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
- global $conf,$user,$langs,$hookmanager;
+ global $conf,$langs;
$langs->load("orders");
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index f42920850c2..0de3c54e1ba 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -500,7 +500,7 @@ if ($resql)
}
else
{
- print dol_print_error($db);
+ dol_print_error($db);
}
llxFooter();
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 1009b030210..930fee833fa 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -696,7 +696,7 @@ if (($action != 'create' && $action != 'add') || !$error)
}
else
{
- print dol_print_error($db);
+ dol_print_error($db);
}
}
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 87b7d3e62c5..024e21510e1 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -432,7 +432,7 @@ if ($id > 0 || ! empty($ref))
print '
';
diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php
index 61e1b9cd926..a8f7c11d92b 100644
--- a/htdocs/compta/dons/class/don.class.php
+++ b/htdocs/compta/dons/class/don.class.php
@@ -450,7 +450,7 @@ class Don extends CommonObject
function delete($rowid)
{
- $this->db-begin();
+ $this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 67ba28b4e47..5f1f3998b5d 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2736,7 +2736,7 @@ if ($action == 'create')
} else {
if ($absolute_creditnote > 0) // If not, link will be added later
{
- if ($object->statut == 0 && $object->type != TYPE_CREDIT_NOTE && $object->type != TYPE_DEPOSIT)
+ if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ') ';
else
print '. ';
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index f6c0ab1a481..3c0bcf4319f 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -591,8 +591,7 @@ class FactureRec extends Facture
parent::initAsSpecimen($option);
- $this->usenewprice = 1;
-
+ $this->usenewprice = 1;
}
}
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 42f0afc0bbb..d50079f78c8 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -59,6 +59,11 @@ class Facture extends CommonInvoice
//! Id client
var $socid;
//! Objet societe client (to load with fetch_client method)
+
+ /**
+ * Customer
+ * @var Societe
+ */
var $client;
var $author;
var $fk_user_author;
@@ -82,7 +87,10 @@ class Facture extends CommonInvoice
var $total_tva=0;
var $total_ttc=0;
var $revenuestamp;
- var $note; // deprecated
+ /**
+ * @deprecated
+ */
+ var $note;
var $note_private;
var $note_public;
//! 0=draft,
@@ -111,7 +119,10 @@ class Facture extends CommonInvoice
var $fk_account; // Id of bank account
var $fk_bank; // Field to store bank id to use when payment mode is withdraw
var $modelpdf;
- var $products=array(); // deprecated
+ /**
+ * @deprecated
+ */
+ var $products=array();
var $lines=array();
var $line;
var $extraparams=array();
@@ -1930,8 +1941,8 @@ class Facture extends CommonInvoice
* @param double $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
- * @param timestamp $date_start Date start of service
- * @param timestamp $date_end Date end of service
+ * @param int $date_start Date start of service
+ * @param int $date_end Date end of service
* @param int $ventil Code of dispatching into accountancy
* @param int $info_bits Bits de type de lignes
* @param int $fk_remise_except Id discount used
@@ -2106,8 +2117,8 @@ class Facture extends CommonInvoice
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines)
* @param double $qty Quantity
* @param double $remise_percent Pourcentage de remise de la ligne
- * @param date $date_start Date de debut de validite du service
- * @param date $date_end Date de fin de validite du service
+ * @param int $date_start Date de debut de validite du service
+ * @param int $date_end Date de fin de validite du service
* @param double $txtva VAT Rate
* @param double $txlocaltax1 Local tax 1 rate
* @param double $txlocaltax2 Local tax 2 rate
@@ -2946,7 +2957,7 @@ class Facture extends CommonInvoice
/**
* Supprime une demande de prelevement
*
- * @param Use $user utilisateur creant la demande
+ * @param User $user utilisateur creant la demande
* @param int $did id de la demande a supprimer
* @return int <0 if OK, >0 if KO
*/
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index f4d6d767091..d0ce1609b2a 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -324,7 +324,7 @@ if ($action == 'remove_file')
$langs->load("other");
$upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file');
- $ret=dol_delete_file($file,0,0,0,'');
+ $ret=dol_delete_file($file);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action='';
@@ -482,7 +482,8 @@ if ($resql)
$formmail = new FormMail($db);
print ' ';
- print_fiche_titre($langs->trans("SendRemind"),'','').' ';
+ print_fiche_titre($langs->trans("SendRemind"),'','');
+ print ' ';
$topicmail="MailTopicSendRemindUnpaidInvoices";
$modelmail="facture_relance";
diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php
index e2c9c94595a..d6260d1b34d 100644
--- a/htdocs/compta/localtax/class/localtax.class.php
+++ b/htdocs/compta/localtax/class/localtax.class.php
@@ -249,10 +249,6 @@ class Localtax extends CommonObject
*/
function delete($user)
{
- global $conf, $langs;
-
- $error=0;
-
// Call trigger
$result=$this->call_trigger('LOCALTAX_DELETE',$user);
if ($result < 0) return -1;
@@ -270,7 +266,6 @@ class Localtax extends CommonObject
return -1;
}
-
return 1;
}
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 7c34cec1ed4..90d6cbe8599 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -104,7 +104,7 @@ $fsearch.=' ';
$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
$fsearch.=' ';
-$calc=MAIN_INFO_LOCALTAX_CALC.$local;
+$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
{
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index b1b4aad7722..612014ac741 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -124,7 +124,7 @@ $fsearch.=' ';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
//$fsearch.=' ';
-$calc=MAIN_INFO_LOCALTAX_CALC.$local;
+$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
{
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index c922099cd0e..13414a5b915 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -315,7 +315,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
if ($(\'#fieldchqemetteur\').val() == \'\')
{
- var emetteur = ('.$facture->type.' == 2) ? \''.dol_escape_htmltag(MAIN_INFO_SOCIETE_NOM).'\' : jQuery(\'#thirdpartylabel\').val();
+ var emetteur = ('.$facture->type.' == 2) ? \''.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'\' : jQuery(\'#thirdpartylabel\').val();
$(\'#fieldchqemetteur\').val(emetteur);
}
}
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 0c5eeca3689..f87689bd202 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -355,7 +355,7 @@ if ($action == 'new')
print $form->select_date($filterdate,'fd',0,0,1,'',1,1);
print '';
print '
';
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 922ab54ac7c..36ef0e2a1e9 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -41,6 +41,8 @@ class RemiseCheque extends CommonObject
//! Numero d'erreur Plage 1024-1279
var $errno;
+ public $statut;
+
/**
* Constructor
*
@@ -274,7 +276,7 @@ class RemiseCheque extends CommonObject
* Supprime la remise en base
*
* @param User $user Utilisateur qui effectue l'operation
- * @return void
+ * @return int
*/
function delete($user='')
{
@@ -292,25 +294,23 @@ class RemiseCheque extends CommonObject
{
$num = $this->db->affected_rows($resql);
- if ($num <> 1)
- {
- $this->errno = -2;
- dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
- }
+ if ($num <> 1) {
+ $this->errno = -2;
+ dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)");
+ }
- if ( $this->errno === 0)
- {
- $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
- $sql.= " SET fk_bordereau = 0";
- $sql.= " WHERE fk_bordereau = '".$this->id."'";
+ if ( $this->errno === 0) {
+ $sql = "UPDATE ".MAIN_DB_PREFIX."bank";
+ $sql.= " SET fk_bordereau = 0";
+ $sql.= " WHERE fk_bordereau = '".$this->id."'";
- $resql = $this->db->query($sql);
- if (!$resql)
- {
- $this->errno = -1028;
- dol_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
- }
- }
+ $resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->errno = -1028;
+ dol_syslog("RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
+ }
+ }
}
if ($this->errno === 0)
@@ -476,7 +476,7 @@ class RemiseCheque extends CommonObject
* Build document
*
* @param string $model Model name
- * @param Tranlsate $outputlangs Object langs
+ * @param Translate $outputlangs Object langs
* @return int <0 if KO, >0 if OK
*/
function generatePdf($model, $outputlangs)
@@ -693,7 +693,7 @@ class RemiseCheque extends CommonObject
* Set the creation date
*
* @param User $user Object user
- * @param timestamp $date Date creation
+ * @param int $date Date creation
* @return int <0 if KO, >0 if OK
*/
function set_date($user, $date)
@@ -727,7 +727,7 @@ class RemiseCheque extends CommonObject
* Set the number of bordereau
*
* @param User $user Object user
- * @param timestamp $number number of bordereau
+ * @param int $number number of bordereau
* @return int <0 if KO, >0 if OK
*/
function set_number($user, $number)
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 2fce476af78..e3fb7a3c824 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -573,7 +573,7 @@ class Paiement extends CommonObject
/**
* Updates the payment date
*
- * @param timestamp $date New date
+ * @param int $date New date
* @return int <0 if KO, 0 if OK
*/
function update_date($date)
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 32820c19619..3738abac4c7 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -403,7 +403,7 @@ class BonPrelevement extends CommonObject
* Set withdrawal to credited status
*
* @param User $user id of user
- * @param timestamp $date date of action
+ * @param int $date date of action
* @return int >0 if OK, <0 if KO
*/
function set_infocredit($user, $date)
@@ -525,7 +525,7 @@ class BonPrelevement extends CommonObject
* Set withdrawal to transmited status
*
* @param User $user id of user
- * @param timestamp $date date of action
+ * @param int $date date of action
* @param string $method method of transmision to bank
* @return int >0 if OK, <0 if KO
*/
@@ -667,9 +667,9 @@ class BonPrelevement extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- return $obj->nb;
-
$this->db->free($resql);
+
+ return $obj->nb;
}
else
{
@@ -1167,7 +1167,7 @@ class BonPrelevement extends CommonObject
/**
* Delete a notification
*
- * @param User $user notification user
+ * @param int $user notification user
* @param string $action notification action
* @return int >0 if OK, <0 if KO
*/
@@ -1631,7 +1631,7 @@ class BonPrelevement extends CommonObject
* Note: The tag PmtInf is opened here but closed into caller
*
* @param string $configuration conf
- * @param date $ladate Date
+ * @param int $ladate Date
* @param int $nombre 0 or 1
* @param float $total Total
* @param string $CrLf End of line character
diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php
index 581fb3152af..2b71c5c8004 100644
--- a/htdocs/compta/prelevement/class/ligneprelevement.class.php
+++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php
@@ -61,7 +61,7 @@ class LignePrelevement
* Recupere l'objet prelevement
*
* @param int $rowid id de la facture a recuperer
- * @return void
+ * @return void|int
*/
function fetch($rowid)
{
diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php
index d0b467f294b..176a561378b 100644
--- a/htdocs/compta/prelevement/class/rejetprelevement.class.php
+++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php
@@ -71,7 +71,7 @@ class RejetPrelevement
* @param User $user User object
* @param int $id Id
* @param string $motif Motif
- * @param timestamp $date_rejet Date rejet
+ * @param int $date_rejet Date rejet
* @param int $bonid Bon id
* @param int $facturation Facturation
* @return void
@@ -272,7 +272,7 @@ class RejetPrelevement
/**
* Retrieve the list of invoices
*
- * @return void
+ * @return array
*/
private function getListInvoices()
{
@@ -318,7 +318,7 @@ class RejetPrelevement
* Retrieve withdrawal object
*
* @param int $rowid id of invoice to retrieve
- * @return void
+ * @return int
*/
function fetch($rowid)
{
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index 1d684c65552..805558b4267 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -69,7 +69,7 @@ class ChargeSociales extends CommonObject
*
* @param int $id Id
* @param string $ref Ref
- * @return void
+ * @return int <0 KO >0 OK
*/
function fetch($id, $ref='')
{
@@ -99,13 +99,14 @@ class ChargeSociales extends CommonObject
$this->paye = $obj->paye;
$this->periode = $this->db->jdate($obj->periode);
+ $this->db->free($resql);
+
return 1;
}
else
{
return 0;
}
- $this->db->free($resql);
}
else
{
@@ -308,6 +309,7 @@ class ChargeSociales extends CommonObject
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
+ $this->db->free($result);
return $obj->amount;
}
else
@@ -315,8 +317,6 @@ class ChargeSociales extends CommonObject
return 0;
}
- $this->db->free($result);
-
}
else
{
@@ -520,8 +520,6 @@ class ChargeSociales extends CommonObject
*/
function initAsSpecimen()
{
- global $user,$langs,$conf;
-
// Initialize parameters
$this->id=0;
$this->ref = 'SPECIMEN';
diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php
index f5d0065e7f3..4b399d65248 100644
--- a/htdocs/compta/tva/quadri.php
+++ b/htdocs/compta/tva/quadri.php
@@ -54,7 +54,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
* @param DoliDB $db Database handler
* @param int $y Year
* @param int $q Year quarter (1-4)
- * @return void
+ * @return array
*/
function tva_coll($db,$y,$q)
{
@@ -122,7 +122,7 @@ function tva_coll($db,$y,$q)
* @param DoliDB $db Database handler object
* @param int $y Year
* @param int $q Year quarter (1-4)
- * @return void
+ * @return array
*/
function tva_paye($db, $y,$q)
{
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 3e58e7b5c7d..c9ff161cef1 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -821,7 +821,7 @@ abstract class CommonObject
* Update a specific field into database
*
* @param string $field Field to update
- * @param mixte $value New value
+ * @param mixed $value New value
* @param string $table To force other table element or element line (should not be used)
* @param int $id To force other object id (should not be used)
* @param string $format Data format ('text', 'date'). 'text' is used if not defined
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 6dc726b084e..d6e23beac70 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -142,7 +142,7 @@ class DolEditor
*
* @param int $noprint 1=Return HTML string instead of printing it to output
* @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });"
- * @return void
+ * @return void|string
*/
function Create($noprint=0,$morejs='')
{
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index fd5a07ffcba..b7971d52c53 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -761,7 +761,7 @@ class FormOther
* @param string $selected Preselected value
* @param string $htmlname Nom de la zone select
* @param int $useempty Affiche valeur vide dans liste
- * @return void
+ * @return string
*/
function select_month($selected='',$htmlname='monthid',$useempty=0)
{
@@ -803,7 +803,7 @@ class FormOther
* @param int $offset Offset
* @param int $invert Invert
* @param string $option Option
- * @return void
+ * @return string
*/
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='')
{
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 488a4c3a530..fdb7d0e76ec 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -27,10 +27,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param Account $object Object related to tabs
* @return array Array of tabs to show
*/
-function bank_prepare_head($object)
+function bank_prepare_head(Account $object)
{
global $langs, $conf, $user;
$h = 0;
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index abdf1b648a5..d30068a5e98 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -28,10 +28,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param Commande $object Object related to tabs
* @return array Array of tabs to show
*/
-function commande_prepare_head($object)
+function commande_prepare_head(Commande $object)
{
global $langs, $conf, $user;
if (! empty($conf->expedition->enabled)) $langs->load("sendings");
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index 53f54d66f70..18608a55a04 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -28,10 +28,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param BonPrelevement $object Object related to tabs
* @return array Array of tabs to show
*/
-function prelevement_prepare_head($object)
+function prelevement_prepare_head(BonPrelevement $object)
{
global $langs, $conf, $user;
$langs->load("withdrawals");
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index cc9478f5d61..be9cf9923c9 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -28,10 +28,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param ChargeSociales $object Object related to tabs
* @return array Array of tabs to show
*/
-function tax_prepare_head($object)
+function tax_prepare_head(ChargeSociales $object)
{
global $langs, $conf;
diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php
index 45619b10d6f..33f977bcf34 100644
--- a/htdocs/core/lib/trip.lib.php
+++ b/htdocs/core/lib/trip.lib.php
@@ -24,10 +24,10 @@
/**
* Prepare array with list of tabs
*
- * @param Object $object Object related to tabs
+ * @param Deplacement $object Object related to tabs
* @return array Array of tabs to show
*/
-function trip_prepare_head($object)
+function trip_prepare_head(Deplacement $object)
{
global $langs, $conf;