Missing translation
This commit is contained in:
parent
d298438e66
commit
23c118a40c
@ -172,6 +172,12 @@ print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
|
|||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Numbering module
|
||||||
|
*/
|
||||||
|
|
||||||
print_titre($langs->trans("OrdersNumberingModules"));
|
print_titre($langs->trans("OrdersNumberingModules"));
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -260,6 +266,7 @@ if ($handle)
|
|||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modeles de documents
|
* Modeles de documents
|
||||||
*/
|
*/
|
||||||
@ -320,7 +327,7 @@ while (($file = readdir($handle))!==false)
|
|||||||
print $module->description;
|
print $module->description;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Activ<EFBFBD>
|
// Activated
|
||||||
if (in_array($name, $def))
|
if (in_array($name, $def))
|
||||||
{
|
{
|
||||||
print "<td align=\"center\">\n";
|
print "<td align=\"center\">\n";
|
||||||
|
|||||||
@ -248,21 +248,6 @@ class CommandeFournisseur extends Commande
|
|||||||
$this->log($user, 1, time()); // Statut 1
|
$this->log($user, 1, time()); // Statut 1
|
||||||
$this->ref = $num;
|
$this->ref = $num;
|
||||||
|
|
||||||
// If stock is incremented on validate order, we must increment it
|
|
||||||
if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER == 1)
|
|
||||||
{
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
|
||||||
|
|
||||||
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
|
||||||
{
|
|
||||||
$mouvP = new MouvementStock($this->db);
|
|
||||||
// We decrement stock of product (and sub-products)
|
|
||||||
$entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
|
|
||||||
$result=$mouvP->reception($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty);
|
|
||||||
if ($result < 0) { $error++; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($error == 0)
|
if ($error == 0)
|
||||||
{
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@ -304,7 +289,7 @@ class CommandeFournisseur extends Commande
|
|||||||
/**
|
/**
|
||||||
* \brief Annule la commande
|
* \brief Annule la commande
|
||||||
* \param user Utilisateur qui demande annulation
|
* \param user Utilisateur qui demande annulation
|
||||||
* \remarks L'annulation se fait apr<EFBFBD>s la validation
|
* \remarks L'annulation se fait apres la validation
|
||||||
*/
|
*/
|
||||||
function Cancel($user)
|
function Cancel($user)
|
||||||
{
|
{
|
||||||
@ -316,8 +301,10 @@ class CommandeFournisseur extends Commande
|
|||||||
{
|
{
|
||||||
$statut = 6;
|
$statut = 6;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".$statut;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".$statut;
|
||||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = 1 ;";
|
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = 1";
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
@ -331,11 +318,23 @@ class CommandeFournisseur extends Commande
|
|||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
|
if ($error == 0)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("CommandeFournisseur::Cancel Error -1");
|
dolibarr_syslog("CommandeFournisseur::Cancel Error -1");
|
||||||
|
$this->db->rollback();
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -496,17 +495,21 @@ class CommandeFournisseur extends Commande
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Approuve une commande
|
* \brief Accept an order
|
||||||
*
|
* \param user Object user
|
||||||
*/
|
*/
|
||||||
function approve($user)
|
function approve($user)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
dolibarr_syslog("CommandeFournisseur::Approve");
|
dolibarr_syslog("CommandeFournisseur::Approve");
|
||||||
$result = 0;
|
|
||||||
if ($user->rights->fournisseur->commande->approuver)
|
if ($user->rights->fournisseur->commande->approuver)
|
||||||
{
|
{
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = 2";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = 2";
|
||||||
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = 1 ;";
|
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = 1 ;";
|
||||||
|
|
||||||
@ -515,34 +518,65 @@ class CommandeFournisseur extends Commande
|
|||||||
$result = 0;
|
$result = 0;
|
||||||
$this->log($user, 2, time()); // Statut 2
|
$this->log($user, 2, time()); // Statut 2
|
||||||
|
|
||||||
|
// If stock is incremented on validate order, we must increment it
|
||||||
|
if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER == 1)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
||||||
|
|
||||||
|
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
||||||
|
{
|
||||||
|
$mouvP = new MouvementStock($this->db);
|
||||||
|
// We decrement stock of product (and sub-products)
|
||||||
|
$entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
|
||||||
|
$result=$mouvP->reception($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty);
|
||||||
|
if ($result < 0) { $error++; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error == 0)
|
||||||
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('ORDER_SUPPLIER_APPROVE',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('ORDER_SUPPLIER_APPROVE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error == 0)
|
||||||
|
{
|
||||||
$subject = "Votre commande ".$this->ref." a <20>t<EFBFBD> approuv<75>e";
|
$subject = "Votre commande ".$this->ref." a <20>t<EFBFBD> approuv<75>e";
|
||||||
$message = "Bonjour,\n\n";
|
$message = "Bonjour,\n\n";
|
||||||
$message .= "Votre commande ".$this->ref." a <20>t<EFBFBD> approuv<75>e, par $user->fullname";
|
$message .= "Votre commande ".$this->ref." a <20>t<EFBFBD> approuv<75>e, par $user->fullname";
|
||||||
$message .= "\n\nCordialement,\n\n";
|
$message .= "\n\nCordialement,\n\n";
|
||||||
$this->_NotifyCreator($user, $subject, $message);
|
$this->_NotifyCreator($user, $subject, $message);
|
||||||
|
}
|
||||||
|
|
||||||
dolibarr_syslog("CommandeFournisseur::valid Success");
|
if ($error == 0)
|
||||||
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("CommandeFournisseur::Approve Error -1");
|
$this->db->rollback();
|
||||||
$result = -1;
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("CommandeFournisseur::Approve Not Authorized");
|
$this->db->rollback();
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dolibarr_syslog("CommandeFournisseur::Approve Error ",$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return $result ;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("CommandeFournisseur::Approve Not Authorized", LOG_ERR);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -39,12 +39,13 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
|||||||
var $nom='Marbre';
|
var $nom='Marbre';
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoi la description du modele de num<EFBFBD>rotation
|
/** \brief Renvoi la description du modele de numerotation
|
||||||
* \return string Texte descripif
|
* \return string Texte descripif
|
||||||
*/
|
*/
|
||||||
function info()
|
function info()
|
||||||
{
|
{
|
||||||
return "Renvoie le num<75>ro sous la forme ".$this->prefix."yymm-nnnn ou yy est l'annee, mm le mois et nnnn un compteur sequentiel sans rupture et sans remise e 0";
|
global $langs;
|
||||||
|
return $langs->trans("MarbreNumRefDesc",$this->prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,115 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
*
|
|
||||||
* 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/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
\file htdocs/includes/modules/commande/mod_commande_opale.php
|
|
||||||
\ingroup commande
|
|
||||||
\brief Fichier contenant la classe du modèle de numérotation de référence de commande Opale
|
|
||||||
\version $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
include_once("modules_commande.php");
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
\class mod_commande_opale
|
|
||||||
\brief Classe du modèle de numérotation de référence de commande Opale
|
|
||||||
*/
|
|
||||||
|
|
||||||
class mod_commande_opale extends ModeleNumRefCommandes
|
|
||||||
{
|
|
||||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
|
||||||
var $error = '';
|
|
||||||
var $nom = 'Opale';
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Constructeur
|
|
||||||
*/
|
|
||||||
function mod_commande_opale()
|
|
||||||
{
|
|
||||||
$this->nom = "Opale";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Renvoi la description du modele de numérotation
|
|
||||||
* \return string Texte descripif
|
|
||||||
*/
|
|
||||||
function info()
|
|
||||||
{
|
|
||||||
return "Renvoie le numéro sous la forme numérique COMhexa, où hexa représente un incrément global codé en héxadécimal. (COM-000-001 à COM-FFF-FFF)";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Renvoi un exemple de numérotation
|
|
||||||
* \return string Example
|
|
||||||
*/
|
|
||||||
function getExample()
|
|
||||||
{
|
|
||||||
return "COM-000-001";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief Return next value
|
|
||||||
* \param objsoc Objet third party
|
|
||||||
* \param commande Object order
|
|
||||||
* \return string Value if OK, 0 if KO
|
|
||||||
*/
|
|
||||||
function getNextValue($objsoc,$commande)
|
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
|
|
||||||
// D'abord on récupère la valeur max (réponse immédiate car champ indéxé)
|
|
||||||
$com='';
|
|
||||||
$sql = "SELECT MAX(ref)";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
|
||||||
$sql.= " WHERE ref like 'COM%'";
|
|
||||||
$resql=$db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$row = $db->fetch_row($resql);
|
|
||||||
if ($row)
|
|
||||||
{
|
|
||||||
//on extrait la valeur max et on la passe en décimale
|
|
||||||
$max = hexdec((substr($row[0],4,3)).(substr($row[0],8,3)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$max=0;
|
|
||||||
}
|
|
||||||
//$date=time();
|
|
||||||
$date=$commande->date;
|
|
||||||
$yy = strftime("%y",$date);
|
|
||||||
$hex = strtoupper(dechex($max+1));
|
|
||||||
$ref = substr("000000".($hex),-6);
|
|
||||||
|
|
||||||
return 'COM-'.substr($ref,0,3)."-".substr($ref,3,3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Return next free value
|
|
||||||
* \param objsoc Object third party
|
|
||||||
* \param objforref Object for number to search
|
|
||||||
* \return string Next free value
|
|
||||||
*/
|
|
||||||
function commande_get_num($objsoc,$objforref)
|
|
||||||
{
|
|
||||||
return $this->getNextValue($objsoc,$objforref);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@ -115,5 +115,8 @@ QtyOrdered=Qty ordered
|
|||||||
AddDeliveryCostLine=Add a delivery cost line indicating the weight of the order
|
AddDeliveryCostLine=Add a delivery cost line indicating the weight of the order
|
||||||
|
|
||||||
|
|
||||||
# einstein PDF Model
|
# Documents models
|
||||||
PDFEinsteinDescription=A complete order model (logo...)
|
PDFEinsteinDescription=A complete order model (logo...)
|
||||||
|
|
||||||
|
# NumRef Modules
|
||||||
|
MarbreNumRefDesc=Renvoie le numéro sous la forme %syymm-nnnn ou yy est l'annee, mm le mois et nnnn un compteur sequentiel sans rupture et sans remise e 0
|
||||||
|
|||||||
@ -118,11 +118,4 @@ AddDeliveryCostLine=Ajouter une ligne de frais port indiquant le poids de la com
|
|||||||
PDFEinsteinDescription=Modèle de propositions commerciales complet (logo...)
|
PDFEinsteinDescription=Modèle de propositions commerciales complet (logo...)
|
||||||
|
|
||||||
# NumRef Modules
|
# NumRef Modules
|
||||||
EmeraudeNumRefModelDesc1=Renvoie le numéro sous la forme CYYNNNNN où YY est l'année et NNNNN le numéro d'incrément qui commence à 1
|
MarbreNumRefDesc=Renvoie le numéro sous la forme %syymm-nnnn ou yy est l'annee, mm le mois et nnnn un compteur sequentiel sans rupture et sans remise à 0
|
||||||
EmeraudeNumRefModelDesc2=L'année s'incrémente de 1 et le numéro d'incrément se remet à zero en début d'année d'exercice.
|
|
||||||
EmeraudeNumRefModelDesc3=Définir le mois de début d'exercice dans configuration->société, ex: septembre.
|
|
||||||
EmeraudeNumRefModelDesc4=Dans cette exemple nous aurons au 1er septembre 2007 une commande nommée C0800001
|
|
||||||
RubisNumRefModelDesc1=Renvoie le numéro sous la forme CYYNNNNN où YY est l'année et NNNNN le numéro d'incrément qui commence à 1
|
|
||||||
RubisNumRefModelDesc2=L'année s'incrémente de 1 SANS remise à zero en début d'année d'exercice.
|
|
||||||
RubisNumRefModelDesc3=Définir le mois de début d'exercice dans configuration->société, ex: septembre.
|
|
||||||
RubisNumRefModelDesc4=Dans cette exemple nous aurons au 1er septembre 2007 une commande nommée C0800345
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user