On renomme modèle de commande fournisseur pour avoir unicité des id
This commit is contained in:
parent
e350ef762b
commit
dc2c04a688
@ -1,92 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
* or see http://www.gnu.org/
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
\file htdocs/fourn/commande/modules/pdf/mod_commande_fournisseur_emeraude.php
|
|
||||||
\ingroup fournisseur
|
|
||||||
\brief Fichier contenant la classe du modèle de numérotation de référence de commande fournisseur Emeraude
|
|
||||||
\version $Revision$
|
|
||||||
*/
|
|
||||||
|
|
||||||
include_once("modules_commandefournisseur.php");
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
\class mod_commande_fournisseur_emeraude
|
|
||||||
\brief Classe du modèle de numérotation de référence de commande fournisseur Emeraude
|
|
||||||
*/
|
|
||||||
|
|
||||||
class mod_commande_fournisseur_emeraude extends ModeleNumRefCommandesSuppliers
|
|
||||||
{
|
|
||||||
|
|
||||||
/** \brief Constructeur
|
|
||||||
*/
|
|
||||||
function mod_commande_fournisseur_emeraude()
|
|
||||||
{
|
|
||||||
$this->nom = "Emeraude";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoi la description du modele de numérotation
|
|
||||||
* \return string Texte descripif
|
|
||||||
*/
|
|
||||||
function info()
|
|
||||||
{
|
|
||||||
$texte = "Renvoie le numéro sous la forme numérique CFNNNNNN, où NNNNNN représente numéro d'incrément. Ce dernier n'est PAS remis à zéro en début d'année.";
|
|
||||||
return $texte;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoi un exemple de numérotation
|
|
||||||
* \return string Example
|
|
||||||
*/
|
|
||||||
function getExample()
|
|
||||||
{
|
|
||||||
return "CF000001";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoie le prochaine numéro de référence de commande non utilisé
|
|
||||||
\param obj_soc objet société
|
|
||||||
\return string numéro de référence de commande non utilisé
|
|
||||||
*/
|
|
||||||
function commande_get_num($obj_soc=0)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_statut <> 0";
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
|
|
||||||
if ( $resql )
|
|
||||||
{
|
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
|
|
||||||
$num = $row[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return 'CF'.substr("000000".$num,strlen("000000".$num)-6,6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -23,9 +23,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/fourn/commande/modules/pdf/mod_commande_fournisseur_diamant.php
|
\file htdocs/fourn/commande/modules/pdf/mod_commande_fournisseur_rose.php
|
||||||
\ingroup fournisseur
|
\ingroup fournisseur
|
||||||
\brief Fichier contenant la classe du modèle de numérotation de référence de commande Diamant
|
\brief Fichier contenant la classe du modèle de numérotation de référence de commande Rose
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -33,18 +33,18 @@ include_once("modules_commandefournisseur.php");
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class mod_commande_fournisseur_diamant
|
\class mod_commande_fournisseur_rose
|
||||||
\brief Classe du modèle de numérotation de référence de commande fournisseur Diamant
|
\brief Classe du modèle de numérotation de référence de commande fournisseur Rose
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class mod_commande_fournisseur_diamant extends ModeleNumRefCommandesSuppliers
|
class mod_commande_fournisseur_rose extends ModeleNumRefCommandesSuppliers
|
||||||
{
|
{
|
||||||
|
|
||||||
/** \brief Constructeur
|
/** \brief Constructeur
|
||||||
*/
|
*/
|
||||||
function mod_commande_fournisseur_diamant()
|
function mod_commande_fournisseur_rose()
|
||||||
{
|
{
|
||||||
$this->nom = "Diamant";
|
$this->nom = "Rose";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -54,11 +54,11 @@ class mod_commande_fournisseur_diamant extends ModeleNumRefCommandesSuppliers
|
|||||||
function info()
|
function info()
|
||||||
{
|
{
|
||||||
$texte = "Renvoie le numéro sous la forme numérique CFYYNNNN, où YY représente l'année et NNNN Le numéro d'incrément. Ce dernier n'est PAS remis à zéro en début d'année.<br>\n";
|
$texte = "Renvoie le numéro sous la forme numérique CFYYNNNN, où YY représente l'année et NNNN Le numéro d'incrément. Ce dernier n'est PAS remis à zéro en début d'année.<br>\n";
|
||||||
$texte.= "Si la constante COMMANDE_FOURNISSEUR_DIAMANT_DELTA est définie, un offset est appliqué sur le compteur";
|
$texte.= "Si la constante COMMANDE_FOURNISSEUR_ROSE_DELTA est définie, un offset est appliqué sur le compteur";
|
||||||
|
|
||||||
if (defined("COMMANDE_FOURNISSEUR_DIAMANT_DELTA"))
|
if (defined("COMMANDE_FOURNISSEUR_ROSE_DELTA"))
|
||||||
{
|
{
|
||||||
$texte .= " (Définie et vaut: ".COMMANDE_FOURNISSEUR_DIAMANT_DELTA.")";
|
$texte .= " (Définie et vaut: ".COMMANDE_FOURNISSEUR_ROSE_DELTA.")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -75,9 +75,9 @@ class mod_commande_fournisseur_diamant extends ModeleNumRefCommandesSuppliers
|
|||||||
{
|
{
|
||||||
$y = strftime("%y",time());
|
$y = strftime("%y",time());
|
||||||
|
|
||||||
if (defined("COMMANDE_FOURNISSEUR_DIAMANT_DELTA"))
|
if (defined("COMMANDE_FOURNISSEUR_ROSE_DELTA"))
|
||||||
{
|
{
|
||||||
$num = sprintf("%02d",COMMANDE_FOURNISSEUR_DIAMANT_DELTA);
|
$num = sprintf("%02d",COMMANDE_FOURNISSEUR_ROSE_DELTA);
|
||||||
return "CF".$y.substr("000".$num, strlen("000".$num)-4,4);
|
return "CF".$y.substr("000".$num, strlen("000".$num)-4,4);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -87,35 +87,46 @@ class mod_commande_fournisseur_diamant extends ModeleNumRefCommandesSuppliers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoie le prochaine numéro de référence de commande non utilisé
|
/**
|
||||||
\param obj_soc objet société
|
* \brief Renvoie le prochaine numéro de référence de commande non utilisé
|
||||||
\return string numéro de référence de commande non utilisé
|
* \param objsoc Objet société
|
||||||
*/
|
* \return string Numéro de référence de commande non utilisé
|
||||||
function commande_get_num($obj_soc=0)
|
*/
|
||||||
{
|
function getNextValue($objsoc=0)
|
||||||
global $db;
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_statut <> 0";
|
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_statut <> 0";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
$num = $row[0];
|
$num = $row[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined("COMMANDE_FOURNISSEUR_DIAMANT_DELTA"))
|
if (!defined("COMMANDE_FOURNISSEUR_ROSE_DELTA"))
|
||||||
{
|
{
|
||||||
define("COMMANDE_FOURNISSEUR_DIAMANT_DELTA", 0);
|
define("COMMANDE_FOURNISSEUR_ROSE_DELTA", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = $num + COMMANDE_FOURNISSEUR_DIAMANT_DELTA;
|
$num = $num + COMMANDE_FOURNISSEUR_ROSE_DELTA;
|
||||||
|
|
||||||
$y = strftime("%y",time());
|
$y = strftime("%y",time());
|
||||||
|
|
||||||
|
return 'CF'.$y.sprintf("%04s",$num);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Renvoie la référence de commande suivante non utilisée
|
||||||
|
* \param objsoc Objet société
|
||||||
|
* \return string Texte descripif
|
||||||
|
*/
|
||||||
|
function commande_get_num($objsoc=0)
|
||||||
|
{
|
||||||
|
return $this->getNextValue($objsoc);
|
||||||
|
}
|
||||||
|
|
||||||
return 'CF'.$y.substr("000".$num, strlen("000".$num)-4,4);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
|
*
|
||||||
|
* 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/fourn/commande/modules/pdf/mod_commande_fournisseur_tulipe.php
|
||||||
|
\ingroup fournisseur
|
||||||
|
\brief Fichier contenant la classe du modèle de numérotation de référence de commande fournisseur Tulipe
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once("modules_commandefournisseur.php");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\class mod_commande_fournisseur_tulipe
|
||||||
|
\brief Classe du modèle de numérotation de référence de commande fournisseur Tulipe
|
||||||
|
*/
|
||||||
|
|
||||||
|
class mod_commande_fournisseur_tulipe extends ModeleNumRefCommandesSuppliers
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Constructeur
|
||||||
|
*/
|
||||||
|
function mod_commande_fournisseur_tulipe()
|
||||||
|
{
|
||||||
|
$this->nom = "Tulipe";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Renvoi la description du modele de numérotation
|
||||||
|
* \return string Texte descripif
|
||||||
|
*/
|
||||||
|
function info()
|
||||||
|
{
|
||||||
|
$texte = "Renvoie le numéro sous la forme numérique CFNNNNNN, où NNNNNN représente numéro d'incrément. Ce dernier n'est PAS remis à zéro en début d'année.";
|
||||||
|
return $texte;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief Renvoi un exemple de numérotation
|
||||||
|
* \return string Example
|
||||||
|
*/
|
||||||
|
function getExample()
|
||||||
|
{
|
||||||
|
return "CF000001";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie le prochaine numéro de référence de commande non utilisé
|
||||||
|
* \param objsoc objet société
|
||||||
|
* \return string numéro de référence de commande non utilisé
|
||||||
|
*/
|
||||||
|
function getNextValue($objsoc=0)
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_statut <> 0";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
if ( $resql )
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
|
$num = $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'CF'.sprintf("%06s",$num);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Renvoie la référence de commande suivante non utilisée
|
||||||
|
* \param objsoc Objet société
|
||||||
|
* \return string Texte descripif
|
||||||
|
*/
|
||||||
|
function commande_get_num($objsoc=0)
|
||||||
|
{
|
||||||
|
return $this->getNextValue($objsoc);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -55,6 +55,7 @@ class pdf_muscadet extends ModelePDFCommandesSuppliers
|
|||||||
$this->description = "Modèle de commandes fournisseur complet (logo...)";
|
$this->description = "Modèle de commandes fournisseur complet (logo...)";
|
||||||
|
|
||||||
// Dimension page pour format A4
|
// Dimension page pour format A4
|
||||||
|
$this->type = 'pdf';
|
||||||
$this->page_largeur = 210;
|
$this->page_largeur = 210;
|
||||||
$this->page_hauteur = 297;
|
$this->page_hauteur = 297;
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
@ -65,10 +66,9 @@ class pdf_muscadet extends ModelePDFCommandesSuppliers
|
|||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
|
$this->option_modereg = 1; // Affiche mode règlement
|
||||||
|
$this->option_condreg = 1; // Affiche conditions règlement
|
||||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||||
$this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
|
|
||||||
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
|
|
||||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||||
$this->franchise=1;
|
$this->franchise=1;
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ class mod_commande_diamant extends ModeleNumRefCommandes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoie la référence de commande suivante non utilisée
|
/** \brief Renvoie la référence de commande suivante non utilisée
|
||||||
* \param objsoc Objet société
|
* \param objsoc Objet société
|
||||||
* \return string Texte descripif
|
* \return string Texte descripif
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user