Merge pull request #71 from simnandez/develop

Qual: Uniformize code
This commit is contained in:
Regis Houssin 2011-12-16 06:32:58 -08:00
commit 9b28dc5915
3 changed files with 73 additions and 47 deletions

View File

@ -46,11 +46,10 @@ class CommandeStats extends Stats
/**
* Constructor
*
* @param $DB Database handler
* @param $socid Id third party for filter
* @param $mode Option
* @param $userid Id user for filter
* @return CommandeStats
* @param DoliDB $DB Database handler
* @param int $socid Id third party for filter
* @param string $mode Option
* @param int $userid Id user for filter
*/
function CommandeStats($DB, $socid=0, $mode, $userid=0)
{
@ -88,8 +87,10 @@ class CommandeStats extends Stats
}
/**
* \brief Renvoie le nombre de commande par mois pour une annee donnee
*
* Return orders number by month for a year
*
* @param int $year year for stats
* @return array array with number by month
*/
function getNbByMonth($year)
{
@ -108,7 +109,9 @@ class CommandeStats extends Stats
}
/**
* Renvoie le nombre de commande par annee
* Return orders number by year
*
* @return array array with number by year
*
*/
function getNbByYear()
@ -127,8 +130,10 @@ class CommandeStats extends Stats
}
/**
* Renvoie le nombre de commande par mois pour une annee donnee
* Return the orders amount by month for a year
*
* @param int $year year for stats
* @return array array with number by month
*/
function getAmountByMonth($year)
{
@ -147,8 +152,10 @@ class CommandeStats extends Stats
}
/**
* Renvoie le nombre de commande par mois pour une annee donnee
* Return the orders amount average by month for a year
*
* @param int $year year for stats
* @return array array with number by month
*/
function getAverageByMonth($year)
{
@ -166,10 +173,10 @@ class CommandeStats extends Stats
return $this->_getAverageByMonth($year, $sql);
}
/**
* \brief Return nb, total and average
* \return array Array of values
* Return nb, total and average
*
* @return array Array of values
*/
function getAllByYear()
{

View File

@ -275,8 +275,11 @@ class Expedition extends CommonObject
}
/**
*
*
* Create a expedition line
*
* @param int $entrepot_id Id of warehouse
* @param int $origin_line_id Id of source line
* @param int $qty Quantity
*/
function create_line($entrepot_id, $origin_line_id, $qty)
{
@ -617,8 +620,11 @@ class Expedition extends CommonObject
}
/**
* Ajoute une ligne
*
* Add a expedition line
*
* @param int $entrepot_id Id of warehouse
* @param int $id Id of source line
* @param int $qty Quantity
*/
function addline( $entrepot_id, $id, $qty )
{
@ -633,8 +639,10 @@ class Expedition extends CommonObject
}
/**
*
*
* Delete line
*
* @param int $lineid Id line of order
* TODO Voir si cette function est utilisee
*/
function deleteline($lineid)
{
@ -763,7 +771,7 @@ class Expedition extends CommonObject
/**
* Delete shipping
*
* @return void
* @return int >0 if OK otherwise if KO
*/
function delete()
{
@ -851,7 +859,7 @@ class Expedition extends CommonObject
/**
* Load lines
*
* @return void
* @return int >0 if OK, Otherwise if KO
*/
function fetch_lines()
{
@ -910,11 +918,14 @@ class Expedition extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Chaine avec URL
*/
* Return clicable link of object (with eventually picto)
*
* @param int $withpicto Add picto into link
* @param int $option Where point the link
* @param int $max Max length to show
* @param int $short Use short labels
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{
global $langs;
@ -936,12 +947,13 @@ class Expedition extends CommonObject
$result.=$linkstart.$this->ref.$linkend;
return $result;
}
/**
* Retourne le libelle du statut d'une expedition
*
* @return string Libelle
*/
* Return status 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 Libelle
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->statut,$mode);
@ -1062,11 +1074,11 @@ class Expedition extends CommonObject
}
/**
* Set the planned delivery date
* Set the planned delivery date
*
* @param user Objet utilisateur qui modifie
* @param date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
* @param User $user Objet utilisateur qui modifie
* @param timestamp date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
*/
function set_date_livraison($user, $date_livraison)
{
@ -1097,9 +1109,9 @@ class Expedition extends CommonObject
}
/**
* 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
* @return void
*/
function fetch_delivery_methods()
{
@ -1123,9 +1135,10 @@ class Expedition extends CommonObject
}
/**
* Get tracking url status
*
* @return void
*
* Get tracking url status
*
* @param string $value
*/
function GetUrlTrackingStatus($value='')
{
@ -1194,7 +1207,11 @@ class ExpeditionLigne
var $product_desc; // Description produit
var $ref;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function ExpeditionLigne($DB)
{
$this->db=$DB;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* it under the terms of the GNU General Public License as published by
@ -41,9 +42,9 @@ class ExpeditionStats
}
/**
* Renvoie le nombre de expedition par annee
* Return expedition number by year
*
* @return void
* @return array array with number by year
*/
function getNbExpeditionByYear()
{
@ -74,10 +75,10 @@ class ExpeditionStats
}
/**
* Renvoie le nombre de expedition par mois pour une annee donnee
* Return the expeditions number by month for a year
*
* @param int $year Year
* @return int
* @return array Array with number by month
*/
function getNbExpeditionByMonth($year)
{
@ -122,9 +123,10 @@ class ExpeditionStats
/**
* Return the expeditions number by month for a year
*
* @param int $year Year
* @return int
* @param int $year Year
* @return array Array with number by month
*/
function getNbExpeditionByMonthWithPrevYear($year)
{