Qual: Uniformize code

This commit is contained in:
simnandez 2011-12-19 17:12:29 +01:00
parent 6498742d27
commit 136fba88ad
4 changed files with 211 additions and 178 deletions

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -101,11 +102,13 @@ class Fournisseur extends Societe
} }
} }
/** /**
* \brief Cree la commande au statut brouillon * Create the order from an existing
* \param user Utilisateur qui cree *
* \return int <0 si ko, id de la commande creee si ok * @param User $user Creator user
*/ * @param int $idc Id source
* @param int $comclientid Id thirdparty
*/
function updateFromCommandeClient($user, $idc, $comclientid) function updateFromCommandeClient($user, $idc, $comclientid)
{ {
$comm = new CommandeFournisseur($this->db); $comm = new CommandeFournisseur($this->db);
@ -115,9 +118,10 @@ class Fournisseur extends Societe
} }
/** /**
* \brief Cree la commande au statut brouillon * Create the order with draft status
* \param user Utilisateur qui cree
* \return int <0 si ko, id de la commande creee si ok * @param User $user Creator user
* @return int <0 if ko, id of order if ok
*/ */
function create_commande($user) function create_commande($user)
{ {
@ -183,9 +187,9 @@ class Fournisseur extends Societe
/** /**
* Create a supplier category * Create a supplier category
* *
* @param user User asking creation * @param User $user User asking creation
* @param name Nom categorie * @param string $name Category name
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
function CreateCategory($user, $name) function CreateCategory($user, $name)
{ {
@ -209,7 +213,7 @@ class Fournisseur extends Societe
} }
/** /**
* Retourne la liste des fournisseurs * Return the suppliers list
* *
* @return array Array of suppliers * @return array Array of suppliers
*/ */

View File

@ -71,7 +71,7 @@ class CommandeFournisseur extends Commande
/** Constructeur /** Constructeur
* @param DB Handler d'acces aux bases de donnees * @param DoliDB $DB Handler d'acces aux bases de donnees
*/ */
function CommandeFournisseur($DB) function CommandeFournisseur($DB)
{ {
@ -239,11 +239,11 @@ class CommandeFournisseur extends Commande
/** /**
* Add a line in log table * Add a line in log table
* @param user User making action * @param User $user User making action
* @param statut Status of order * @param int $statut Status of order
* @param datelog Date of change * @param date $datelog Date of change
* @param comment Comment * @param string $comment Comment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function log($user, $statut, $datelog, $comment='') function log($user, $statut, $datelog, $comment='')
{ {
@ -269,7 +269,7 @@ class CommandeFournisseur extends Commande
/** /**
* Validate an order * Validate an order
* *
* @param User $user Utilisateur qui valide * @param User $user Validator User
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function valid($user) function valid($user)
@ -470,9 +470,10 @@ class CommandeFournisseur extends Commande
/** /**
* Return label of a status * Return label of a status
* @param statut Id statut *
* @param mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto * @param int $statut Id statut
* @return string Label of status * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @return string Label of status
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@ -540,9 +541,10 @@ class CommandeFournisseur extends Commande
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* @param option Sur quoi pointe le lien * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Chaine avec URL * @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {
@ -566,7 +568,8 @@ class CommandeFournisseur extends Commande
/** /**
* Renvoie la reference de commande suivante non utilisee en fonction du modele * Renvoie la reference de commande suivante non utilisee en fonction du modele
* de numerotation actif defini dans COMMANDE_SUPPLIER_ADDON * de numerotation actif defini dans COMMANDE_SUPPLIER_ADDON
* @param soc objet societe *
* @param Societe $soc objet societe
* @return string reference libre pour la facture * @return string reference libre pour la facture
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)
@ -700,7 +703,9 @@ class CommandeFournisseur extends Commande
/** /**
* Refuse an order * Refuse an order
* @param user User making action *
* @param User $user User making action
* @return int 0 if Ok, <0 if Ko
*/ */
function refuse($user) function refuse($user)
{ {
@ -746,7 +751,9 @@ class CommandeFournisseur extends Commande
/** /**
* Cancel an approved order. * Cancel an approved order.
* L'annulation se fait apres l'approbation * L'annulation se fait apres l'approbation
* @param user User making action *
* @param User $user User making action
* @return int >0 if Ok, <0 if Ko
*/ */
function Cancel($user) function Cancel($user)
{ {
@ -807,10 +814,10 @@ class CommandeFournisseur extends Commande
/** /**
* Send a supplier order to supplier * Send a supplier order to supplier
* @param user User making change * @param User $user User making change
* @param date Date * @param date $date Date
* @param methode Method * @param int $methode Method
* @param comment Comment * @param string $comment Comment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function commande($user, $date, $methode, $comment='') function commande($user, $date, $methode, $comment='')
@ -843,8 +850,8 @@ class CommandeFournisseur extends Commande
/** /**
* Create order with draft status * Create order with draft status
* @param user User making creation * @param User $user User making creation
* @return int <0 if KO, Id of supplier order if OK * @return int <0 if KO, Id of supplier order if OK
*/ */
function create($user) function create($user)
{ {
@ -925,20 +932,20 @@ class CommandeFournisseur extends Commande
/** /**
* Add order line * Add order line
* *
* @param desc Description * @param string $desc Description
* @param pu_ht Unit price * @param double $pu_ht Unit price
* @param qty Quantity * @param double $qty Quantity
* @param txtva Taux tva * @param double $txtva Taux tva
* @param txlocaltax1 Localtax1 tax * @param double $txlocaltax1 Localtax1 tax
* @param txlocaltax2 Localtax2 tax * @param double $txlocaltax2 Localtax2 tax
* @param fk_product Id produit * @param int $fk_product Id produit
* @param fk_prod_fourn_price Id supplier price * @param int $fk_prod_fourn_price Id supplier price
* @param fourn_ref Supplier reference * @param string $fourn_ref Supplier reference
* @param remise_percent Remise * @param double $remise_percent Remise
* @param price_base_type HT or TTC * @param string $price_base_type HT or TTC
* @param pu_ttc Unit price TTC * @param double $pu_ttc Unit price TTC
* @param type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $type=0, $info_bits=0) function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $type=0, $info_bits=0)
{ {
@ -1087,13 +1094,13 @@ class CommandeFournisseur extends Commande
/** /**
* Add a product into a stock warehouse. * Add a product into a stock warehouse.
* *
* @param $user User object making change * @param User $user User object making change
* @param $product Id of product to dispatch * @param int $product Id of product to dispatch
* @param $qty Qty to dispatch * @param double $qty Qty to dispatch
* @param $entrepot Id of warehouse to add product * @param int $entrepot Id of warehouse to add product
* @param $price Price for PMP value calculation * @param double $price Price for PMP value calculation
* @param $comment Comment for stock movement * @param string $comment Comment for stock movement
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='') function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='')
{ {
@ -1164,6 +1171,7 @@ class CommandeFournisseur extends Commande
* Delete line * Delete line
* *
* @param int $idligne Id of line to delete * @param int $idligne Id of line to delete
* @return 0 if Ok, <0 ik Ko
*/ */
function deleteline($idligne) function deleteline($idligne)
{ {
@ -1246,7 +1254,9 @@ class CommandeFournisseur extends Commande
} }
/** /**
* Return list of order methods * Get list of order methods
*
* @return 0 if Ok, <0 if Ko
*/ */
function get_methodes_commande() function get_methodes_commande()
{ {
@ -1278,8 +1288,9 @@ class CommandeFournisseur extends Commande
/** /**
* Change les conditions de reglement de la commande * Change les conditions de reglement de la commande
* @param cond_reglement_id Id de la nouvelle condition de reglement *
* @return int >0 si ok, <0 si ko * @param int $cond_reglement_id Id de la nouvelle condition de reglement
* @return int >0 si ok, <0 si ko
*/ */
function cond_reglement($cond_reglement_id) function cond_reglement($cond_reglement_id)
{ {
@ -1311,8 +1322,9 @@ class CommandeFournisseur extends Commande
/** /**
* Change le mode de reglement * Change le mode de reglement
* @param mode_reglement_id Id du nouveau mode *
* @return int >0 if OK, <0 if KO * @param int $mode_reglement_id Id du nouveau mode
* @return int >0 if OK, <0 if KO
*/ */
function mode_reglement($mode_reglement_id) function mode_reglement($mode_reglement_id)
{ {
@ -1344,10 +1356,11 @@ class CommandeFournisseur extends Commande
/** /**
* Set a delivery in database for this supplier order * Set a delivery in database for this supplier order
* @param user User that input data *
* @param date Date of reception * @param User $user User that input data
* @param type Type of receipt * @param date $date Date of reception
* @param comment Comment * @param string $type Type of receipt
* @param string $comment Comment
*/ */
function Livraison($user, $date, $type, $comment) function Livraison($user, $date, $type, $comment)
{ {
@ -1404,9 +1417,9 @@ class CommandeFournisseur extends Commande
/** /**
* Cree la commande depuis une propale existante * Cree la commande depuis une propale existante
* @param user Utilisateur qui cree * @param User $user Utilisateur qui cree
* @param idc Id de la propale qui sert de modele * @param int $idc Id de la propale qui sert de modele
* @param comclientid Id thirdparty * @param int $comclientid Id thirdparty
*/ */
function updateFromCommandeClient($user, $idc, $comclientid) function updateFromCommandeClient($user, $idc, $comclientid)
{ {
@ -1450,6 +1463,7 @@ class CommandeFournisseur extends Commande
* @param string $note Private note * @param string $note Private note
* @param string $note_public Public note * @param string $note_public Public note
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*
* TODO Use instead update_note_public and update_note * TODO Use instead update_note_public and update_note
*/ */
function UpdateNote($user, $note, $note_public) function UpdateNote($user, $note, $note_public)
@ -1521,9 +1535,10 @@ class CommandeFournisseur extends Commande
/** /**
* Tag order with a particular status * Tag order with a particular status
* @param user Object user that change status *
* @param status New status * @param User $user Object user that change status
* @return int <0 if KO, >0 if OK * @param int $status New status
* @return int <0 if KO, >0 if OK
*/ */
function setStatus($user,$status) function setStatus($user,$status)
{ {
@ -1564,18 +1579,18 @@ class CommandeFournisseur extends Commande
/** /**
* Update line * Update line
* *
* @param rowid Id de la ligne de facture * @param int $rowid Id de la ligne de facture
* @param desc Description de la ligne * @param string $desc Description de la ligne
* @param pu Prix unitaire * @param double $pu Prix unitaire
* @param qty Quantity * @param double $qty Quantity
* @param remise_percent Pourcentage de remise de la ligne * @param double $remise_percent Pourcentage de remise de la ligne
* @param tva_tx Taux TVA * @param double $tva_tx Taux TVA
* @param localtax1 Localtax1 tax * @param double $localtax1 Localtax1 tax
* @param localtax2 Localtax2 tax * @param double $localtax2 Localtax2 tax
* @param price_base_type Type of price base * @param double $price_base_type Type of price base
* @param info_bits Miscellanous informations * @param int $info_bits Miscellanous informations
* @param type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @return int < 0 if error, > 0 if ok * @return int < 0 if error, > 0 if ok
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0) function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0)
{ {
@ -1765,10 +1780,10 @@ class CommandeFournisseur extends Commande
} }
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @param user Objet user * @param User $user Objet user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function load_board($user) function load_board($user)
{ {
@ -1904,6 +1919,7 @@ class CommandeFournisseurLigne extends OrderLine
/** /**
* Mise a jour de l'objet ligne de commande en base * Mise a jour de l'objet ligne de commande en base
*
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function update_total() function update_total()

View File

@ -556,9 +556,10 @@ class FactureFournisseur extends Facture
/** /**
* Delete invoice from database * Delete invoice from database
* @param rowid Id of invoice to delete *
* @return int <0 if KO, >0 if OK * @param int $rowid Id of invoice to delete
* @return int <0 if KO, >0 if OK
*/ */
function delete($rowid) function delete($rowid)
{ {
@ -606,10 +607,11 @@ class FactureFournisseur extends Facture
} }
/** /**
* Set supplier ref * Set supplier ref
* @param user User that make change *
* @param ref_supplier Supplier ref * @param User $user User that make change
* @return int <0 if KO, >0 if OK * @param string $ref_supplier Supplier ref
* @return int <0 if KO, >0 if OK
*/ */
function set_ref_supplier($user, $ref_supplier) function set_ref_supplier($user, $ref_supplier)
{ {
@ -638,9 +640,10 @@ class FactureFournisseur extends Facture
} }
/** /**
* Tag invoice as a payed invoice * Tag invoice as a payed invoice
* @param user Object user *
* @return int <0 si ko, >0 si ok * @param User $user Object user
* @return int <0 si ko, >0 si ok
*/ */
function set_paid($user) function set_paid($user)
{ {
@ -685,11 +688,12 @@ class FactureFournisseur extends Facture
/** /**
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
* Fonction utilisee quand un paiement prelevement est refuse, * Fonction utilisee quand un paiement prelevement est refuse,
* ou quand une facture annulee et reouverte. * ou quand une facture annulee et reouverte.
* @param user Object user that change status *
* @return int <0 si ok, >0 si ok * @param User $user Object user that change status
* @return int <0 si ok, >0 si ok
*/ */
function set_unpaid($user) function set_unpaid($user)
{ {
@ -733,12 +737,12 @@ class FactureFournisseur extends Facture
} }
/** /**
* Tag invoice as validated + call trigger BILL_VALIDATE * Tag invoice as validated + call trigger BILL_VALIDATE
* *
* @param User $user Object user that validate * @param User $user Object user that validate
* @param string $force_number Reference to force on invoice * @param string $force_number Reference to force on invoice
* @param int $idwarehouse Id of warehouse for stock change * @param int $idwarehouse Id of warehouse for stock change
* @return int <0 if KO, =0 if nothing to do, >0 if OK * @return int <0 if KO, =0 if nothing to do, >0 if OK
*/ */
function validate($user, $force_number='', $idwarehouse=0) function validate($user, $force_number='', $idwarehouse=0)
{ {
@ -906,23 +910,23 @@ class FactureFournisseur extends Facture
* de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod) * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*
* @param desc Description de la ligne * @param string $desc Description de la ligne
* @param pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note) * @param double $pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note)
* @param txtva Taux de tva force, sinon -1 * @param double $txtva Taux de tva force, sinon -1
* @param txlocaltax1 LocalTax1 Rate * @param double $txlocaltax1 LocalTax1 Rate
* @param txlocaltax2 LocalTax2 Rate * @param double $txlocaltax2 LocalTax2 Rate
* @param qty Quantite * @param double $qty Quantite
* @param fk_product Id du produit/service predefini * @param int $fk_product Id du produit/service predefini
* @param remise_percent Pourcentage de remise de la ligne * @param double $remise_percent Pourcentage de remise de la ligne
* @param date_start Date de debut de validite du service * @param date $date_start Date de debut de validite du service
* @param date_end Date de fin de validite du service * @param date $date_end Date de fin de validite du service
* @param ventil Code de ventilation comptable * @param string $ventil Code de ventilation comptable
* @param info_bits Bits de type de lines * @param int $ºinfo_bits Bits de type de lines
* @param price_base_type HT ou TTC * @param string $price_base_type HT ou TTC
* @param type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @param rang Position of line * @param int $rang Position of line
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function addline($desc, $pu, $txtva, $txlocaltax1=0, $txlocaltax2=0, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1) function addline($desc, $pu, $txtva, $txlocaltax1=0, $txlocaltax2=0, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1)
{ {
@ -984,19 +988,19 @@ class FactureFournisseur extends Facture
/** /**
* Update a line detail into database * Update a line detail into database
* @param id Id of line invoice * @param int $id Id of line invoice
* @param label Description of line * @param string $label Description of line
* @param pu Prix unitaire (HT ou TTC selon price_base_type) * @param double $pu Prix unitaire (HT ou TTC selon price_base_type)
* @param vatrate VAT Rate * @param double $vatrate VAT Rate
* @param txlocaltax1 LocalTax1 Rate * @param double $txlocaltax1 LocalTax1 Rate
* @param txlocaltax2 LocalTax2 Rate * @param double $txlocaltax2 LocalTax2 Rate
* @param qty Quantity * @param double $qty Quantity
* @param idproduct Id produit * @param int $idproduct Id produit
* @param price_base_type HT or TTC * @param double $price_base_type HT or TTC
* @param info_bits Miscellanous informations of line * @param int $info_bits Miscellanous informations of line
* @param type Type of line (0=product, 1=service) * @param int $type Type of line (0=product, 1=service)
* @param remise_percent Pourcentage de remise de la ligne * @param double $remise_percent Pourcentage de remise de la ligne
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function updateline($id, $label, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0) function updateline($id, $label, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0)
{ {
@ -1079,7 +1083,7 @@ class FactureFournisseur extends Facture
/** /**
* Delete a detail line from database * Delete a detail line from database
* @param rowid id of line to delete * @param int $rowid id of line to delete
*/ */
function deleteline($rowid) function deleteline($rowid)
{ {
@ -1098,8 +1102,8 @@ class FactureFournisseur extends Facture
/** /**
* \brief Charge les informations d'ordre info dans l'objet facture * Charge les informations d'ordre info dans l'objet facture
* \param id Id de la facture a charger * @param int $id Id de la facture a charger
*/ */
function info($id) function info($id)
{ {
@ -1141,9 +1145,9 @@ class FactureFournisseur extends Facture
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* @param user Objet user * @param User $user Objet user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function load_board($user) function load_board($user)
{ {
@ -1182,11 +1186,12 @@ class FactureFournisseur extends Facture
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* @param option Sur quoi pointe le lien * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param max Max length of shown ref * @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL * @param int $max Max length of shown ref
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='',$max=0) function getNomUrl($withpicto=0,$option='',$max=0)
{ {
@ -1306,10 +1311,11 @@ class FactureFournisseur extends Facture
} }
/** /**
* Load an object from its id and create a new one in database * Load an object from its id and create a new one in database
* @param fromid Id of object to clone *
* @param invertdetail Reverse sign of amounts for lines * @param int $fromid Id of object to clone
* @return int New id of clone * @param int $invertdetail Reverse sign of amounts for lines
* @return int New id of clone
*/ */
function createFromClone($fromid,$invertdetail=0) function createFromClone($fromid,$invertdetail=0)
{ {

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -65,9 +66,9 @@ class PaiementFourn extends Paiement
} }
/** /**
* \brief Load payment object * Load payment object
* \param id id paiement to get * @param int $id id paiement to get
* \return int <0 si ko, >0 si ok * @return int <0 if ko, >0 if ok
*/ */
function fetch($id) function fetch($id)
{ {
@ -112,10 +113,11 @@ class PaiementFourn extends Paiement
} }
/** /**
* Create payment in database * Create payment in database
* @param user Object of creating user *
* @param closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more * @param User $user Object of creating user
* @return int id of created payment, < 0 if error * @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
* @return int id of created payment, < 0 if error
*/ */
function create($user,$closepaidinvoices=0) function create($user,$closepaidinvoices=0)
{ {
@ -233,10 +235,11 @@ class PaiementFourn extends Paiement
/** /**
* \brief Supprime un paiement ainsi que les lignes qu'il a genere dans comptes * Supprime un paiement ainsi que les lignes qu'il a genere dans comptes
* Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse * Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
* Si le paiement porte sur au moins une facture a "payee", on refuse * Si le paiement porte sur au moins une facture a "payee", on refuse
* \return int <0 si ko, >0 si ok *
* @return int <0 si ko, >0 si ok
*/ */
function delete() function delete()
{ {
@ -316,9 +319,9 @@ class PaiementFourn extends Paiement
} }
} }
/* /**
* \brief Information sur l'objet * Information sur l'objet
* \param id id du paiement dont il faut afficher les infos * @param int $id id du paiement dont il faut afficher les infos
*/ */
function info($id) function info($id)
{ {
@ -358,9 +361,10 @@ class PaiementFourn extends Paiement
} }
/** /**
* \brief Retourne la liste des factures sur lesquels porte le paiement * Retourne la liste des factures sur lesquels porte le paiement
* \param filter Critere de filtre *
* \return array Tableau des id de factures * @param string $filter Critere de filtre
* @return array Tableau des id de factures
*/ */
function getBillsArray($filter='') function getBillsArray($filter='')
{ {
@ -393,9 +397,10 @@ class PaiementFourn extends Paiement
} }
/** /**
* \brief Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto *
* \return string Libelle * @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
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -403,10 +408,11 @@ class PaiementFourn extends Paiement
} }
/** /**
* \brief Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* \param status Statut *
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $status Statut
* \return string Libelle du statut * @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
*/ */
function LibStatut($status,$mode=0) function LibStatut($status,$mode=0)
{ {
@ -448,10 +454,11 @@ class PaiementFourn extends Paiement
/** /**
* \brief Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* \param option Sur quoi pointe le lien * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \return string Chaine avec URL * @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {