Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a8057bc475
@ -268,6 +268,8 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Set status to draft
|
||||
*
|
||||
* @param User $user User that set draft
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setDraft($user)
|
||||
@ -302,8 +304,9 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
function setValid($user, $outputdir)
|
||||
@ -360,6 +363,7 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Set intervetnion as billed
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function setBilled()
|
||||
@ -385,8 +389,8 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @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 getLibStatut($mode=0)
|
||||
{
|
||||
@ -395,9 +399,10 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return string Label
|
||||
*
|
||||
* @param int $statut id statut
|
||||
* @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)
|
||||
{
|
||||
@ -439,8 +444,9 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -465,8 +471,9 @@ class Fichinter extends CommonObject
|
||||
/**
|
||||
* Returns the next non used reference of intervention
|
||||
* 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)
|
||||
{
|
||||
@ -512,7 +519,8 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -561,7 +569,8 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Delete intervetnion
|
||||
* @param user Object user who deletes
|
||||
*
|
||||
* @param User $user Object user who deletes
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
@ -658,9 +667,10 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Defines a delivery date of intervention
|
||||
* @param user Object user who define
|
||||
* @param date_delivery date of delivery
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*
|
||||
* @param User $user Object user who define
|
||||
* @param date $date_delivery date of delivery
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function set_date_delivery($user, $date_delivery)
|
||||
{
|
||||
@ -690,9 +700,10 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Define the label of the intervention
|
||||
* @param user Object user who modify
|
||||
* @param description description
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*
|
||||
* @param User $user Object user who modify
|
||||
* @param string $description description
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function set_description($user, $description)
|
||||
{
|
||||
@ -722,11 +733,12 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Adding a line of intervention into data base
|
||||
* @param fichinterid Id of intervention
|
||||
* @param desc Line description
|
||||
* @param date_intervention Intervention date
|
||||
* @param duration Intervention duration
|
||||
* @return int >0 if ok, <0 if ko
|
||||
*
|
||||
* @param int $fichinterid Id of intervention
|
||||
* @param string $desc Line description
|
||||
* @param date $date_intervention Intervention date
|
||||
* @param int $duration Intervention duration
|
||||
* @return int >0 if ok, <0 if ko
|
||||
*/
|
||||
function addline($fichinterid, $desc, $date_intervention, $duration)
|
||||
{
|
||||
@ -800,6 +812,7 @@ class Fichinter extends CommonObject
|
||||
|
||||
/**
|
||||
* Load array lines
|
||||
*
|
||||
* @return int <0 if Ko, >0 if OK
|
||||
*/
|
||||
function fetch_lines()
|
||||
@ -862,8 +875,8 @@ class FichinterLigne
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur d'objets ligne d'intervention
|
||||
* \param DB handler d'acces base de donnee
|
||||
* Constructeur d'objets ligne d'intervention
|
||||
* @param DoliDB $DB handler d'acces base de donnee
|
||||
*/
|
||||
function FichinterLigne($DB)
|
||||
{
|
||||
@ -872,7 +885,8 @@ class FichinterLigne
|
||||
|
||||
/**
|
||||
* Retrieve the line of intervention
|
||||
* @param rowid line id
|
||||
*
|
||||
* @param int $rowid line id
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
@ -906,6 +920,7 @@ class FichinterLigne
|
||||
|
||||
/**
|
||||
* Insert the line into database
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function insert()
|
||||
@ -973,6 +988,7 @@ class FichinterLigne
|
||||
|
||||
/**
|
||||
* Update intervention into database
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function update()
|
||||
@ -1016,6 +1032,7 @@ class FichinterLigne
|
||||
|
||||
/**
|
||||
* Update total duration into llx_fichinter
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function update_total()
|
||||
@ -1067,6 +1084,7 @@ class FichinterLigne
|
||||
|
||||
/**
|
||||
* Delete a intervention line
|
||||
*
|
||||
* @return int >0 if ok, <0 if ko
|
||||
*/
|
||||
function deleteline()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
@ -101,11 +102,13 @@ class Fournisseur extends Societe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Cree la commande au statut brouillon
|
||||
* \param user Utilisateur qui cree
|
||||
* \return int <0 si ko, id de la commande creee si ok
|
||||
*/
|
||||
/**
|
||||
* Create the order from an existing
|
||||
*
|
||||
* @param User $user Creator user
|
||||
* @param int $idc Id source
|
||||
* @param int $comclientid Id thirdparty
|
||||
*/
|
||||
function updateFromCommandeClient($user, $idc, $comclientid)
|
||||
{
|
||||
$comm = new CommandeFournisseur($this->db);
|
||||
@ -115,9 +118,10 @@ class Fournisseur extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Cree la commande au statut brouillon
|
||||
* \param user Utilisateur qui cree
|
||||
* \return int <0 si ko, id de la commande creee si ok
|
||||
* Create the order with draft status
|
||||
|
||||
* @param User $user Creator user
|
||||
* @return int <0 if ko, id of order if ok
|
||||
*/
|
||||
function create_commande($user)
|
||||
{
|
||||
@ -183,9 +187,9 @@ class Fournisseur extends Societe
|
||||
/**
|
||||
* Create a supplier category
|
||||
*
|
||||
* @param user User asking creation
|
||||
* @param name Nom categorie
|
||||
* @return int <0 if KO, 0 if OK
|
||||
* @param User $user User asking creation
|
||||
* @param string $name Category name
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
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
|
||||
*/
|
||||
|
||||
@ -71,7 +71,7 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
|
||||
/** Constructeur
|
||||
* @param DB Handler d'acces aux bases de donnees
|
||||
* @param DoliDB $DB Handler d'acces aux bases de donnees
|
||||
*/
|
||||
function CommandeFournisseur($DB)
|
||||
{
|
||||
@ -239,11 +239,11 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Add a line in log table
|
||||
* @param user User making action
|
||||
* @param statut Status of order
|
||||
* @param datelog Date of change
|
||||
* @param comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User making action
|
||||
* @param int $statut Status of order
|
||||
* @param date $datelog Date of change
|
||||
* @param string $comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function log($user, $statut, $datelog, $comment='')
|
||||
{
|
||||
@ -269,7 +269,7 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Validate an order
|
||||
*
|
||||
* @param User $user Utilisateur qui valide
|
||||
* @param User $user Validator User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function valid($user)
|
||||
@ -470,9 +470,10 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return string Label of status
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @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)
|
||||
{
|
||||
@ -540,9 +541,10 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return string Chaine avec URL
|
||||
*
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
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
|
||||
* de numerotation actif defini dans COMMANDE_SUPPLIER_ADDON
|
||||
* @param soc objet societe
|
||||
*
|
||||
* @param Societe $soc objet societe
|
||||
* @return string reference libre pour la facture
|
||||
*/
|
||||
function getNextNumRef($soc)
|
||||
@ -700,7 +703,9 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -746,7 +751,9 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Cancel an approved order.
|
||||
* 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)
|
||||
{
|
||||
@ -807,10 +814,10 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Send a supplier order to supplier
|
||||
* @param user User making change
|
||||
* @param date Date
|
||||
* @param methode Method
|
||||
* @param comment Comment
|
||||
* @param User $user User making change
|
||||
* @param date $date Date
|
||||
* @param int $methode Method
|
||||
* @param string $comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function commande($user, $date, $methode, $comment='')
|
||||
@ -843,8 +850,8 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Create order with draft status
|
||||
* @param user User making creation
|
||||
* @return int <0 if KO, Id of supplier order if OK
|
||||
* @param User $user User making creation
|
||||
* @return int <0 if KO, Id of supplier order if OK
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
@ -925,20 +932,20 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Add order line
|
||||
*
|
||||
* @param desc Description
|
||||
* @param pu_ht Unit price
|
||||
* @param qty Quantity
|
||||
* @param txtva Taux tva
|
||||
* @param txlocaltax1 Localtax1 tax
|
||||
* @param txlocaltax2 Localtax2 tax
|
||||
* @param fk_product Id produit
|
||||
* @param fk_prod_fourn_price Id supplier price
|
||||
* @param fourn_ref Supplier reference
|
||||
* @param remise_percent Remise
|
||||
* @param price_base_type HT or TTC
|
||||
* @param pu_ttc Unit price TTC
|
||||
* @param type Type of line (0=product, 1=service)
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @param string $desc Description
|
||||
* @param double $pu_ht Unit price
|
||||
* @param double $qty Quantity
|
||||
* @param double $txtva Taux tva
|
||||
* @param double $txlocaltax1 Localtax1 tax
|
||||
* @param double $txlocaltax2 Localtax2 tax
|
||||
* @param int $fk_product Id produit
|
||||
* @param int $fk_prod_fourn_price Id supplier price
|
||||
* @param string $fourn_ref Supplier reference
|
||||
* @param double $remise_percent Remise
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param double $pu_ttc Unit price TTC
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @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)
|
||||
{
|
||||
@ -1087,13 +1094,13 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Add a product into a stock warehouse.
|
||||
*
|
||||
* @param $user User object making change
|
||||
* @param $product Id of product to dispatch
|
||||
* @param $qty Qty to dispatch
|
||||
* @param $entrepot Id of warehouse to add product
|
||||
* @param $price Price for PMP value calculation
|
||||
* @param $comment Comment for stock movement
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User object making change
|
||||
* @param int $product Id of product to dispatch
|
||||
* @param double $qty Qty to dispatch
|
||||
* @param int $entrepot Id of warehouse to add product
|
||||
* @param double $price Price for PMP value calculation
|
||||
* @param string $comment Comment for stock movement
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='')
|
||||
{
|
||||
@ -1164,6 +1171,7 @@ class CommandeFournisseur extends Commande
|
||||
* Delete line
|
||||
*
|
||||
* @param int $idligne Id of line to delete
|
||||
* @return 0 if Ok, <0 ik Ko
|
||||
*/
|
||||
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()
|
||||
{
|
||||
@ -1278,8 +1288,9 @@ class CommandeFournisseur extends 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)
|
||||
{
|
||||
@ -1311,8 +1322,9 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -1344,10 +1356,11 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Set a delivery in database for this supplier order
|
||||
* @param user User that input data
|
||||
* @param date Date of reception
|
||||
* @param type Type of receipt
|
||||
* @param comment Comment
|
||||
*
|
||||
* @param User $user User that input data
|
||||
* @param date $date Date of reception
|
||||
* @param string $type Type of receipt
|
||||
* @param string $comment Comment
|
||||
*/
|
||||
function Livraison($user, $date, $type, $comment)
|
||||
{
|
||||
@ -1404,9 +1417,9 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Cree la commande depuis une propale existante
|
||||
* @param user Utilisateur qui cree
|
||||
* @param idc Id de la propale qui sert de modele
|
||||
* @param comclientid Id thirdparty
|
||||
* @param User $user Utilisateur qui cree
|
||||
* @param int $idc Id de la propale qui sert de modele
|
||||
* @param int $comclientid Id thirdparty
|
||||
*/
|
||||
function updateFromCommandeClient($user, $idc, $comclientid)
|
||||
{
|
||||
@ -1450,6 +1463,7 @@ class CommandeFournisseur extends Commande
|
||||
* @param string $note Private note
|
||||
* @param string $note_public Public note
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*
|
||||
* TODO Use instead update_note_public and update_note
|
||||
*/
|
||||
function UpdateNote($user, $note, $note_public)
|
||||
@ -1521,9 +1535,10 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Tag order with a particular status
|
||||
* @param user Object user that change status
|
||||
* @param status New status
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* @param User $user Object user that change status
|
||||
* @param int $status New status
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setStatus($user,$status)
|
||||
{
|
||||
@ -1564,18 +1579,18 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Update line
|
||||
*
|
||||
* @param rowid Id de la ligne de facture
|
||||
* @param desc Description de la ligne
|
||||
* @param pu Prix unitaire
|
||||
* @param qty Quantity
|
||||
* @param remise_percent Pourcentage de remise de la ligne
|
||||
* @param tva_tx Taux TVA
|
||||
* @param localtax1 Localtax1 tax
|
||||
* @param localtax2 Localtax2 tax
|
||||
* @param price_base_type Type of price base
|
||||
* @param info_bits Miscellanous informations
|
||||
* @param type Type of line (0=product, 1=service)
|
||||
* @return int < 0 if error, > 0 if ok
|
||||
* @param int $rowid Id de la ligne de facture
|
||||
* @param string $desc Description de la ligne
|
||||
* @param double $pu Prix unitaire
|
||||
* @param double $qty Quantity
|
||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
||||
* @param double $tva_tx Taux TVA
|
||||
* @param double $localtax1 Localtax1 tax
|
||||
* @param double $localtax2 Localtax2 tax
|
||||
* @param double $price_base_type Type of price base
|
||||
* @param int $info_bits Miscellanous informations
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @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)
|
||||
{
|
||||
@ -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
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
@ -1904,6 +1919,7 @@ class CommandeFournisseurLigne extends OrderLine
|
||||
|
||||
/**
|
||||
* Mise a jour de l'objet ligne de commande en base
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function update_total()
|
||||
|
||||
@ -556,9 +556,10 @@ class FactureFournisseur extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* Delete invoice from database
|
||||
* @param rowid Id of invoice to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Delete invoice from database
|
||||
*
|
||||
* @param int $rowid Id of invoice to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($rowid)
|
||||
{
|
||||
@ -606,10 +607,11 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
|
||||
/**
|
||||
* Set supplier ref
|
||||
* @param user User that make change
|
||||
* @param ref_supplier Supplier ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Set supplier ref
|
||||
*
|
||||
* @param User $user User that make change
|
||||
* @param string $ref_supplier Supplier ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_ref_supplier($user, $ref_supplier)
|
||||
{
|
||||
@ -638,9 +640,10 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag invoice as a payed invoice
|
||||
* @param user Object user
|
||||
* @return int <0 si ko, >0 si ok
|
||||
* Tag invoice as a payed invoice
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function set_paid($user)
|
||||
{
|
||||
@ -685,11 +688,12 @@ class FactureFournisseur extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
||||
* Fonction utilisee quand un paiement prelevement est refuse,
|
||||
* ou quand une facture annulee et reouverte.
|
||||
* @param user Object user that change status
|
||||
* @return int <0 si ok, >0 si ok
|
||||
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
||||
* Fonction utilisee quand un paiement prelevement est refuse,
|
||||
* ou quand une facture annulee et reouverte.
|
||||
*
|
||||
* @param User $user Object user that change status
|
||||
* @return int <0 si ok, >0 si ok
|
||||
*/
|
||||
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 string $force_number Reference to force on invoice
|
||||
* @param int $idwarehouse Id of warehouse for stock change
|
||||
* @return int <0 if KO, =0 if nothing to do, >0 if OK
|
||||
* @param User $user Object user that validate
|
||||
* @param string $force_number Reference to force on invoice
|
||||
* @param int $idwarehouse Id of warehouse for stock change
|
||||
* @return int <0 if KO, =0 if nothing to do, >0 if OK
|
||||
*/
|
||||
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
|
||||
* 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)
|
||||
*
|
||||
* @param desc Description de la ligne
|
||||
* @param pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note)
|
||||
* @param txtva Taux de tva force, sinon -1
|
||||
* @param txlocaltax1 LocalTax1 Rate
|
||||
* @param txlocaltax2 LocalTax2 Rate
|
||||
* @param qty Quantite
|
||||
* @param fk_product Id du produit/service predefini
|
||||
* @param remise_percent Pourcentage de remise de la ligne
|
||||
* @param date_start Date de debut de validite du service
|
||||
* @param date_end Date de fin de validite du service
|
||||
* @param ventil Code de ventilation comptable
|
||||
* @param info_bits Bits de type de lines
|
||||
* @param price_base_type HT ou TTC
|
||||
* @param type Type of line (0=product, 1=service)
|
||||
* @param rang Position of line
|
||||
* @return int >0 if OK, <0 if KO
|
||||
|
||||
* @param string $desc Description de la ligne
|
||||
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note)
|
||||
* @param double $txtva Taux de tva force, sinon -1
|
||||
* @param double $txlocaltax1 LocalTax1 Rate
|
||||
* @param double $txlocaltax2 LocalTax2 Rate
|
||||
* @param double $qty Quantite
|
||||
* @param int $fk_product Id du produit/service predefini
|
||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
||||
* @param date $date_start Date de debut de validite du service
|
||||
* @param date $date_end Date de fin de validite du service
|
||||
* @param string $ventil Code de ventilation comptable
|
||||
* @param int $ºinfo_bits Bits de type de lines
|
||||
* @param string $price_base_type HT ou TTC
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @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)
|
||||
{
|
||||
@ -984,19 +988,19 @@ class FactureFournisseur extends Facture
|
||||
|
||||
/**
|
||||
* Update a line detail into database
|
||||
* @param id Id of line invoice
|
||||
* @param label Description of line
|
||||
* @param pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* @param vatrate VAT Rate
|
||||
* @param txlocaltax1 LocalTax1 Rate
|
||||
* @param txlocaltax2 LocalTax2 Rate
|
||||
* @param qty Quantity
|
||||
* @param idproduct Id produit
|
||||
* @param price_base_type HT or TTC
|
||||
* @param info_bits Miscellanous informations of line
|
||||
* @param type Type of line (0=product, 1=service)
|
||||
* @param remise_percent Pourcentage de remise de la ligne
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id of line invoice
|
||||
* @param string $label Description of line
|
||||
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* @param double $vatrate VAT Rate
|
||||
* @param double $txlocaltax1 LocalTax1 Rate
|
||||
* @param double $txlocaltax2 LocalTax2 Rate
|
||||
* @param double $qty Quantity
|
||||
* @param int $idproduct Id produit
|
||||
* @param double $price_base_type HT or TTC
|
||||
* @param int $info_bits Miscellanous informations of line
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param double $remise_percent Pourcentage de remise de la ligne
|
||||
* @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)
|
||||
{
|
||||
@ -1079,7 +1083,7 @@ class FactureFournisseur extends Facture
|
||||
|
||||
/**
|
||||
* Delete a detail line from database
|
||||
* @param rowid id of line to delete
|
||||
* @param int $rowid id of line to delete
|
||||
*/
|
||||
function deleteline($rowid)
|
||||
{
|
||||
@ -1098,8 +1102,8 @@ class FactureFournisseur extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge les informations d'ordre info dans l'objet facture
|
||||
* \param id Id de la facture a charger
|
||||
* Charge les informations d'ordre info dans l'objet facture
|
||||
* @param int $id Id de la facture a charger
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
@ -1141,9 +1145,9 @@ class FactureFournisseur extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param User $user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
@ -1182,11 +1186,12 @@ class FactureFournisseur extends Facture
|
||||
|
||||
|
||||
/**
|
||||
* 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 max Max length of shown ref
|
||||
* @return string Chaine avec URL
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @param int $max Max length of shown ref
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
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
|
||||
* @param fromid Id of object to clone
|
||||
* @param invertdetail Reverse sign of amounts for lines
|
||||
* @return int New id of clone
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param int $fromid Id of object to clone
|
||||
* @param int $invertdetail Reverse sign of amounts for lines
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($fromid,$invertdetail=0)
|
||||
{
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* 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
|
||||
* 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
|
||||
* \param id id paiement to get
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Load payment object
|
||||
* @param int $id id paiement to get
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
@ -112,10 +113,11 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
|
||||
/**
|
||||
* Create payment in database
|
||||
* @param user Object of creating user
|
||||
* @param closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
|
||||
* @return int id of created payment, < 0 if error
|
||||
* Create payment in database
|
||||
*
|
||||
* @param User $user Object of creating user
|
||||
* @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)
|
||||
{
|
||||
@ -233,10 +235,11 @@ class PaiementFourn extends Paiement
|
||||
|
||||
|
||||
/**
|
||||
* \brief 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 au moins une facture a "payee", on refuse
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* 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 au moins une facture a "payee", on refuse
|
||||
*
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
@ -316,9 +319,9 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief Information sur l'objet
|
||||
* \param id id du paiement dont il faut afficher les infos
|
||||
/**
|
||||
* Information sur l'objet
|
||||
* @param int $id id du paiement dont il faut afficher les infos
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
@ -358,9 +361,10 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des factures sur lesquels porte le paiement
|
||||
* \param filter Critere de filtre
|
||||
* \return array Tableau des id de factures
|
||||
* Retourne la liste des factures sur lesquels porte le paiement
|
||||
*
|
||||
* @param string $filter Critere de filtre
|
||||
* @return array Tableau des id de factures
|
||||
*/
|
||||
function getBillsArray($filter='')
|
||||
{
|
||||
@ -393,9 +397,10 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief 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
|
||||
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||
*
|
||||
* @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)
|
||||
{
|
||||
@ -403,10 +408,11 @@ class PaiementFourn extends Paiement
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief 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
|
||||
* \return string Libelle du statut
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $status 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)
|
||||
{
|
||||
@ -448,10 +454,11 @@ class PaiementFourn extends Paiement
|
||||
|
||||
|
||||
/**
|
||||
* \brief 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
|
||||
* \return string Chaine avec URL
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
|
||||
@ -506,8 +506,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Delete a product from database (if not used)
|
||||
*
|
||||
* @param id Product id
|
||||
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
|
||||
* @param int $id Product id
|
||||
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
|
||||
*/
|
||||
function delete($id)
|
||||
{
|
||||
@ -640,7 +640,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
@ -707,7 +707,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Load array this->multilangs
|
||||
*
|
||||
* @param int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function getMultiLangs()
|
||||
{
|
||||
@ -750,8 +750,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Ajoute un changement de prix en base dans l'historique des prix
|
||||
*
|
||||
* @param user Objet utilisateur qui modifie le prix
|
||||
* @param int <0 if KO, >0 if OK
|
||||
* @param User $user Objet utilisateur qui modifie le prix
|
||||
* @param int $level price level to change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function _log_price($user,$level=0)
|
||||
{
|
||||
@ -782,9 +783,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Delete a price line
|
||||
*
|
||||
* @param user Object user
|
||||
* @param rowid Line id to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @param int $rowid Line id to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function log_price_delete($user,$rowid)
|
||||
{
|
||||
@ -810,11 +811,11 @@ class Product extends CommonObject
|
||||
* Lit le prix pratique par un fournisseur
|
||||
* 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 qty Quantity asked
|
||||
* @param product_id Filter on a particular product id
|
||||
* @param 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
|
||||
* @param int $prodfournprice Id du tarif = rowid table product_fournisseur_price
|
||||
* @param double $qty Quantity asked
|
||||
* @param int $product_id Filter on a particular product id
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param id Id of product/service to change
|
||||
* @param newprice New price
|
||||
* @param newpricebase HT or TTC
|
||||
* @param user Object user that make change
|
||||
* @param newvat New VAT Rate
|
||||
* @param newminprice New price min
|
||||
* @param level 0=standard, >0 = level if multilevel prices
|
||||
* @param newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id of product/service to change
|
||||
* @param double $newprice New price
|
||||
* @param string $newpricebase HT or TTC
|
||||
* @param User $user Object user that make change
|
||||
* @param double $newvat New VAT Rate
|
||||
* @param double $newminprice New price min
|
||||
* @param int $level 0=standard, >0 = level if multilevel prices
|
||||
* @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Id societe
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
function load_stats_propale($socid=0)
|
||||
{
|
||||
@ -1195,9 +1196,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Charge tableau des stats commande client pour le produit/service
|
||||
*
|
||||
* @param socid Id societe pour filtrer sur une societe
|
||||
* @param filtrestatut Id statut pour filtrer sur un statut
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param int $filtrestatut Id statut pour filtrer sur un statut
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Id societe pour filtrer sur une societe
|
||||
* @param filtrestatut Id des statuts pour filtrer sur des statuts
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param string $filtrestatut Id des statuts pour filtrer sur des statuts
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Id societe pour filtrer sur une societe
|
||||
* @param filtrestatut Id statut pour filtrer sur un statut
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe pour filtrer sur une societe
|
||||
* @param int $filtrestatut Id statut pour filtrer sur un statut
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
function load_stats_sending($socid=0,$filtrestatut='')
|
||||
{
|
||||
@ -1323,8 +1324,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Charge tableau des stats contrat pour le produit/service
|
||||
*
|
||||
* @param socid Id societe
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
function load_stats_contrat($socid=0)
|
||||
{
|
||||
@ -1365,8 +1366,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Charge tableau des stats facture pour le produit/service
|
||||
*
|
||||
* @param socid Id societe
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
function load_stats_facture($socid=0)
|
||||
{
|
||||
@ -1407,8 +1408,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Charge tableau des stats facture pour le produit/service
|
||||
*
|
||||
* @param socid Id societe
|
||||
* @return array Tableau des stats
|
||||
* @param int $socid Id societe
|
||||
* @return array Tableau des stats
|
||||
*/
|
||||
function load_stats_facture_fournisseur($socid=0)
|
||||
{
|
||||
@ -1449,9 +1450,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Return an array formated for showing graphs
|
||||
*
|
||||
* @param sql Request to execute
|
||||
* @param 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
|
||||
* @param string $sql Request to execute
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Limit count on a particular third party id
|
||||
* @param 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
|
||||
* @param int $socid Limit count on a particular third party id
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Limit count on a particular third party id
|
||||
* @param 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
|
||||
* @param int $socid Limit count on a particular third party id
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Limit count on a particular third party id
|
||||
* @param 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
|
||||
* @param int $socid Limit count on a particular third party id
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param socid Limit count on a particular third party id
|
||||
* @param 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
|
||||
* @param int $socid Limit count on a particular third party id
|
||||
* @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
|
||||
*/
|
||||
function get_nb_order($socid=0,$mode)
|
||||
{
|
||||
@ -1618,9 +1619,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Lie un produit associe au produit/service
|
||||
*
|
||||
* @param id_pere Id du produit auquel sera lie le produit a lier
|
||||
* @param id_fils Id du produit a lier
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
* @param int $id_pere Id du produit auquel sera lie le produit a lier
|
||||
* @param int $id_fils Id du produit a lier
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param fk_parent Id du produit auquel ne sera plus lie le produit lie
|
||||
* @param fk_child Id du produit a ne plus lie
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
* @param int $fk_parent Id du produit auquel ne sera plus lie le produit lie
|
||||
* @param int $fk_child Id du produit a ne plus lie
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
function del_sousproduit($fk_parent, $fk_child)
|
||||
{
|
||||
@ -1695,9 +1696,9 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Verifie si c'est un sous-produit
|
||||
*
|
||||
* @param fk_parent Id du produit auquel le produit est lie
|
||||
* @param fk_child Id du produit lie
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
* @param int $fk_parent Id du produit auquel le produit est lie
|
||||
* @param int $fk_child Id du produit lie
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
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
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param array $prod Products array
|
||||
* @return void
|
||||
*/
|
||||
function fetch_prods($prod)
|
||||
@ -2032,7 +2037,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -2138,8 +2144,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Return childs of prodcut with if fk_parent
|
||||
*
|
||||
* @param fk_parent Id of product to search childs of
|
||||
* @return array Prod
|
||||
* @param int $fk_parent Id of product to search childs of
|
||||
* @return array Prod
|
||||
*/
|
||||
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 option Where point the link
|
||||
* @param maxlength Maxlength of ref
|
||||
* @return string String with URL
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link
|
||||
* @param int $maxlength Maxlength of ref
|
||||
* @return string String with URL
|
||||
*/
|
||||
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 type 0=Shell, 1=Buy
|
||||
* @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
|
||||
* @param int $type 0=Shell, 1=Buy
|
||||
* @return string Label of status
|
||||
*/
|
||||
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 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"
|
||||
* @return string Label of status
|
||||
* @param int $status Statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @param int $type 0=Status "to sell", 1=Status "to buy"
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($status,$mode=0,$type=0)
|
||||
{
|
||||
@ -2321,13 +2327,13 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Adjust stock in a warehouse for product
|
||||
*
|
||||
* @param user user asking change
|
||||
* @param id_entrepot id of warehouse
|
||||
* @param nbpiece nb of units
|
||||
* @param movement 0 = add, 1 = remove
|
||||
* @param label Label of stock movement
|
||||
* @param price Price to use for stock eval
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user user asking change
|
||||
* @param int $id_entrepot id of warehouse
|
||||
* @param double $nbpiece nb of units
|
||||
* @param int $movement 0 = add, 1 = remove
|
||||
* @param string $label Label of stock movement
|
||||
* @param double $price Price to use for stock eval
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param sdir Repertoire destination finale
|
||||
* @param $file Nom du fichier uploade
|
||||
* @param maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
|
||||
* @param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
|
||||
* @param string $sdir Repertoire destination finale
|
||||
* @param string $file Nom du fichier uploade
|
||||
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
|
||||
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
|
||||
*/
|
||||
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120)
|
||||
{
|
||||
@ -2433,10 +2439,10 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Build thumb
|
||||
*
|
||||
* @param sdir Repertoire destination finale
|
||||
* @param file Chemin du fichier d'origine
|
||||
* @param maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
|
||||
* @param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
|
||||
* @param string $sdir Repertoire destination finale
|
||||
* @param string $file Chemin du fichier d'origine
|
||||
* @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
|
||||
* @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
|
||||
*/
|
||||
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)
|
||||
*
|
||||
* @param sdir Repertoire destination finale
|
||||
* @param $files url de l'image
|
||||
* @param string $sdir Repertoire destination finale
|
||||
* @param string $file url de l'image
|
||||
* @author Jean Heimburger june 2007
|
||||
*/
|
||||
function add_photo_web($sdir, $file)
|
||||
@ -2488,8 +2494,8 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Affiche la premiere photo du produit
|
||||
*
|
||||
* @param sdir Repertoire a scanner
|
||||
* @return boolean true si photo dispo, false sinon
|
||||
* @param string $sdir Repertoire a scanner
|
||||
* @return boolean true si photo dispo, false sinon
|
||||
*/
|
||||
function is_photo_available($sdir)
|
||||
{
|
||||
@ -2521,15 +2527,15 @@ class Product extends CommonObject
|
||||
* Show photos of a product (nbmax maximum), into several columns
|
||||
* TODO Move this into html.formproduct.class.php
|
||||
*
|
||||
* @param sdir Directory to scan
|
||||
* @param size 0=original size, 1 use thumbnail if possible
|
||||
* @param nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @param nbbyrow Nombre vignettes par ligne (si mode vignette)
|
||||
* @param showfilename 1=Show filename
|
||||
* @param showaction 1=Show icon with action links (resize, delete)
|
||||
* @param maxHeight Max height of image when size=1
|
||||
* @param maxWidth Max width of image when size=1
|
||||
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
|
||||
* @param string $sdir Directory to scan
|
||||
* @param int $size 0=original size, 1 use thumbnail if possible
|
||||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @param int $nbbyrow Nombre vignettes par ligne (si mode vignette)
|
||||
* @param int $showfilename 1=Show filename
|
||||
* @param int $showaction 1=Show icon with action links (resize, delete)
|
||||
* @param int $maxHeight Max height 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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param dir Repertoire a scanner
|
||||
* @param nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @return array Tableau de photos
|
||||
* @param string $dir Repertoire a scanner
|
||||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @return array Tableau de photos
|
||||
*/
|
||||
function liste_photos($dir,$nbmax=0)
|
||||
{
|
||||
@ -2743,7 +2749,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -2770,7 +2776,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* Load size of image file
|
||||
*
|
||||
* @param file Path to file
|
||||
* @param string $file Path to file
|
||||
*/
|
||||
function get_image_size($file)
|
||||
{
|
||||
@ -2816,7 +2822,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -2840,7 +2846,7 @@ class Product extends CommonObject
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
@ -2864,6 +2870,7 @@ class Product extends CommonObject
|
||||
|
||||
/**
|
||||
* Return if object is a product
|
||||
*
|
||||
* @return boolean True if it's a product
|
||||
*/
|
||||
function isproduct()
|
||||
@ -2880,6 +2887,7 @@ class Product extends CommonObject
|
||||
|
||||
/**
|
||||
* Return if object is a product
|
||||
*
|
||||
* @return boolean True if it's a service
|
||||
*/
|
||||
function isservice()
|
||||
|
||||
@ -52,8 +52,8 @@ class Service extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nb de tableau de bord
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Charge indicateurs this->nb de tableau de bord
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user