Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2011-12-19 21:12:36 +01:00
commit a8057bc475
7 changed files with 383 additions and 324 deletions

View File

@ -268,6 +268,8 @@ class Fichinter extends CommonObject
/** /**
* Set status to draft * Set status to draft
*
* @param User $user User that set draft
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setDraft($user) function setDraft($user)
@ -302,8 +304,9 @@ class Fichinter extends CommonObject
/** /**
* Validate a intervention * Validate a intervention
* @param user User that validate *
* @param outputdir * @param User $user User that validate
* @param string $outputdir Output directory
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setValid($user, $outputdir) function setValid($user, $outputdir)
@ -360,6 +363,7 @@ class Fichinter extends CommonObject
/** /**
* Set intervetnion as billed * Set intervetnion as billed
*
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function setBilled() function setBilled()
@ -385,8 +389,8 @@ class Fichinter extends CommonObject
/** /**
* Returns the label status * Returns the label status
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label * @return string Label
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -395,9 +399,10 @@ class Fichinter extends CommonObject
/** /**
* Returns the label of a statut * Returns the label of a statut
* @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 * @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
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@ -439,8 +444,9 @@ class Fichinter extends CommonObject
/** /**
* Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* @param withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only *
* @return string String with URL * @param int withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @return string String with URL
*/ */
function getNomUrl($withpicto=0) function getNomUrl($withpicto=0)
{ {
@ -465,8 +471,9 @@ class Fichinter extends CommonObject
/** /**
* Returns the next non used reference of intervention * Returns the next non used reference of intervention
* depending on the module numbering assets within FICHEINTER_ADDON * depending on the module numbering assets within FICHEINTER_ADDON
* @param soc Object society *
* @return string Free reference for intervention * @param Societe $soc Object society
* @return string Free reference for intervention
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)
{ {
@ -512,7 +519,8 @@ class Fichinter extends CommonObject
/** /**
* Information sur l'objet fiche intervention * Information sur l'objet fiche intervention
* @param id id de la fiche d'intervention *
* @param int $id id de la fiche d'intervention
*/ */
function info($id) function info($id)
{ {
@ -561,7 +569,8 @@ class Fichinter extends CommonObject
/** /**
* Delete intervetnion * Delete intervetnion
* @param user Object user who deletes *
* @param User $user Object user who deletes
*/ */
function delete($user) function delete($user)
{ {
@ -658,9 +667,10 @@ class Fichinter extends CommonObject
/** /**
* Defines a delivery date of intervention * Defines a delivery date of intervention
* @param user Object user who define *
* @param date_delivery date of delivery * @param User $user Object user who define
* @return int <0 if ko, >0 if ok * @param date $date_delivery date of delivery
* @return int <0 if ko, >0 if ok
*/ */
function set_date_delivery($user, $date_delivery) function set_date_delivery($user, $date_delivery)
{ {
@ -690,9 +700,10 @@ class Fichinter extends CommonObject
/** /**
* Define the label of the intervention * Define the label of the intervention
* @param user Object user who modify *
* @param description description * @param User $user Object user who modify
* @return int <0 if ko, >0 if ok * @param string $description description
* @return int <0 if ko, >0 if ok
*/ */
function set_description($user, $description) function set_description($user, $description)
{ {
@ -722,11 +733,12 @@ class Fichinter extends CommonObject
/** /**
* Adding a line of intervention into data base * Adding a line of intervention into data base
* @param fichinterid Id of intervention *
* @param desc Line description * @param int $fichinterid Id of intervention
* @param date_intervention Intervention date * @param string $desc Line description
* @param duration Intervention duration * @param date $date_intervention Intervention date
* @return int >0 if ok, <0 if ko * @param int $duration Intervention duration
* @return int >0 if ok, <0 if ko
*/ */
function addline($fichinterid, $desc, $date_intervention, $duration) function addline($fichinterid, $desc, $date_intervention, $duration)
{ {
@ -800,6 +812,7 @@ class Fichinter extends CommonObject
/** /**
* Load array lines * Load array lines
*
* @return int <0 if Ko, >0 if OK * @return int <0 if Ko, >0 if OK
*/ */
function fetch_lines() function fetch_lines()
@ -862,8 +875,8 @@ class FichinterLigne
/** /**
* \brief Constructeur d'objets ligne d'intervention * Constructeur d'objets ligne d'intervention
* \param DB handler d'acces base de donnee * @param DoliDB $DB handler d'acces base de donnee
*/ */
function FichinterLigne($DB) function FichinterLigne($DB)
{ {
@ -872,7 +885,8 @@ class FichinterLigne
/** /**
* Retrieve the line of intervention * Retrieve the line of intervention
* @param rowid line id *
* @param int $rowid line id
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@ -906,6 +920,7 @@ class FichinterLigne
/** /**
* Insert the line into database * Insert the line into database
*
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
function insert() function insert()
@ -973,6 +988,7 @@ class FichinterLigne
/** /**
* Update intervention into database * Update intervention into database
*
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
function update() function update()
@ -1016,6 +1032,7 @@ class FichinterLigne
/** /**
* Update total duration into llx_fichinter * Update total duration into llx_fichinter
*
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function update_total() function update_total()
@ -1067,6 +1084,7 @@ class FichinterLigne
/** /**
* Delete a intervention line * Delete a intervention line
*
* @return int >0 if ok, <0 if ko * @return int >0 if ok, <0 if ko
*/ */
function deleteline() function deleteline()

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='')
{ {

View File

@ -506,8 +506,8 @@ class Product extends CommonObject
/** /**
* Delete a product from database (if not used) * Delete a product from database (if not used)
* *
* @param id Product id * @param int $id Product id
* @return int < 0 if KO, 0 = Not possible, > 0 if OK * @return int < 0 if KO, 0 = Not possible, > 0 if OK
*/ */
function delete($id) function delete($id)
{ {
@ -640,7 +640,7 @@ class Product extends CommonObject
/** /**
* Update ou cree les traductions des infos produits * Update ou cree les traductions des infos produits
* *
* @param int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setMultiLangs() function setMultiLangs()
{ {
@ -707,7 +707,7 @@ class Product extends CommonObject
/** /**
* Load array this->multilangs * Load array this->multilangs
* *
* @param int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function getMultiLangs() function getMultiLangs()
{ {
@ -750,8 +750,9 @@ class Product extends CommonObject
/** /**
* Ajoute un changement de prix en base dans l'historique des prix * Ajoute un changement de prix en base dans l'historique des prix
* *
* @param user Objet utilisateur qui modifie le prix * @param User $user Objet utilisateur qui modifie le prix
* @param int <0 if KO, >0 if OK * @param int $level price level to change
* @return int <0 if KO, >0 if OK
*/ */
function _log_price($user,$level=0) function _log_price($user,$level=0)
{ {
@ -782,9 +783,9 @@ class Product extends CommonObject
/** /**
* Delete a price line * Delete a price line
* *
* @param user Object user * @param User $user Object user
* @param rowid Line id to delete * @param int $rowid Line id to delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function log_price_delete($user,$rowid) function log_price_delete($user,$rowid)
{ {
@ -810,11 +811,11 @@ class Product extends CommonObject
* Lit le prix pratique par un fournisseur * Lit le prix pratique par un fournisseur
* On renseigne le couple prodfournprice/qty ou le triplet qty/product_id/fourn_ref) * On renseigne le couple prodfournprice/qty ou le triplet qty/product_id/fourn_ref)
* *
* @param prodfournprice Id du tarif = rowid table product_fournisseur_price * @param int $prodfournprice Id du tarif = rowid table product_fournisseur_price
* @param qty Quantity asked * @param double $qty Quantity asked
* @param product_id Filter on a particular product id * @param int $product_id Filter on a particular product id
* @param fourn_ref Filter on a supplier ref * @param string $fourn_ref Filter on a supplier ref
* @return int <-1 if KO, -1 if qty not enough, 0 si ok mais rien trouve, id_product si ok et trouve * @return int <-1 if KO, -1 if qty not enough, 0 si ok mais rien trouve, id_product si ok et trouve
*/ */
function get_buyprice($prodfournprice,$qty,$product_id=0,$fourn_ref=0) function get_buyprice($prodfournprice,$qty,$product_id=0,$fourn_ref=0)
{ {
@ -888,15 +889,15 @@ class Product extends CommonObject
/** /**
* Modify price of a product/Service * Modify price of a product/Service
* *
* @param id Id of product/service to change * @param int $id Id of product/service to change
* @param newprice New price * @param double $newprice New price
* @param newpricebase HT or TTC * @param string $newpricebase HT or TTC
* @param user Object user that make change * @param User $user Object user that make change
* @param newvat New VAT Rate * @param double $newvat New VAT Rate
* @param newminprice New price min * @param double $newminprice New price min
* @param level 0=standard, >0 = level if multilevel prices * @param int $level 0=standard, >0 = level if multilevel prices
* @param newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT * @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update_price($id, $newprice, $newpricebase, $user, $newvat='',$newminprice='', $level=0, $newnpr=0) function update_price($id, $newprice, $newpricebase, $user, $newvat='',$newminprice='', $level=0, $newnpr=0)
{ {
@ -1152,8 +1153,8 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats propale pour le produit/service * Charge tableau des stats propale pour le produit/service
* *
* @param socid Id societe * @param int $socid Id societe
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_propale($socid=0) function load_stats_propale($socid=0)
{ {
@ -1195,9 +1196,9 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats commande client pour le produit/service * Charge tableau des stats commande client pour le produit/service
* *
* @param socid Id societe pour filtrer sur une societe * @param int $socid Id societe pour filtrer sur une societe
* @param filtrestatut Id statut pour filtrer sur un statut * @param int $filtrestatut Id statut pour filtrer sur un statut
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_commande($socid=0,$filtrestatut='') function load_stats_commande($socid=0,$filtrestatut='')
{ {
@ -1237,9 +1238,9 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats commande fournisseur pour le produit/service * Charge tableau des stats commande fournisseur pour le produit/service
* *
* @param socid Id societe pour filtrer sur une societe * @param int $socid Id societe pour filtrer sur une societe
* @param filtrestatut Id des statuts pour filtrer sur des statuts * @param string $filtrestatut Id des statuts pour filtrer sur des statuts
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_commande_fournisseur($socid=0,$filtrestatut='') function load_stats_commande_fournisseur($socid=0,$filtrestatut='')
{ {
@ -1279,9 +1280,9 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats expedition client pour le produit/service * Charge tableau des stats expedition client pour le produit/service
* *
* @param socid Id societe pour filtrer sur une societe * @param int $socid Id societe pour filtrer sur une societe
* @param filtrestatut Id statut pour filtrer sur un statut * @param int $filtrestatut Id statut pour filtrer sur un statut
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_sending($socid=0,$filtrestatut='') function load_stats_sending($socid=0,$filtrestatut='')
{ {
@ -1323,8 +1324,8 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats contrat pour le produit/service * Charge tableau des stats contrat pour le produit/service
* *
* @param socid Id societe * @param int $socid Id societe
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_contrat($socid=0) function load_stats_contrat($socid=0)
{ {
@ -1365,8 +1366,8 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats facture pour le produit/service * Charge tableau des stats facture pour le produit/service
* *
* @param socid Id societe * @param int $socid Id societe
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_facture($socid=0) function load_stats_facture($socid=0)
{ {
@ -1407,8 +1408,8 @@ class Product extends CommonObject
/** /**
* Charge tableau des stats facture pour le produit/service * Charge tableau des stats facture pour le produit/service
* *
* @param socid Id societe * @param int $socid Id societe
* @return array Tableau des stats * @return array Tableau des stats
*/ */
function load_stats_facture_fournisseur($socid=0) function load_stats_facture_fournisseur($socid=0)
{ {
@ -1449,9 +1450,9 @@ class Product extends CommonObject
/** /**
* Return an array formated for showing graphs * Return an array formated for showing graphs
* *
* @param sql Request to execute * @param string $sql Request to execute
* @param mode 'byunit'=number of unit, 'bynumber'=nb of entities * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/ */
function _get_stats($sql,$mode) function _get_stats($sql,$mode)
{ {
@ -1505,9 +1506,9 @@ class Product extends CommonObject
/** /**
* Return nb of units or customers invoices in which product is included * Return nb of units or customers invoices in which product is included
* *
* @param socid Limit count on a particular third party id * @param int $socid Limit count on a particular third party id
* @param mode 'byunit'=number of unit, 'bynumber'=nb of entities * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/ */
function get_nb_vente($socid=0,$mode) function get_nb_vente($socid=0,$mode)
{ {
@ -1534,9 +1535,9 @@ class Product extends CommonObject
/** /**
* Return nb of units or supplier invoices in which product is included * Return nb of units or supplier invoices in which product is included
* *
* @param socid Limit count on a particular third party id * @param int $socid Limit count on a particular third party id
* @param mode 'byunit'=number of unit, 'bynumber'=nb of entities * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/ */
function get_nb_achat($socid=0,$mode) function get_nb_achat($socid=0,$mode)
{ {
@ -1563,9 +1564,9 @@ class Product extends CommonObject
/** /**
* Return nb of units or proposals in which product is included * Return nb of units or proposals in which product is included
* *
* @param socid Limit count on a particular third party id * @param int $socid Limit count on a particular third party id
* @param mode 'byunit'=number of unit, 'bynumber'=nb of entities * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/ */
function get_nb_propal($socid=0,$mode) function get_nb_propal($socid=0,$mode)
{ {
@ -1591,9 +1592,9 @@ class Product extends CommonObject
/** /**
* Return nb of units or orders in which product is included * Return nb of units or orders in which product is included
* *
* @param socid Limit count on a particular third party id * @param int $socid Limit count on a particular third party id
* @param mode 'byunit'=number of unit, 'bynumber'=nb of entities * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/ */
function get_nb_order($socid=0,$mode) function get_nb_order($socid=0,$mode)
{ {
@ -1618,9 +1619,9 @@ class Product extends CommonObject
/** /**
* Lie un produit associe au produit/service * Lie un produit associe au produit/service
* *
* @param id_pere Id du produit auquel sera lie le produit a lier * @param int $id_pere Id du produit auquel sera lie le produit a lier
* @param id_fils Id du produit a lier * @param int $id_fils Id du produit a lier
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function add_sousproduit($id_pere, $id_fils,$qty) function add_sousproduit($id_pere, $id_fils,$qty)
{ {
@ -1673,9 +1674,9 @@ class Product extends CommonObject
/** /**
* Retire le lien entre un sousproduit et un produit/service * Retire le lien entre un sousproduit et un produit/service
* *
* @param fk_parent Id du produit auquel ne sera plus lie le produit lie * @param int $fk_parent Id du produit auquel ne sera plus lie le produit lie
* @param fk_child Id du produit a ne plus lie * @param int $fk_child Id du produit a ne plus lie
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function del_sousproduit($fk_parent, $fk_child) function del_sousproduit($fk_parent, $fk_child)
{ {
@ -1695,9 +1696,9 @@ class Product extends CommonObject
/** /**
* Verifie si c'est un sous-produit * Verifie si c'est un sous-produit
* *
* @param fk_parent Id du produit auquel le produit est lie * @param int $fk_parent Id du produit auquel le produit est lie
* @param fk_child Id du produit lie * @param int $fk_child Id du produit lie
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function is_sousproduit($fk_parent, $fk_child) function is_sousproduit($fk_parent, $fk_child)
{ {
@ -1942,7 +1943,10 @@ class Product extends CommonObject
* Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits * Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits
* Define value of this->res * Define value of this->res
* *
* @param multiply Because each sublevel must be multiplicated by parent nb * @param array $prod Products array
* @param string $compl_path Directory path
* @param int $multiply Because each sublevel must be multiplicated by parent nb
* @param int $level Init level
* @return void * @return void
*/ */
function fetch_prod_arbo($prod, $compl_path="", $multiply=1, $level=1) function fetch_prod_arbo($prod, $compl_path="", $multiply=1, $level=1)
@ -2012,6 +2016,7 @@ class Product extends CommonObject
/** /**
* fonction recursive uniquement utilisee par get_each_prod, ajoute chaque sousproduits dans le tableau res * fonction recursive uniquement utilisee par get_each_prod, ajoute chaque sousproduits dans le tableau res
* *
* @param array $prod Products array
* @return void * @return void
*/ */
function fetch_prods($prod) function fetch_prods($prod)
@ -2032,7 +2037,8 @@ class Product extends CommonObject
/** /**
* reconstruit l'arborescence des categories sous la forme d'un tableau * reconstruit l'arborescence des categories sous la forme d'un tableau
* *
* @return array $this->res * @param int $multiply
* @return array $this->res
*/ */
function get_arbo_each_prod($multiply=1) function get_arbo_each_prod($multiply=1)
{ {
@ -2138,8 +2144,8 @@ class Product extends CommonObject
/** /**
* Return childs of prodcut with if fk_parent * Return childs of prodcut with if fk_parent
* *
* @param fk_parent Id of product to search childs of * @param int $fk_parent Id of product to search childs of
* @return array Prod * @return array Prod
*/ */
function getChildsArbo($fk_parent) function getChildsArbo($fk_parent)
{ {
@ -2196,12 +2202,12 @@ class Product extends CommonObject
} }
/** /**
* Return clicable link of object (with eventually picto) * Return clicable link of object (with eventually picto)
* *
* @param withpicto Add picto into link * @param int $withpicto Add picto into link
* @param option Where point the link * @param string $option Where point the link
* @param maxlength Maxlength of ref * @param int $maxlength Maxlength of ref
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0,$option='',$maxlength=0) function getNomUrl($withpicto=0,$option='',$maxlength=0)
{ {
@ -2241,11 +2247,11 @@ class Product extends CommonObject
} }
/** /**
* Return label of status of object * Return label of status of object
* *
* @param 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
* @param type 0=Shell, 1=Buy * @param int $type 0=Shell, 1=Buy
* @return string Label of status * @return string Label of status
*/ */
function getLibStatut($mode=0, $type=0) function getLibStatut($mode=0, $type=0)
{ {
@ -2256,12 +2262,12 @@ class Product extends CommonObject
} }
/** /**
* Return label of a given status * Return label of a given status
* *
* @param status Statut * @param int $status 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 $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @param type 0=Status "to sell", 1=Status "to buy" * @param int $type 0=Status "to sell", 1=Status "to buy"
* @return string Label of status * @return string Label of status
*/ */
function LibStatut($status,$mode=0,$type=0) function LibStatut($status,$mode=0,$type=0)
{ {
@ -2321,13 +2327,13 @@ class Product extends CommonObject
/** /**
* Adjust stock in a warehouse for product * Adjust stock in a warehouse for product
* *
* @param user user asking change * @param User $user user asking change
* @param id_entrepot id of warehouse * @param int $id_entrepot id of warehouse
* @param nbpiece nb of units * @param double $nbpiece nb of units
* @param movement 0 = add, 1 = remove * @param int $movement 0 = add, 1 = remove
* @param label Label of stock movement * @param string $label Label of stock movement
* @param price Price to use for stock eval * @param double $price Price to use for stock eval
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label='', $price=0) function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label='', $price=0)
{ {
@ -2401,10 +2407,10 @@ class Product extends CommonObject
/** /**
* Deplace fichier uploade sous le nom $files dans le repertoire sdir * Deplace fichier uploade sous le nom $files dans le repertoire sdir
* *
* @param sdir Repertoire destination finale * @param string $sdir Repertoire destination finale
* @param $file Nom du fichier uploade * @param string $file Nom du fichier uploade
* @param maxWidth Largeur maximum que dois faire la miniature (160 par defaut) * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
*/ */
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120)
{ {
@ -2433,10 +2439,10 @@ class Product extends CommonObject
/** /**
* Build thumb * Build thumb
* *
* @param sdir Repertoire destination finale * @param string $sdir Repertoire destination finale
* @param file Chemin du fichier d'origine * @param string $file Chemin du fichier d'origine
* @param maxWidth Largeur maximum que dois faire la miniature (160 par defaut) * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
*/ */
function add_thumb($file, $maxWidth = 160, $maxHeight = 120) function add_thumb($file, $maxWidth = 160, $maxHeight = 120)
{ {
@ -2452,8 +2458,8 @@ class Product extends CommonObject
/** /**
* Deplace fichier recupere sur internet (utilise pour interface avec OSC) * Deplace fichier recupere sur internet (utilise pour interface avec OSC)
* *
* @param sdir Repertoire destination finale * @param string $sdir Repertoire destination finale
* @param $files url de l'image * @param string $file url de l'image
* @author Jean Heimburger june 2007 * @author Jean Heimburger june 2007
*/ */
function add_photo_web($sdir, $file) function add_photo_web($sdir, $file)
@ -2488,8 +2494,8 @@ class Product extends CommonObject
/** /**
* Affiche la premiere photo du produit * Affiche la premiere photo du produit
* *
* @param sdir Repertoire a scanner * @param string $sdir Repertoire a scanner
* @return boolean true si photo dispo, false sinon * @return boolean true si photo dispo, false sinon
*/ */
function is_photo_available($sdir) function is_photo_available($sdir)
{ {
@ -2521,15 +2527,15 @@ class Product extends CommonObject
* Show photos of a product (nbmax maximum), into several columns * Show photos of a product (nbmax maximum), into several columns
* TODO Move this into html.formproduct.class.php * TODO Move this into html.formproduct.class.php
* *
* @param sdir Directory to scan * @param string $sdir Directory to scan
* @param size 0=original size, 1 use thumbnail if possible * @param int $size 0=original size, 1 use thumbnail if possible
* @param nbmax Nombre maximum de photos (0=pas de max) * @param int $nbmax Nombre maximum de photos (0=pas de max)
* @param nbbyrow Nombre vignettes par ligne (si mode vignette) * @param int $nbbyrow Nombre vignettes par ligne (si mode vignette)
* @param showfilename 1=Show filename * @param int $showfilename 1=Show filename
* @param showaction 1=Show icon with action links (resize, delete) * @param int $showaction 1=Show icon with action links (resize, delete)
* @param maxHeight Max height of image when size=1 * @param int $maxHeight Max height of image when size=1
* @param maxWidth Max width of image when size=1 * @param int $maxWidth Max width of image when size=1
* @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
*/ */
function show_photos($sdir,$size=0,$nbmax=0,$nbbyrow=5,$showfilename=0,$showaction=0,$maxHeight=120,$maxWidth=160) function show_photos($sdir,$size=0,$nbmax=0,$nbbyrow=5,$showfilename=0,$showaction=0,$maxHeight=120,$maxWidth=160)
{ {
@ -2689,9 +2695,9 @@ class Product extends CommonObject
/** /**
* Retourne tableau de toutes les photos du produit * Retourne tableau de toutes les photos du produit
* *
* @param dir Repertoire a scanner * @param string $dir Repertoire a scanner
* @param nbmax Nombre maximum de photos (0=pas de max) * @param int $nbmax Nombre maximum de photos (0=pas de max)
* @return array Tableau de photos * @return array Tableau de photos
*/ */
function liste_photos($dir,$nbmax=0) function liste_photos($dir,$nbmax=0)
{ {
@ -2743,7 +2749,7 @@ class Product extends CommonObject
/** /**
* Efface la photo du produit et sa vignette * Efface la photo du produit et sa vignette
* *
* @param file Chemin de l'image * @param string $file Chemin de l'image
*/ */
function delete_photo($file) function delete_photo($file)
{ {
@ -2770,7 +2776,7 @@ class Product extends CommonObject
/** /**
* Load size of image file * Load size of image file
* *
* @param file Path to file * @param string $file Path to file
*/ */
function get_image_size($file) function get_image_size($file)
{ {
@ -2816,7 +2822,7 @@ class Product extends CommonObject
/** /**
* Mise a jour du code barre * Mise a jour du code barre
* *
* @param user Utilisateur qui fait la modification * @param User $user Utilisateur qui fait la modification
*/ */
function update_barcode($user) function update_barcode($user)
{ {
@ -2840,7 +2846,7 @@ class Product extends CommonObject
/** /**
* Mise a jour du type de code barre * Mise a jour du type de code barre
* *
* @param user Utilisateur qui fait la modification * @param User $user Utilisateur qui fait la modification
*/ */
function update_barcode_type($user) function update_barcode_type($user)
{ {
@ -2864,6 +2870,7 @@ class Product extends CommonObject
/** /**
* Return if object is a product * Return if object is a product
*
* @return boolean True if it's a product * @return boolean True if it's a product
*/ */
function isproduct() function isproduct()
@ -2880,6 +2887,7 @@ class Product extends CommonObject
/** /**
* Return if object is a product * Return if object is a product
*
* @return boolean True if it's a service * @return boolean True if it's a service
*/ */
function isservice() function isservice()

View File

@ -52,8 +52,8 @@ class Service extends CommonObject
/** /**
* \brief Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* \return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function load_state_board() function load_state_board()
{ {