This commit is contained in:
eldy 2011-09-29 22:32:28 +02:00
parent 8ff32f8ada
commit 0a9364c5e9
4 changed files with 170 additions and 137 deletions

View File

@ -74,7 +74,9 @@ class Expedition extends CommonObject
var $date_valid; var $date_valid;
/** /**
* Initialisation * Constructor
*
* @param DoliDB $DB Database handler
*/ */
function Expedition($DB) function Expedition($DB)
{ {
@ -90,8 +92,9 @@ class Expedition extends CommonObject
/** /**
* Return next contract ref * Return next contract ref
* @param soc objet society *
* @return string free reference for contract * @param Societe $soc Objet society
* @return string Free reference for contract
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)
{ {
@ -135,9 +138,10 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Cree expedition en base * Create expedition en base
* \param user Objet du user qui cree *
* \return int <0 si erreur, id expedition creee si ok * @param User $user Objet du user qui cree
* @return int <0 si erreur, id expedition creee si ok
*/ */
function create($user) function create($user)
{ {
@ -301,10 +305,11 @@ class Expedition extends CommonObject
/** /**
* Get object and lines from database * Get object and lines from database
* @param id Id of object to load *
* @param ref Ref of object * @param int $id Id of object to load
* @param ref_ext External reference of object * @param string $ref Ref of object
* @param ref_int Internal reference of other object * @param string $ref_ext External reference of object
* @param string $ref_int Internal reference of other object
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function fetch($id, $ref='', $ref_ext='', $ref_int='') function fetch($id, $ref='', $ref_ext='', $ref_int='')
@ -408,8 +413,9 @@ class Expedition extends CommonObject
/** /**
* Validate object and update stock if option enabled * Validate object and update stock if option enabled
* @param user Object user that validate *
* @return int * @param User $user Object user that validate
* @return int <0 if OK, >0 if KO
*/ */
function valid($user) function valid($user)
{ {
@ -579,9 +585,10 @@ class Expedition extends CommonObject
/** /**
* \brief Cree un bon de livraison a partir de l'expedition * Cree un bon de livraison a partir de l'expedition
* \param user Utilisateur *
* \return int <0 si ko, >=0 si ok * @param User $user Utilisateur
* @return int <0 if KO, >=0 if OK
*/ */
function create_delivery($user) function create_delivery($user)
{ {
@ -651,10 +658,11 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Update database * Update database
* \param user User that modify *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that modify
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=0, $notrigger=0)
{ {
@ -755,6 +763,8 @@ class Expedition extends CommonObject
/** /**
* Delete shipping * Delete shipping
*
* @return void
*/ */
function delete() function delete()
{ {
@ -838,8 +848,9 @@ class Expedition extends CommonObject
} }
/** /**
* Load lines
* *
* * @return void
*/ */
function fetch_lines() function fetch_lines()
{ {
@ -898,9 +909,10 @@ class Expedition extends CommonObject
} }
/** /**
* \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 *
* \return string Chaine avec URL * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{ {
@ -925,8 +937,9 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Retourne le libelle du statut d'une expedition * Retourne le libelle du statut d'une expedition
* \return string Libelle *
* @return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -934,10 +947,11 @@ class Expedition extends CommonObject
} }
/** /**
* \brief 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) function LibStatut($statut,$mode)
{ {
@ -1047,10 +1061,11 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Set the planned delivery date * Set the planned delivery date
* \param user Objet utilisateur qui modifie *
* \param date_livraison Date de livraison * @param user Objet utilisateur qui modifie
* \return int <0 si ko, >0 si ok * @param date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
*/ */
function set_date_livraison($user, $date_livraison) function set_date_livraison($user, $date_livraison)
{ {
@ -1081,7 +1096,9 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Fetch deliveries method and return an array. Load array this->meths(rowid=>label). * Fetch deliveries method and return an array. Load array this->meths(rowid=>label).
*
* @return void
*/ */
function fetch_delivery_methods() function fetch_delivery_methods()
{ {
@ -1106,6 +1123,8 @@ class Expedition extends CommonObject
/** /**
* Get tracking url status * Get tracking url status
*
* @return void
*/ */
function GetUrlTrackingStatus($value='') function GetUrlTrackingStatus($value='')
{ {
@ -1157,8 +1176,7 @@ class Expedition extends CommonObject
/** /**
* \class ExpeditionLigne * Classe de gestion des lignes de bons d'expedition
* \brief Classe de gestion des lignes de bons d'expedition
*/ */
class ExpeditionLigne class ExpeditionLigne
{ {

View File

@ -30,13 +30,20 @@ class ExpeditionStats
{ {
var $db; var $db;
/**
* Constructor
*
* @param DoliDB $DB Database handler
*/
function ExpeditionStats($DB) function ExpeditionStats($DB)
{ {
$this->db = $DB; $this->db = $DB;
} }
/** /**
* Renvoie le nombre de expedition par annee * Renvoie le nombre de expedition par annee
* *
* @return void
*/ */
function getNbExpeditionByYear() function getNbExpeditionByYear()
{ {
@ -65,9 +72,12 @@ class ExpeditionStats
} }
return $result; return $result;
} }
/** /**
* Renvoie le nombre de expedition par mois pour une annee donnee * Renvoie le nombre de expedition par mois pour une annee donnee
* *
* @param int $year Year
* @return int
*/ */
function getNbExpeditionByMonth($year) function getNbExpeditionByMonth($year)
{ {
@ -111,6 +121,11 @@ class ExpeditionStats
} }
/**
*
* @param int $year Year
* @return int
*/
function getNbExpeditionByMonthWithPrevYear($year) function getNbExpeditionByMonthWithPrevYear($year)
{ {
$data1 = $this->getNbExpeditionByMonth($year); $data1 = $this->getNbExpeditionByMonth($year);

View File

@ -783,7 +783,7 @@ if ($action == 'create')
// Show subproducts of product // Show subproducts of product
if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0)
{ {
$product->get_sousproduits_arbo (); $product->get_sousproduits_arbo();
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom); $prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
if(count($prods_arbo) > 0) if(count($prods_arbo) > 0)
{ {