This commit is contained in:
Laurent Destailleur 2012-02-04 14:39:47 +01:00
parent ac1c91b740
commit ffac9689f4
23 changed files with 401 additions and 407 deletions

View File

@ -1,76 +0,0 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/lib/accountancy.lib.php
* \brief Library of accountancy functions
*/
/**
* @param $db
* @param $year
* @param $socid
*/
function get_ca_propal ($db, $year, $socid)
{
$sql = "SELECT sum(f.price - f.remise) as sum FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = '".$year."'";
if ($socid)
{
$sql .= " AND f.fk_soc = $socid";
}
$result = $db->query($sql);
if ($result)
{
$res = $db->fetch_object($result);
return $res->sum;
}
else
{
return 0;
}
}
function get_ca ($db, $year, $socid)
{
global $conf;
$sql = "SELECT sum(f.amount) as sum FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.fk_statut in (1,2)";
if ($conf->global->COMPTA_MODE != 'CREANCES-DETTES')
{
$sql .= " AND f.paye = 1";
}
$sql .= " AND date_format(f.datef , '%Y') = '".$year."'";
if ($socid)
{
$sql .= " AND f.fk_soc = $socid";
}
$result = $db->query($sql);
if ($result)
{
$res = $db->fetch_object($result);
return $res->sum;
}
else
{
return 0;
}
}

View File

@ -420,7 +420,8 @@ function actions_prepare_head($object)
/**
* Define head array for tabs of agenda setup pages
*
* @return Array of head
* @param string $param Parameters to add to url
* @return array Array of head
*/
function calendars_prepare_head($param)
{

View File

@ -26,15 +26,15 @@
/**
* Get value of an HTML field, do Ajax process and show result
*
* @param selected Preselecte value
* @param htmlname HTML name of input field
* @param url Url for request: /chemin/fichier.php
* @param option More parameters on URL request
* @param minLength Minimum number of chars to trigger that Ajax search
* @param autoselect Automatic selection if just one value
* @return string script complet
* @param string $selected Preselecte value
* @param string $htmlname HTML name of input field
* @param string $url Url for request: /chemin/fichier.php
* @param string $option More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
* @return string Script
*/
function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2,$autoselect=0)
function ajax_autocompleter($selected,$htmlname,$url,$option='',$minLength=2,$autoselect=0)
{
if (empty($minLength)) $minLength=1;
@ -84,13 +84,13 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2,
/**
* Get value of field, do Ajax process and return result
*
* @param htmlname nom et id du champ
* @param fields other fields to autocomplete
* @param url chemin du fichier de reponse : /chemin/fichier.php
* @param option More parameters on URL request
* @param minLength Minimum number of chars to trigger that Ajax search
* @param autoselect Automatic selection if just one value
* @return string script complet
* @param string $htmlname Name of field
* @param string $fields other fields to autocomplete
* @param string $url Chemin du fichier de reponse : /chemin/fichier.php
* @param string $option More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
* @return string Script
*/
function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,$autoselect=0)
{
@ -163,10 +163,12 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,
/**
* Show an ajax dialog
* @param title Title of dialog box
* @param message Message of dialog box
* @param w Width of dialog box
* @param h height of dialog box
*
* @param string $title Title of dialog box
* @param string $message Message of dialog box
* @param int $w Width of dialog box
* @param int $h height of dialog box
* @return void
*/
function ajax_dialog($title,$message,$w=350,$h=150)
{
@ -199,8 +201,8 @@ function ajax_dialog($title,$message,$w=350,$h=150)
/**
* Convert a select html field into an ajax combobox
*
* @param htmlname Name of html field
* @return string Return html string to convert a select field into a combo
* @param string $htmlname Name of html field
* @return string Return html string to convert a select field into a combo
*/
function ajax_combobox($htmlname)
{

View File

@ -84,8 +84,9 @@ function bank_prepare_head($object)
/**
* Check account number informations for a bank account
* @param account A bank account
* @return int True if informations are valid, false otherwise
*
* @param Account $account A bank account
* @return int True if informations are valid, false otherwise
*/
function checkBanForAccount($account)
{
@ -131,7 +132,7 @@ function checkBanForAccount($account)
{
$CCC = strtolower(trim($account->number));
$rib = strtolower(trim($account->code_banque).trim($account->code_guichet));
$cle_rib=strtolower(CheckES($rib,$CCC));
$cle_rib=strtolower(checkES($rib,$CCC));
if ($cle_rib == strtolower($account->cle))
{
return true;
@ -159,13 +160,16 @@ function checkBanForAccount($account)
/**
* Returns the key for Spanish Banks Accounts
* @return string Key
*
* @param string $IentOfi IentOfi
* @param string $InumCta InumCta
* @return string Key
*/
function CheckES($IentOfi,$InumCta)
function checkES($IentOfi,$InumCta)
{
if (empty($IentOfi)||empty($InumCta)||strlen($IentOfi)!=8||strlen($InumCta)!=10)
{
$keycontrol ="";
{
$keycontrol ="";
return $keycontrol;
}
@ -178,29 +182,29 @@ function CheckES($IentOfi,$InumCta)
{
if (strpos($numbers,substr($ccc,$i,1)) === false)
{
$keycontrol ="";
$keycontrol ="";
return $keycontrol;
}
$i++;
}
}
$values = array(1,2,4,8,5,10,9,7,3,6);
$sum = 0;
$sum = 0;
for($i=2; $i<10; $i++)
{
$sum += $values[$i] * substr($IentOfi, $i-2, 1);
}
}
$key = 11-$sum%11;
if ($key==10) $key=1;
if ($key==11) $key=0;
if ($key==11) $key=0;
$keycontrol = $key;
$sum = 0;
$sum = 0;
for($i=0; $i<11; $i++)
@ -211,9 +215,9 @@ function CheckES($IentOfi,$InumCta)
$key = 11-$sum%11;
if ($key==10) $key=1;
if ($key==11) $key=0;
if ($key==11) $key=0;
$keycontrol .= $key;
$keycontrol .= $key;
return $keycontrol;
}

View File

@ -58,14 +58,15 @@ else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
/**
* barcode_print(code [, encoding [, scale [, mode ]]] );
* Print barcode
*
* encodes and prints a barcode
* @param string $code Code
* @param string $encoding Encoding
* @param string $scale Scale
* @param string $mode 'png' or 'jpg' ...
*
* return:
* array[encoding] : the encoding which has been used
* array[bars] : the bars
* array[text] : text-positioning info
*
* @return array $bars array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
*/
function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
{
@ -90,9 +91,7 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
}
/**
* barcode_encode(code, encoding)
* encodes $code with $encoding using genbarcode OR built-in encoder
* if you don't have genbarcode only EAN-13/ISBN is possible
* Encodes $code with $encoding using genbarcode OR built-in encoder if you don't have genbarcode only EAN-13/ISBN is possible
*
* You can use the following encodings (when you have genbarcode):
* ANY choose best-fit (default)
@ -109,10 +108,9 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
* MSI MSI (by Leonid A. Broukhis)
* PLS Plessey (by Leonid A. Broukhis)
*
* return:
* array[encoding] : the encoding which has been used
* array[bars] : the bars
* array[text] : text-positioning info
* @param string $code Code
* @param string $encoding Encoding
* @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
*/
function barcode_encode($code,$encoding)
{
@ -159,25 +157,10 @@ function barcode_encode($code,$encoding)
/**
* Built-In Encoders
* Part of PHP-Barcode 0.3pl1
* Calculate EAN sum
*
* (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
*
* The newest version can be found at http://www.ashberg.de/bar
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* @param string $ean EAN to encode
* @return string Sum
*/
function barcode_gen_ean_sum($ean)
{
@ -192,13 +175,11 @@ function barcode_gen_ean_sum($ean)
}
/**
* barcode_encode_ean(code [, encoding])
* encodes $ean with EAN-13 using builtin functions
* Encode EAN
*
* return:
* array[encoding] : the encoding which has been used (EAN-13)
* array[bars] : the bars
* array[text] : text-positioning info
* @param string $ean Code
* @param string $encoding Encoding
* @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
*/
function barcode_encode_ean($ean, $encoding = "EAN-13")
{
@ -254,13 +235,11 @@ function barcode_encode_ean($ean, $encoding = "EAN-13")
}
/**
* barcode_encode_genbarcode(code, encoding)
* encodes $code with $encoding using genbarcode
* Encode result of genbarcode command
*
* return:
* array[encoding] : the encoding which has been used
* array[bars] : the bars
* array[text] : text-positioning info
* @param string $code Code
* @param string $encoding Encoding
* @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
*/
function barcode_encode_genbarcode($code,$encoding)
{

View File

@ -26,22 +26,23 @@
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param string $type Type of category
* @return array Array of tabs to shoc
*/
function categories_prepare_head($object,$type)
{
global $langs, $conf, $user;
$langs->load("categories");
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&amp;type='.$type;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/categories/photos.php?id='.$object->id.'&amp;type='.$type;
$head[$h][1] = $langs->trans("Photos");
$head[$h][2] = 'photos';

View File

@ -379,11 +379,12 @@ function getFormeJuridiqueLabel($code)
/**
* Show html area for list of projects
*
* @param conf Object conf
* @param langs Object langs
* @param db Database handler
* @param object Third party object
* @param backtopage Url to go once contact is created
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Database handler
* @param Object $object Third party object
* @param string $backtopage Url to go once contact is created
* @return void
*/
function show_projects($conf,$langs,$db,$object,$backtopage='')
{
@ -482,6 +483,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
* @param DoliDB $db Database handler
* @param Object $object Third party object
* @param string $backtopage Url to go once contact is created
* @return void
*/
function show_contacts($conf,$langs,$db,$object,$backtopage='')
{
@ -594,12 +596,14 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
/**
* Show html area with actions to do
* @param conf Object conf
* @param langs Object langs
* @param db Object db
* @param object Object third party
* @param objcon Object contact
* @param noprint Return string but does not output it
*
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Object db
* @param Object $object Object third party
* @param Contact $objcon Object contact
* @param int $noprint Return string but does not output it
* @return void
*/
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
@ -741,12 +745,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
/**
* Show html area with actions done
*
* @param conf Object conf
* @param langs Object langs
* @param db Object db
* @param object Object third party
* @param objcon Object contact
* @param noprint Return string but does not output it
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Object db
* @param Object $object Object third party
* @param Contact $objcon Object contact
* @param int $noprint Return string but does not output it
* @return void
*/
function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
@ -974,10 +979,12 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
/**
* Show html area for list of subsidiaries
* @param conf Object conf
* @param langs Object langs
* @param db Database handler
* @param object Third party object
*
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Database handler
* @param Societe $object Third party object
* @return void
*/
function show_subsidiaries($conf,$langs,$db,$object)
{

View File

@ -115,12 +115,13 @@ function dol_time_plus_duree($time,$duration_value,$duration_unit)
}
/** Convert hours and minutes into seconds
/**
* Convert hours and minutes into seconds
*
* @param int $iHours Heures
* @param int $iMinutes Minutes
* @param int $iSeconds Secondes
* @return int $iResult Temps en secondes
* @param int $iHours Hours
* @param int $iMinutes Minutes
* @param int $iSeconds Seconds
* @return int Time into seconds
*/
function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
{
@ -697,7 +698,7 @@ function num_open_day($timestampStart, $timestampEnd,$inhour=0,$lastday=0)
/**
* Return array of translated months or selected month
*
* @param Translate $outputlangs Object langs
* @param Translate $outputlangs Object langs
* @return array Month string or array if selected < 0
*/
function monthArray($outputlangs)

View File

@ -23,13 +23,19 @@
*/
function ecm_prepare_head($obj)
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$obj->id;
$head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
@ -37,13 +43,19 @@ function ecm_prepare_head($obj)
return $head;
}
function ecm_file_prepare_head($obj)
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_file_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$obj->section_id.'&urlfile='.urlencode($obj->label);
$head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
@ -51,7 +63,13 @@ function ecm_file_prepare_head($obj)
return $head;
}
function ecm_prepare_head_fm($fac)
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head_fm($object)
{
global $langs, $conf;
$h = 0;

View File

@ -350,7 +350,7 @@ function dol_dir_is_emtpy($folder)
if (is_dir($newfolder))
{
$handle = opendir($newfolder);
while ((gettype( $name = readdir($handle)) != "boolean"))
while ((gettype($name = readdir($handle)) != "boolean"))
{
$name_array[] = $name;
}
@ -423,11 +423,12 @@ function dol_filemtime($pathoffile)
/**
* Copy a file to another file
* @param $srcfile Source file (can't be a directory)
* @param $destfile Destination file (can't be a directory)
* @param $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
* @param $overwriteifexists Overwrite file if exists (1 by default)
* @return boolean True if OK, false if KO
*
* @param string $srcfile Source file (can't be a directory)
* @param string $destfile Destination file (can't be a directory)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @return boolean True if OK, false if KO
*/
function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
{
@ -682,10 +683,11 @@ function dol_delete_dir($dir,$nophperrors=0)
/**
* Remove a directory $dir and its subdirectories
* @param dir Dir to delete
* @param count Counter to count nb of deleted elements
* @param nophperrors Disable all PHP output errors
* @return int Number of files and directory removed
*
* @param string $dir Dir to delete
* @param int $count Counter to count nb of deleted elements
* @param int $nophperrors Disable all PHP output errors
* @return int Number of files and directory removed
*/
function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0)
{
@ -978,8 +980,9 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* Convert an image file into antoher format.
* This need Imagick php extension.
*
* @param string $file Input file name
* @param string $ext Extension of target file
* @param string $file Input file name
* @param string $ext Extension of target file
* @return int <0 if KO, >0 if OK
*/
function dol_convert_file($file,$ext='png')
{
@ -1012,9 +1015,10 @@ function dol_convert_file($file,$ext='png')
/**
* Compress a file
*
* @param string $inputfile Source file name
* @param string $outputfile Target file name
* @param string $mode 'gz' or 'bz'
* @param string $inputfile Source file name
* @param string $outputfile Target file name
* @param string $mode 'gz' or 'bz'
* @return int <0 if KO, >0 if OK
*/
function dol_compress_file($inputfile, $outputfile, $mode="gz")
{

View File

@ -2498,10 +2498,12 @@ function restrictedArea($user, $features='societe', $objectid=0, $dbtablename=''
/**
* Show a message to say access is forbidden and stop program
* Calling this function terminate execution of PHP.
* @param message Force error message
* @param printheader Show header before
* @param printfooter Show footer after
* @param showonlymessage Show only message parameter. Otherwise add more information.
*
* @param string $message Force error message
* @param int $printheader Show header before
* @param int $printfooter Show footer after
* @param int $showonlymessage Show only message parameter. Otherwise add more information.
* @return void
*/
function accessforbidden($message='',$printheader=1,$printfooter=1,$showonlymessage=0)
{
@ -2552,9 +2554,11 @@ function dolibarr_print_error($db='',$error='')
* On doit appeler cette fonction quand une erreur technique bloquante est rencontree.
* Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant
* renvoyer leur erreur par l'intermediaire de leur propriete "error".
* @param db Database handler
* @param error String or array of errors strings to show
* @see dol_htmloutput_errors
*
* @param DoliDB $db Database handler
* @param string $error String or array of errors strings to show
* @return void
* @see dol_htmloutput_errors
*/
function dol_print_error($db='',$error='')
{
@ -2665,6 +2669,8 @@ function dol_print_error($db='',$error='')
/**
* Show email to contact if technical error
*
* @reutnr void
*/
function dol_print_error_email()
{
@ -2677,14 +2683,15 @@ function dol_print_error_email()
/**
* Show title line of an array
*
* @param name Label of field
* @param file Url used when we click on sort picto
* @param field Field to use for new sorting
* @param begin ("" by defaut)
* @param moreparam Add more parameters on sort url links ("" by default)
* @param td Options of attribute td ("" by defaut)
* @param sortfield Current field used to sort
* @param sortorder Current sort order
* @param string $name Label of field
* @param string $file Url used when we click on sort picto
* @param string $field Field to use for new sorting
* @param string $begin ("" by defaut)
* @param string $moreparam Add more parameters on sort url links ("" by default)
* @param string $td Options of attribute td ("" by defaut)
* @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order
* @return void
*/
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="")
{
@ -2694,15 +2701,16 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
/**
* Get title line of an array
*
* @param name Label of field
* @param thead For thead format
* @param file Url used when we click on sort picto
* @param field Field to use for new sorting
* @param begin ("" by defaut)
* @param moreparam Add more parameters on sort url links ("" by default)
* @param moreattrib Add more attributes on th ("" by defaut)
* @param sortfield Current field used to sort
* @param sortorder Current sort order
* @param string $name Label of field
* @param int $thead For thead format
* @param string $file Url used when we click on sort picto
* @param string $field Field to use for new sorting
* @param string $begin ("" by defaut)
* @param string $moreparam Add more parameters on sort url links ("" by default)
* @param string $moreattrib Add more attributes on th ("" by defaut)
* @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order
* @return void
*/
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="")
{
@ -2763,11 +2771,13 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
/**
* Show a title (deprecated. use print_fiche_titre instrad)
* @param titre Title to show
*
* @param string $title Title to show
* @return string Title to show
*/
function print_titre($titre)
function print_titre($title)
{
print '<div class="titre">'.$titre.'</div>';
print '<div class="titre">'.$title.'</div>';
}
/**
@ -3429,10 +3439,11 @@ function yn($yesno, $case=1, $color=0)
* Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
*
* @param $num Id to develop
* @param $level Level of development (1, 2 or 3 level)
* @param $alpha Use alpha ref
* @param withoutslash 0=With slash at end, 1=without slash at end
* @param string $num Id to develop
* @param int $level Level of development (1, 2 or 3 level)
* @param int $alpha Use alpha ref
* @param int $withoutslash 0=With slash at end, 1=without slash at end
* @return string Dir to use
*/
function get_exdir($num,$level=3,$alpha=0,$withoutslash=0)
{
@ -4092,7 +4103,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* or descending output and uses optionally natural case insensitive sorting (which
* can be optionally case sensitive as well).
*
* @param array $array Array to sort
* @param array &$array Array to sort
* @param string $index Key in array to use for sorting criteria
* @param int $order Sort order
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard sort (asort)
@ -4305,7 +4316,7 @@ function picto_from_langcode($codelang)
* @param Translate $langs Object langs
* @param Object $object Object object
* @param array $head Object head
* @param int $h New position to fill
* @param int &$h New position to fill
* @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view
* 'intervention' to add a tab in intervention view

View File

@ -94,6 +94,7 @@ function dol_print_file($langs,$filename,$searchalt=0)
* Show informations on an object
*
* @param object Objet to show
* @return void
*/
function dol_print_object_info($object)
{
@ -218,8 +219,8 @@ function dol_print_object_info($object)
/**
* Return true if email has a domain name that can't be resolved
*
* @param mail adresse email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean true if domain email is OK, false if KO
* @param string $mail Email address (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean True if domain email is OK, False if KO
*/
function isValidMailDomain($mail)
{
@ -239,14 +240,14 @@ function isValidMailDomain($mail)
* Url string validation
* <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor]
*
* @param url Url
* @param http 1: verify http, 0: not verify http
* @param pass 1: verify user and pass, 0: not verify user and pass
* @param port 1: verify port, 0: not verify port
* @param path 1: verify path, 0: not verify path
* @param query 1: verify query, 0: not verify query
* @param anchor 1: verify anchor, 0: not verify anchor
* @return int 1=Check is OK, 0=Check is KO
* @param string $url Url
* @param int $http 1: verify http, 0: not verify http
* @param int $pass 1: verify user and pass, 0: not verify user and pass
* @param int $port 1: verify port, 0: not verify port
* @param int $path 1: verify path, 0: not verify path
* @param int $query 1: verify query, 0: not verify query
* @param int $anchor 1: verify anchor, 0: not verify anchor
* @return int 1=Check is OK, 0=Check is KO
*/
function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
{
@ -288,9 +289,9 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
/**
* Clean an url string
*
* @param url Url
* @param http 1: keep http://, 0: remove also http://
* @return string Cleaned url
* @param string $url Url
* @param string $http 1: keep http://, 0: remove also http://
* @return string Cleaned url
*/
function clean_url($url,$http=1)
{
@ -328,8 +329,14 @@ function clean_url($url,$http=1)
/**
* Return lines of an html table from an array
* Used by array2table function only
*
* @param array $data Array of data
* @param string $troptions Options for tr
* @param string $tdoptions Options for td
* @return string
*/
function array2tr($data,$troptions='',$tdoptions=''){
function array2tr($data,$troptions='',$tdoptions='')
{
$text = '<tr '.$troptions.'>' ;
foreach($data as $key => $item){
$text.= '<td '.$tdoptions.'>'.$item.'</td>' ;
@ -340,8 +347,15 @@ function array2tr($data,$troptions='',$tdoptions=''){
/**
* Return an html table from an array
*
* @param array $data Array of data
* @param int $tableMarkup Table markup
* @param string $troptions Options for tr
* @param string $tdoptions Options for td
* @return string
*/
function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdoptions=''){
function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdoptions='')
{
$text='' ;
if($tableMarkup) $text = '<table '.$tableoptions.'>' ;
foreach($data as $key => $item){
@ -362,15 +376,15 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/**
* Return next value for a mask
*
* @param $db Database handler
* @param $mask Mask to use
* @param $table Table containing field with counter
* @param $field Field containing already used values of counter
* @param $where To add a filter on selection (for exemple to filter on invoice types)
* @param $objsoc The company that own the object we need a counter for
* @param $date Date to use for the {y},{m},{d} tags.
* @param $mode 'next' for next value or 'last' for last value
* @return string New value
* @param DoliSB $db Database handler
* @param string $mask Mask to use
* @param string $table Table containing field with counter
* @param string $field Field containing already used values of counter
* @param string $where To add a filter on selection (for exemple to filter on invoice types)
* @param Societe $objsoc The company that own the object we need a counter for
* @param string $date Date to use for the {y},{m},{d} tags.
* @param string $mode 'next' for next value or 'last' for last value
* @return string New value
*/
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
{
@ -761,8 +775,8 @@ function binhex($bin, $pad=false, $upper=false)
/**
* Convert an hexadecimal string into a binary string
*
* @param hexa Hexadecimal string to convert (example: 'FF')
* @return string bin
* @param string $hexa Hexadecimal string to convert (example: 'FF')
* @return string bin
*/
function hexbin($hexa)
{
@ -779,8 +793,8 @@ function hexbin($hexa)
/**
* Retourne le numero de la semaine par rapport a une date
*
* @param time Date au format 'timestamp'
* @return int Numero de semaine
* @param string $time Date au format 'timestamp'
* @return int Number of week
*/
function numero_semaine($time)
{
@ -861,10 +875,10 @@ function numero_semaine($time)
/**
* Convertit une masse d'une unite vers une autre unite
*
* @param weight float Masse a convertir
* @param from_unit int Unite originale en puissance de 10
* @param to_unit int Nouvelle unite en puissance de 10
* @return float Masse convertie
* @param float $weight Masse a convertir
* @param int &$from_unit Unite originale en puissance de 10
* @param int $to_unit Nouvelle unite en puissance de 10
* @return float Masse convertie
*/
function weight_convert($weight,&$from_unit,$to_unit)
{
@ -896,11 +910,11 @@ function weight_convert($weight,&$from_unit,$to_unit)
/**
* Save personnal parameter
*
* @param db Handler database
* @param conf Object conf
* @param user Object user
* @param tab Tableau (cle=>valeur) des parametres a sauvegarder
* @return int <0 if KO, >0 if OK
* @param DoliDB $db Handler database
* @param Conf $conf Object conf
* @param User $user Object user
* @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder
* @return int <0 if KO, >0 if OK
*
* @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const
*/
@ -968,11 +982,11 @@ function dol_set_user_param($db, $conf, &$user, $tab)
/**
* Returns formated reduction
*
* @param reduction Reduction percentage
* @param langs Output language
* @return string Formated reduction
* @param int $reduction Reduction percentage
* @param Translate $langs Output language
* @return string Formated reduction
*/
function dol_print_reduction($reduction=0,$langs)
function dol_print_reduction($reduction,$langs)
{
$string = '';
if ($reduction == 100)
@ -1035,10 +1049,10 @@ function version_webserver()
/**
* Return list of activated modules usable for document generation
*
* @param $db Database handler
* @param $type Type of models (company, invoice, ...)
* @param $maxfilenamelength Max length of value to show
* @return int or array 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename".
* @param DoliDB $db Database handler
* @param string $type Type of models (company, invoice, ...)
* @param int $maxfilenamelength Max length of value to show
* @return mixed 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename".
*/
function getListOfModels($db,$type,$maxfilenamelength=0)
{
@ -1140,9 +1154,9 @@ function is_ip($ip)
/**
* Build a login from lastname, firstname
*
* @param lastname Lastname
* @param firstname Firstname
* @return string
* @param string $lastname Lastname
* @param string $firstname Firstname
* @return string Login
*/
function dol_buildlogin($lastname,$firstname)
{

View File

@ -25,8 +25,9 @@
/**
* Return if a BVRB number is valid or not (For switzerland)
* @param bvrb BVRB number
* @return bool True if OK, false if KO
*
* @param string $bvrb BVRB number
* @return boolean True if OK, false if KO
*/
function dol_ch_controle_bvrb($bvrb)
{

View File

@ -31,8 +31,9 @@ $quality = 80;
/**
* Return if a filename is file name of a supported image format
* @param file Filename
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported
*
* @param string $file Filename
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported
*/
function image_format_supported($file)
{
@ -62,8 +63,9 @@ function image_format_supported($file)
/**
* Return size of image file on disk (Supported extensions are gif, jpg, png and bmp)
* @param $file Full path name of file
* @return Array array('width'=>width, 'height'=>height)
*
* @param string $file Full path name of file
* @return array array('width'=>width, 'height'=>height)
*/
function dol_getImageSize($file)
{
@ -84,13 +86,14 @@ function dol_getImageSize($file)
/**
* Resize or crop an image file (Supported extensions are gif, jpg, png and bmp)
* @param file Path of file to resize/crop
* @param mode 0=Resize, 1=Crop
* @param newWidth Largeur maximum que dois faire l'image destination (0=keep ratio)
* @param newHeight Hauteur maximum que dois faire l'image destination (0=keep ratio)
* @param src_x Position of croping image in source image (not use if mode=0)
* @param src_y Position of croping image in source image (not use if mode=0)
* @return int File name if OK, error message if KO
*
* @param string $file Path of file to resize/crop
* @param int $mode 0=Resize, 1=Crop
* @param int $newWidth Largeur maximum que dois faire l'image destination (0=keep ratio)
* @param int $newHeight Hauteur maximum que dois faire l'image destination (0=keep ratio)
* @param int $src_x Position of croping image in source image (not use if mode=0)
* @param int $src_y Position of croping image in source image (not use if mode=0)
* @return int File name if OK, error message if KO
*/
function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0)
{
@ -539,11 +542,12 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
/**
* \brief This function returns the html for the moneymeter.
* \param actualValue: amount of actual money
* \param pendingValue: amount of money of pending memberships
* \param intentValue: amount of intended money (that's without the amount of actual money)
* \return thermometer htmlLegenda
* This function returns the html for the moneymeter.
*
* @param int $actualValue amount of actual money
* @param int $pendingValue amount of money of pending memberships
* @param int $intentValue amount of intended money (that's without the amount of actual money)
* @return string thermometer htmlLegenda
*/
function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0)
{

View File

@ -22,6 +22,11 @@
* \ingroup ldap
*/
/**
* Initialize the array of tabs for customer invoice
*
* @return array Array of head tabs
*/
function ldap_prepare_head()
{
global $langs, $conf, $user;
@ -73,7 +78,14 @@ function ldap_prepare_head()
/**
* \brief Show button test LDAP synchro
* Show button test LDAP synchro
*
* @param string $butlabel Label
* @param string $testlabel Label
* @param string $key Key
* @param string $dn Dn
* @param string $objectclass Class
* @return void
*/
function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
{
@ -105,13 +117,13 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
/**
* Show a LDAP array into an HTML output array.
*
* @param $result Array to show. This array is already encoded into charset_output
* @param $level
* @param $count
* @param $var
* @param $hide
* @param $subcount
* @return intr
* @param string $result Array to show. This array is already encoded into charset_output
* @param int $level Level
* @param int $count Count
* @param string $var Var
* @param int $hide Hide
* @param int $subcount Subcount
* @return int
*/
function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0)
{

View File

@ -35,9 +35,9 @@ $shmoffset=100;
/**
* Save data into a memory area shared by all users, all sessions on server
*
* @param $memoryid Memory id of shared area
* @param $data Data to save
* @return int <0 if KO, Nb of bytes written if OK
* @param string $memoryid Memory id of shared area
* @param string $data Data to save
* @return int <0 if KO, Nb of bytes written if OK
*/
function dol_setcache($memoryid,$data)
{
@ -93,8 +93,8 @@ function dol_setcache($memoryid,$data)
/**
* Read a memory area shared by all users, all sessions on server
*
* @param $memoryid Memory id of shared area
* @return int <0 if KO, data if OK
* @param string $memoryid Memory id of shared area
* @return int <0 if KO, data if OK
*/
function dol_getcache($memoryid)
{
@ -154,9 +154,10 @@ function dol_getcache($memoryid)
/**
* \brief Return shared memory address used to store dataset with key memoryid
* \param $memoryid Memory id of shared area
* \return int <0 if KO, Memoy address of shared memory for key
* Return shared memory address used to store dataset with key memoryid
*
* @param string $memoryid Memory id of shared area
* @return int <0 if KO, Memoy address of shared memory for key
*/
function dol_getshmopaddress($memoryid)
{
@ -166,8 +167,9 @@ function dol_getshmopaddress($memoryid)
}
/**
* \brief Return list of contents of all memory area shared
* \return int 0=Nothing is done, <0 if KO, >0 if OK
* Return list of contents of all memory area shared
*
* @return int 0=Nothing is done, <0 if KO, >0 if OK
*/
function dol_listshmop()
{
@ -183,10 +185,11 @@ function dol_listshmop()
}
/**
* \brief Save data into a memory area shared by all users, all sessions on server
* \param $memoryid Memory id of shared area
* \param $data Data to save
* \return int <0 if KO, Nb of bytes written if OK
* Save data into a memory area shared by all users, all sessions on server
*
* @param int $memoryid Memory id of shared area
* @param string $data Data to save
* @return int <0 if KO, Nb of bytes written if OK
*/
function dol_setshmop($memoryid,$data)
{
@ -218,9 +221,10 @@ function dol_setshmop($memoryid,$data)
}
/**
* \brief Read a memory area shared by all users, all sessions on server
* \param $memoryid Memory id of shared area
* \return int <0 if KO, data if OK
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
* @return int <0 if KO, data if OK
*/
function dol_getshmop($memoryid)
{

View File

@ -321,12 +321,12 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
/**
* Show bank informations for PDF generation
*
* @param pdf Object PDF
* @param outputlangs Object lang
* @param curx X
* @param cury Y
* @param account Bank account object
* @param onlynumber Output only number
* @param PDF &$pdf Object PDF
* @param Translate $outputlangs Object lang
* @param int $curx X
* @param int $cury Y
* @param Account $account Bank account object
* @param int $onlynumber Output only number
* @return void
*/
function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
@ -360,7 +360,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$cury+=3;
}
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8 );
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8);
if ($usedetailedbban == 1)
{
@ -384,7 +384,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1);
$curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 );
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
}
if ($val == 'desk')
{
@ -395,7 +395,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1);
$curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 );
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
}
if ($val == 'number')
{
@ -406,7 +406,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1);
$curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 );
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
}
if ($val == 'key')
{
@ -417,7 +417,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1);
$curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 );
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
}
}
@ -469,14 +469,14 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
* Show footer of page for PDF generation
*
* @param PDF &$pdf The PDF factory
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom
* @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom
* @param int $marge_gauche Margin left
* @param int $page_hauteur Page height
* @param Object $object Object shown in PDF
* @param int $showdetails Show company details
* @param int $showdetails Show company details
* @return void
*/
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0)
@ -666,7 +666,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
/**
* Output line description into PDF
*
* @param PDF $pdf PDF object
* @param PDF &$pdf PDF object
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object lang for output
@ -1229,7 +1229,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
* @param HookManager $hookmanager Hook manager instance
* @return void
*/
function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
function pdf_getTotalQty($object,$type,$outputlangs,$hookmanager=false)
{
$total=0;
$nblignes=count($object->lines);
@ -1267,7 +1267,7 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
/**
* Convert a currency code into its symbol
*
* @param PDF $pdf PDF object
* @param PDF &$pdf PDF object
* @param string $currency_code Currency code
* @return string Currency symbol encoded into UTF8
*/

View File

@ -83,6 +83,7 @@ function prelevement_prepare_head($object)
/**
* Check need data to create standigns orders receipt file
*
* @return int -1 if ko 0 if ok
*/
function prelevement_check_config()

View File

@ -256,9 +256,10 @@ function show_stats_for_company($product,$socid)
/**
* Return translation label of a unit key
* @param unit Unit key (-3,0,3,98,99...)
* @param measuring_style Style of unit: weight, volume,...
* @return string Unit string
*
* @param int $unit Unit key (-3,0,3,98,99...)
* @param string $measuring_style Style of unit: weight, volume,...
* @return string Unit string
* @see load_measuring_units
*/
function measuring_units_string($unit,$measuring_style='')

View File

@ -162,17 +162,17 @@ function task_prepare_head($object)
function select_projects($socid=-1, $selected='', $htmlname='projectid')
{
global $db,$user,$conf,$langs;
$hideunselectables = false;
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
$projectsListId = false;
if (empty($user->rights->projet->all->lire))
{
$projectstatic=new Project($db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
}
// On recherche les projets
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
@ -180,7 +180,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
$sql.= " ORDER BY p.title ASC";
dol_syslog("project.lib::select_projects sql=".$sql);
$resql=$db->query($sql);
if ($resql)
@ -221,7 +221,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
}
if ($hideunselectables && $disabled)
{
$resultat='';
@ -257,13 +257,13 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
/**
* Output a task line
*
* @param $inc
* @param $parent
* @param $lines
* @param $level
* @param $projectsrole
* @param $tasksrole
* @param $mytask 0 or 1 to enable only if task is a task i am affected to
* @param string &$inc ?
* @param string $parent ?
* @param Object $lines ?
* @param int &$level ?
* @param string &$projectsrole ?
* @param string &$tasksrole ?
* @param int $mytask 0 or 1 to enable only if task is a task i am affected to
* @return $inc
*/
function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0)
@ -369,20 +369,20 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $
/**
* Show task lines with a particular parent
*
* @param $inc Counter that count number of lines legitimate to show (for return)
* @param $parent Id of parent task to start
* @param $lines Array of all tasks
* @param $level Level of task
* @param $var Color
* @param $showproject Show project columns
* @param $taskrole Array of roles of user for each tasks
* @param $projectsListId List of id of project allowed to user (separated with comma)
* @param string &$inc Counter that count number of lines legitimate to show (for return)
* @param int $parent Id of parent task to start
* @param array &$lines Array of all tasks
* @param int &$level Level of task
* @param string $var Color
* @param int $showproject Show project columns
* @param int &$taskrole Array of roles of user for each tasks
* @param int $projectsListId List of id of project allowed to user (separated with comma)
*/
function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='')
{
global $user, $bc, $langs;
global $projectstatic, $taskstatic;
$lastprojectid=0;
$projectsArrayId=explode(',',$projectsListId);
@ -525,11 +525,12 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
/**
* Search in task lines with a particular parent if there is a task for a particular user (in taskrole)
* @param $inc Counter that count number of lines legitimate to show (for return)
* @param $parent Id of parent task to start
* @param $lines Array of all tasks
* @param $taskrole Array of task filtered on a particular user
* @return int 1 if there is
*
* @param string &$inc Counter that count number of lines legitimate to show (for return)
* @param int $parent Id of parent task to start
* @param array &$lines Array of all tasks
* @param string &$taskrole Array of task filtered on a particular user
* @return int 1 if there is
*/
function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
{
@ -561,8 +562,9 @@ function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
/**
* Clean task not linked to a parent
* @param $db Database handler
* @return int Nb of records deleted
*
* @param DoliDB $db Database handler
* @return int Nb of records deleted
*/
function clean_orphelins($db)
{
@ -618,10 +620,11 @@ function clean_orphelins($db)
/**
* Return HTML table with list of projects and number of opened tasks
*
* @param $db
* @param $socid
* @param $projectsListId Id of project i have permission on
* @param $mytasks Limited to task i am contact to
* @param DoliDB $db Database handler
* @param int $socid Id thirdparty
* @param int $projectsListId Id of project i have permission on
* @param int $mytasks Limited to task i am contact to
* @return void
*/
function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0)
{

View File

@ -35,7 +35,7 @@
* @param array $moreparam Array with list of params to add into form
* @return void
*/
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
{
global $langs, $hselected;

View File

@ -104,12 +104,12 @@ function delivery_prepare_head($object)
/**
* List sendings and receive receipts
*
* @param string $origin Origin
* @param string $origin Origin ('commande', ...)
* @param int $origin_id Origin id
* @param string $filter Filter
* @return int <0 if KO, >0 if OK
*/
function show_list_sending_receive($origin='commande',$origin_id,$filter='')
function show_list_sending_receive($origin,$origin_id,$filter='')
{
global $db, $conf, $langs, $bc;
global $form;

View File

@ -64,14 +64,15 @@ function tax_prepare_head($object)
/**
* Look for collectable VAT clients in the chosen year (and month)
* @param db Database handle
* @param y Year
* @param date_start Start date
* @param date_end End date
* @param modetax 0 or 1 (option vat on debit)
* @param direction 'sell' or 'buy'
* @param m Month
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
*
* @param DoliDB $db Database handle
* @param int $y Year
* @param string $date_start Start date
* @param string $date_end End date
* @param int $modetax 0 or 1 (option vat on debit)
* @param string $direction 'sell' or 'buy'
* @param int $m Month
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
*/
function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction, $m=0)
{
@ -207,19 +208,20 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
/**
* \brief Gets VAT to collect for the given year (and given quarter or month)
* The function gets the VAT in split results, as the VAT declaration asks
* to report the amounts for different VAT rates as different lines.
* This function also accounts recurrent invoices
* \param db Database handler object
* \param y Year
* \param q Quarter
* \param date_start Start date
* \param date_end End date
* \param modetax 0 or 1 (option vat on debit)
* \param direction 'sell' (customer invoice) or 'buy' (supplier invoices)
* \param m Month
* \return array List of quarters with vat
* Gets VAT to collect for the given year (and given quarter or month)
* The function gets the VAT in split results, as the VAT declaration asks
* to report the amounts for different VAT rates as different lines.
* This function also accounts recurrent invoices.
*
* @param DoliDB $db Database handler object
* @param int $y Year
* @param int $q Quarter
* @param string $date_start Start date
* @param string $date_end End date
* @param int $modetax 0 or 1 (option vat on debit)
* @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices)
* @param int $m Month
* @return array List of quarters with vat
*/
function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0)
{