2
0
forked from Wavyzz/dolibarr

Fix: Comptage des commandes en cours sur le stock.

Qual: Uniformatisation de code des commandes fournisseurs
This commit is contained in:
Laurent Destailleur
2006-08-07 02:20:57 +00:00
parent 14cae5a73a
commit d7341f59e0
26 changed files with 338 additions and 278 deletions

View File

@@ -39,7 +39,6 @@ class Conf
/** \public */ /** \public */
var $db; // Objet des caract<63>ristiques de connexions var $db; // Objet des caract<63>ristiques de connexions
// base db->host, db->name, db->user, db->pass, db->type // base db->host, db->name, db->user, db->pass, db->type
var $langage; // Langue choisie fr_FR, en_US, ...
var $maxfilesize = 2000000; // Taille max des fichiers upload<61>s var $maxfilesize = 2000000; // Taille max des fichiers upload<61>s
var $externalrss; var $externalrss;

View File

@@ -264,6 +264,7 @@ if ($_GET["id"] > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($commande->socidp); $soc->fetch($commande->socidp);
$author = new User($db); $author = new User($db);
$author->id = $commande->user_author_id; $author->id = $commande->user_author_id;
$author->fetch(); $author->fetch();
@@ -291,7 +292,7 @@ if ($_GET["id"] > 0)
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm("fiche.php?id=$commande->id","Supprimer la commande","Etes-vous s<>r de vouloir supprimer cette commande ?","confirm_delete"); $html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DeleteOrder"),"Etes-vous s<>r de vouloir supprimer cette commande ?","confirm_delete");
print '<br />'; print '<br />';
} }
@@ -301,7 +302,27 @@ if ($_GET["id"] > 0)
*/ */
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
$html->form_confirm("fiche.php?id=$commande->id","Valider la commande","Etes-vous s<>r de vouloir valider cette commande ?","confirm_valid"); // on v<>rifie si la commande est en num<75>rotation provisoire
$ref = substr($commande->ref, 1, 4);
if ($ref == 'PROV')
{
$newref = $commande->getNextNumRef($soc);
}
else
{
$newref = $commande->ref;
}
$text=$langs->trans('ConfirmValidateOrder',$newref);
if ($conf->notification->enabled)
{
require_once(DOL_DOCUMENT_ROOT ."/notify.class.php");
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage(3,$commande->socidp);
}
$html->form_confirm("fiche.php?id=".$commande->id,$langs->trans("ValidateOrder"),$text,"confirm_valid");
print '<br />'; print '<br />';
} }
/* /*
@@ -351,7 +372,7 @@ if ($_GET["id"] > 0)
// Ref // Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'.$commande->ref.'</td>'; print '<td colspan="5">'.$commande->ref.'</td>';
print '</tr>'; print '</tr>';
// Fournisseur // Fournisseur
@@ -386,7 +407,8 @@ if ($_GET["id"] > 0)
} }
// Auteur // Auteur
print '<tr><td>'.$langs->trans("Author").'</td><td colspan="2">'.$author->fullname.'</td>'; print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '<td colspan="3" width="50%">'; print '<td colspan="3" width="50%">';
print "&nbsp;</td></tr>"; print "&nbsp;</td></tr>";

View File

@@ -140,7 +140,8 @@ if ($_GET["id"] > 0)
} }
// Auteur // Auteur
print '<tr><td>'.$langs->trans("Author").'</td><td colspan="2">'.$author->fullname.'</td>'; print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '<td width="50%">'; print '<td width="50%">';
print "&nbsp;</td></tr>"; print "&nbsp;</td></tr>";

View File

@@ -184,69 +184,39 @@ class CommandeFournisseur extends Commande
*/ */
function valid($user) function valid($user)
{ {
dolibarr_syslog("CommandeFournisseur::Valid"); dolibarr_syslog("CommandeFournisseur.class::Valid");
$result = 0; $result = 0;
if ($user->rights->fournisseur->commande->valider) if ($user->rights->fournisseur->commande->valider)
{ {
if (defined('COMMANDE_SUPPLIER_ADDON')) $this->db->begin();
$num=$this->getNextNumRef($soc);
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur SET ref='$num', fk_statut = 1, date_valid=now(), fk_user_valid=$user->id";
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
$resql=$this->db->query($sql);
if ($resql)
{ {
if (is_readable(DOL_DOCUMENT_ROOT .'/fourn/commande/modules/'.COMMANDE_SUPPLIER_ADDON.'.php')) $result = 1;
{ $this->log($user, 1, time()); // Statut 1
$this->db->begin(); $this->ref = $num;
require_once DOL_DOCUMENT_ROOT .'/fourn/commande/modules/'.COMMANDE_SUPPLIER_ADDON.'.php';
// Definition du nom de module de numerotation de commande fournisseur
$modName=COMMANDE_SUPPLIER_ADDON;
// Recuperation de la nouvelle reference
$objMod = new $modName($this->db);
$soc = new Societe($this->db);
$soc->fetch($this->socidp);
$num = $objMod->commande_get_num($soc);
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur SET ref='$num', fk_statut = 1, date_valid=now(), fk_user_valid=$user->id";
$sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";
$resql=$this->db->query($sql);
if ($resql)
{
$result = 1;
$this->log($user, 1, time());
$this->ref = $num;
// 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_VALIDATE',$this,$user,$langs,$conf); $result=$interface->run_triggers('ORDER_SUPPLIER_VALIDATE',$this,$user,$langs,$conf);
// Fin appel triggers // Fin appel triggers
$this->_NotifyApprobator($user); // \todo a gerer par trigger dolibarr_syslog("CommandeFournisseur::valid Success");
$this->db->commit();
dolibarr_syslog("CommandeFournisseur::valid Success"); return 1;
$this->db->begin();
return 1;
}
else
{
$this->error=$this->db->error();
dolibarr_syslog("CommandeFournisseur::valid ".$this->error);
$this->db->rollback();
return -1;
}
}
else
{
$this->error='Impossible de lire le module de num<75>rotation';
dolibarr_syslog("CommandeFournisseur::valid ".$this->error);
return -1;
}
} }
else else
{ {
$this->error='Le module de num<75>rotation n\'est pas d<>fini' ; $this->error=$this->db->error();
dolibarr_syslog("CommandeFournisseur::valid ".$this->error); dolibarr_syslog("CommandeFournisseur::valid ".$this->error);
$this->db->rollback();
return -1; return -1;
} }
} }
@@ -370,64 +340,59 @@ class CommandeFournisseur extends Commande
} }
/* /**
* * \brief Renvoie la r<>f<EFBFBD>rence de commande suivante non utilis<69>e en fonction du module
* * de num<75>rotation actif d<>fini dans COMMANDE_SUPPLIER_ADDON
*/ * \param soc objet societe
function _NotifyApprobator($user) * \return string reference libre pour la facture
{ */
require_once (DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); function getNextNumRef($soc)
{
$this->ReadApprobators(); global $db, $langs;
$langs->load("orders");
if (sizeof($this->approbs) > 0)
{
$this->_details_text(); $dir = DOL_DOCUMENT_ROOT .'/fourn/commande/modules';
$from = $user->email; if (defined('COMMANDE_SUPPLIER_ADDON'))
$subject = "Nouvelle commande en attente d'approbation r<>f : ".$this->ref; {
$file = COMMANDE_SUPPLIER_ADDON.'.php';
$message = "Bonjour,\n\n";
$message .= "La commande ".$this->ref." valid<69>e par $user->fullname, est en attente de votre approbation.\n\n"; if (is_readable($dir.'/'.$file))
{
// Definition du nom de module de numerotation de commande fournisseur
$message .= $this->details_text; $modName=COMMANDE_SUPPLIER_ADDON;
require_once($dir.'/'.$file);
if (sizeof($this->approbs) > 1)
{
$message .= "\nCette demande d'approbation a <20>t<EFBFBD> envoy<6F>e <20> :\n";
foreach($this->approbs as $approb)
{
if (strlen($approb[2]))
{
$message .= "- $approb[0] $approb[1] <$approb[2]>\n";
}
}
}
$message .= "\nCordialement,\n\n";
$message .="--\n(message automatique envoy<6F> par Dolibarr)";
foreach($this->approbs as $approb) // Recuperation de la nouvelle reference
{ $objMod = new $modName($this->db);
$sendto = $approb[2]; $numref = "";
$numref = $objMod->commande_get_num($soc,$this);
$mailfile = new CMailFile($subject,
$sendto, if ( $numref != "")
$from, {
$message, array(), array(), array()); return $numref;
if ( $mailfile->sendfile() ) }
{ else
{
} dolibarr_print_error($db,"Facture::getNextNumRef ".$obj->error);
} return -1;
} }
} }
else
/** {
print $langs->trans("Error")." ".$langs->trans("FailedToLoadCOMMANDE_SUPPLIER_ADDONFile");
return -2;
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_SUPPLIER_ADDON_NotDefined");
return -3;
}
}
/**
* \brief Approuve une commande * \brief Approuve une commande
* *
*/ */
@@ -443,15 +408,23 @@ class CommandeFournisseur extends Commande
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
$result = 0; $result = 0;
$this->log($user, 2, time()); $this->log($user, 2, time()); // Statut 2
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_APPROVE',$this,$user,$langs,$conf);
// Fin appel triggers
$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");
$this->db->commit();
return 1;
} }
else else
{ {

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@@ -80,12 +79,10 @@ $sql .= ", pf.fk_soc";
$sql .= ", min(ppf.price) as price"; $sql .= ", min(ppf.price) as price";
$sql .= ", s.nom"; $sql .= ", s.nom";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if ($catid) if ($catid)
{ {
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
} }
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON p.rowid = pf.fk_product"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON p.rowid = pf.fk_product";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.idp = pf.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.idp = pf.fk_soc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON ppf.fk_soc = pf.fk_soc AND ppf.fk_product = p.rowid AND ppf.quantity = 1"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON ppf.fk_soc = pf.fk_soc AND ppf.fk_product = p.rowid AND ppf.quantity = 1";
@@ -117,7 +114,6 @@ else
} }
} }
if ($fourn_id > 0) if ($fourn_id > 0)
{ {
$sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = $fourn_id"; $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = $fourn_id";
@@ -126,115 +122,115 @@ $sql .= " GROUP BY p.rowid";
$sql .= " ORDER BY $sortfield $sortorder "; $sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit($limit + 1 ,$offset); $sql .= $db->plimit($limit + 1 ,$offset);
dolibarr_syslog("fourn/product/liste: sql=$sql");
$resql = $db->query($sql) ; $resql = $db->query($sql) ;
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0;
if ($num == 1 && (isset($_POST["sall"]) or $snom or $sref))
{
$objp = $db->fetch_object($resql);
Header("Location: fiche.php?id=$objp->rowid");
}
$texte = $langs->trans("List");
$i = 0;
llxHeader("","",$texte); if ($num == 1 && ( isset($_POST["sall"]) || $snom || $sref ) )
if ($sref || $snom || $_POST["sall"] || $_POST["search"])
{
print_barre_liste($texte, $page, "liste.php", "&sref=".$sref."&snom=".$snom, $sortfield, $sortorder,'',$num);
}
else
{
print_barre_liste($texte, $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":""), $sortfield, $sortorder,'',$num);
}
if (isset($catid))
{
print "<div id='ways'>";
$c = new Categorie ($db, $catid);
$ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php');
print " &gt; ".$ways[0]."<br />\n";
print "</div><br />";
}
print '<table class="liste" width="100%">';
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),"liste.php", "p.ref","&amp;envente=$envente".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield);
print_liste_field_titre($langs->trans("Label"),"liste.php", "p.label","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield);
print_liste_field_titre($langs->trans("Supplier"),"liste.php", "pf.fk_soc","","","",$sortfield);
print_liste_field_titre($langs->trans("BuyingPrice"),"liste.php", "ppf.price","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield);
print "</tr>\n";
// Lignes des champs de filtre
print '<form action="liste.php" method="post">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="sref" value="'.$sref.'">';
print '</td>';
print '<td class="liste_titre" valign="right">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '</td>';
print '<td class="liste_titre" colspan="2" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '&nbsp; <input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" alt="'.$langs->trans("RemoveFilter").'">';
print '</td>';
print '</tr>';
print '</form>';
$oldid = '';
$var=True;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object( $i);
$var=!$var;
print "<tr $bc[$var]>";
if ($oldid <> $objp->rowid)
{ {
$oldid = $objp->rowid; $objp = $db->fetch_object($resql);
print "<td><a href=\"../../product/fiche.php?id=$objp->rowid\">"; Header("Location: fiche.php?id=".$objp->rowid);
if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); exit;
else print img_object($langs->trans("ShowProduct"),"product");
print "</a> ";
print "<a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></td>\n";
print "<td>$objp->label</td>\n";
}
else
{
print '<td colspan="2">&nbsp;</td>';
} }
print '<td>'.$objp->nom.'</td>'; $texte = $langs->trans("List");
print '<td align="right">'.price($objp->price).'</td>'; llxHeader("","",$texte);
print "</tr>\n";
$i++;
}
$db->free($resql);
print "</table>"; if ($sref || $snom || $_POST["sall"] || $_POST["search"])
{
print_barre_liste($texte, $page, "liste.php", "&sref=".$sref."&snom=".$snom, $sortfield, $sortorder,'',$num);
}
else
{
print_barre_liste($texte, $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":""), $sortfield, $sortorder,'',$num);
}
if (isset($catid))
{
print "<div id='ways'>";
$c = new Categorie ($db, $catid);
$ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php');
print " &gt; ".$ways[0]."<br />\n";
print "</div><br />";
}
print '<table class="liste" width="100%">';
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),"liste.php", "p.ref","&amp;envente=$envente".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield);
print_liste_field_titre($langs->trans("Label"),"liste.php", "p.label","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield);
print_liste_field_titre($langs->trans("Supplier"),"liste.php", "pf.fk_soc","","","",$sortfield);
print_liste_field_titre($langs->trans("BuyingPrice"),"liste.php", "ppf.price","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield);
print "</tr>\n";
// Lignes des champs de filtre
print '<form action="liste.php" method="post">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="sref" value="'.$sref.'">';
print '</td>';
print '<td class="liste_titre" valign="right">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '</td>';
print '<td class="liste_titre" colspan="2" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '&nbsp; <input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" alt="'.$langs->trans("RemoveFilter").'">';
print '</td>';
print '</tr>';
print '</form>';
$oldid = '';
$var=True;
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]>";
if ($oldid <> $objp->rowid)
{
$oldid = $objp->rowid;
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->rowid.'">';
if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service");
else print img_object($langs->trans("ShowProduct"),"product");
print "</a> ";
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->rowid.'">'.$objp->ref.'</a></td>';
print "<td>$objp->label</td>\n";
}
else
{
print '<td colspan="2">&nbsp;</td>';
}
print '<td>'.$objp->nom.'</td>';
print '<td align="right">'.price($objp->price).'</td>';
print "</tr>\n";
$i++;
}
$db->free($resql);
print "</table>";
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter('$Date$ - $Revision$');
?> ?>

View File

@@ -125,6 +125,19 @@ class InterfaceNotification
$notify->send($action_notify, $object->socidp, $mesg, 'ficheinter', $object->id, $filepdf); $notify->send($action_notify, $object->socidp, $mesg, 'ficheinter', $object->id, $filepdf);
} }
if ($action == 'ORDER_SUPPLIER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id);
$action_notify = 3;
$ref = sanitize_string($object->ref);
$filepdf = $conf->fournisseur->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
$mesg = 'La commande fournisseur '.$object->ref." a <20>t<EFBFBD> valid<69>e.\n";
$notify = new Notify($this->db);
$notify->send($action_notify, $object->socidp, $mesg, 'order_supplier', $object->id, $filepdf);
}
return 0; return 0;
} }

View File

@@ -8,12 +8,15 @@ BillsCustomersUnpayedForCompany=Unpayed customers' invoices for %s
BillsSuppliersUnpayed=Unpayed suppliers' invoices BillsSuppliersUnpayed=Unpayed suppliers' invoices
BillsUnpayed=Unpayed BillsUnpayed=Unpayed
BillsStatistics=Invoices statistics BillsStatistics=Invoices statistics
CardBill=Invoice card
Invoice=Invoice Invoice=Invoice
Invoices=Invoices Invoices=Invoices
InvoiceLine=Invoice line InvoiceLine=Invoice line
InvoiceCustomer=Customer invoice InvoiceCustomer=Customer invoice
CardBill=Invoice card CustomerInvoice=Customer invoice
CustomersInvoices=Customers' invoices
SupplierInvoice=Supplier invoice SupplierInvoice=Supplier invoice
SuppliersInvoices=Suppliers' invoices
SupplierBill=Supplier invoice SupplierBill=Supplier invoice
SupplierBills=suppliers invoices SupplierBills=suppliers invoices
BillContacts=Invoice contacts BillContacts=Invoice contacts

View File

@@ -79,4 +79,6 @@ DeliveryReceipt=Delivery Receipt
Notifications=Notifications Notifications=Notifications
NoNotificationsWillBeSent=No email notifications are planned for this event and company NoNotificationsWillBeSent=No email notifications are planned for this event and company
ANotificationsWillBeSent=1 notification will be sent by email ANotificationsWillBeSent=1 notification will be sent by email
SomeNotificationsWillBeSent=%s notifications will be sent by email SomeNotificationsWillBeSent=%s notifications will be sent by email
AddNewNotification=Activate a new notification request
ListOfActiveNotifications=List all active notifications requests

View File

@@ -21,12 +21,15 @@ StatusOrderValidatedShort=Validated
StatusOrderOnProcessShort=On process StatusOrderOnProcessShort=On process
StatusOrderProcessedShort=Processed StatusOrderProcessedShort=Processed
StatusOrderToBillShort=To bill StatusOrderToBillShort=To bill
StatusOrderApprovedShort=Approved
StatusOrderCanceled=Canceld StatusOrderCanceled=Canceld
StatusOrderDraft=Draft (need to be validated) StatusOrderDraft=Draft (need to be validated)
StatusOrderValidated=Validated StatusOrderValidated=Validated
StatusOrderOnProcess=On process StatusOrderOnProcess=On process
StatusOrderProcessed=Processed StatusOrderProcessed=Processed
StatusOrderToBill=To bill StatusOrderToBill=To bill
StatusOrderApproved=Approved
DraftOrWaitingApproved=Draft or approved not yet ordered
MenuOrdersToBill=Orders to bill MenuOrdersToBill=Orders to bill
SearchOrder=Search order SearchOrder=Search order
Sending=Sending Sending=Sending
@@ -59,7 +62,7 @@ CloseOrder=Close order
ConfirmCloseOrder=Are you sure you want to close this order ? Once an order is closed, it can only be billed. ConfirmCloseOrder=Are you sure you want to close this order ? Once an order is closed, it can only be billed.
ConfirmCloseOrderIfSending=Are you sure you want to close this order ? You must close an order only when all shipping are done. ConfirmCloseOrderIfSending=Are you sure you want to close this order ? You must close an order only when all shipping are done.
ConfirmDeleteOrder=Are you sure you want to delete this order ? ConfirmDeleteOrder=Are you sure you want to delete this order ?
ConfirmValidateOrder=Are you sure you want to validate this order ? ConfirmValidateOrder=Are you sure you want to validate this order under name %s ?
ConfirmCancelOrder=Are you sure you want to cancel this order ? ConfirmCancelOrder=Are you sure you want to cancel this order ?
GenerateBill=Generate invoice GenerateBill=Generate invoice
ClassifyBilled=Classify "Billed" ClassifyBilled=Classify "Billed"
@@ -75,6 +78,7 @@ SendOrderByMail=Send order by mail
ActionsOnOrder=Actions on order ActionsOnOrder=Actions on order
NoArticleOfTypeProduct=No article of type 'product' so no shippable article for this order NoArticleOfTypeProduct=No article of type 'product' so no shippable article for this order
OrderMode=Order method OrderMode=Order method
AuthorRequest=Request author
# Sources # Sources
OrderSource0=Commercial proposal OrderSource0=Commercial proposal
OrderSource1=Internet OrderSource1=Internet

View File

@@ -8,12 +8,15 @@ BillsCustomersUnpayedForCompany=Factures clients impay
BillsSuppliersUnpayed=Factures fournisseurs impay<61>es BillsSuppliersUnpayed=Factures fournisseurs impay<61>es
BillsUnpayed=Impay<61>es BillsUnpayed=Impay<61>es
BillsStatistics=Statistiques factures BillsStatistics=Statistiques factures
CardBill=Fiche facture
Invoice=Facture Invoice=Facture
Invoices=Factures Invoices=Factures
InvoiceLine=Ligne de facture InvoiceLine=Ligne de facture
InvoiceCustomer=Facture client InvoiceCustomer=Facture client
CardBill=Fiche facture CustomerInvoice=Facture client
CustomersInvoices=Factures clients
SupplierInvoice=Facture fournisseur SupplierInvoice=Facture fournisseur
SuppliersInvoices=Factures fournisseurs
SupplierBill=Facture fournisseur SupplierBill=Facture fournisseur
SupplierBills=Factures fournisseurs SupplierBills=Factures fournisseurs
BillContacts=Contacts facture BillContacts=Contacts facture

View File

@@ -79,4 +79,6 @@ DeliveryReceipt=Accus
Notifications=Notifications Notifications=Notifications
NoNotificationsWillBeSent=Aucune notification par email n'est pr<70>vue pour cet <20>venement et soci<63>t<EFBFBD> NoNotificationsWillBeSent=Aucune notification par email n'est pr<70>vue pour cet <20>venement et soci<63>t<EFBFBD>
ANotificationsWillBeSent=1 notification va <20>tre envoy<6F>e par mail ANotificationsWillBeSent=1 notification va <20>tre envoy<6F>e par mail
SomeNotificationsWillBeSent=%s notifications vont <20>tre envoy<6F>es par mail SomeNotificationsWillBeSent=%s notifications vont <20>tre envoy<6F>es par mail
AddNewNotification=Activer une nouvelle demande de notification
ListOfActiveNotifications=Liste des demandes de notifications actives

View File

@@ -21,12 +21,15 @@ StatusOrderValidatedShort=Valid
StatusOrderOnProcessShort=En cours StatusOrderOnProcessShort=En cours
StatusOrderProcessedShort=Trait<69>e StatusOrderProcessedShort=Trait<69>e
StatusOrderToBillShort=<3D> facturer StatusOrderToBillShort=<3D> facturer
StatusOrderApprovedShort=Approuv<75>
StatusOrderCanceled=Annul<75>e StatusOrderCanceled=Annul<75>e
StatusOrderDraft=Brouillon (<28> valider) StatusOrderDraft=Brouillon (<28> valider)
StatusOrderValidated=Valid<69>e StatusOrderValidated=Valid<69>e
StatusOrderOnProcess=Traitement en cours StatusOrderOnProcess=Traitement en cours
StatusOrderProcessed=Trait<69>e StatusOrderProcessed=Trait<69>e
StatusOrderToBill=<3D> facturer StatusOrderToBill=<3D> facturer
StatusOrderApprovedShort=Approuv<75>
DraftOrWaitingApproved=Brouillon ou approuv<75>e pas encore command<6E>e
SearchOrder=Rechercher une commande SearchOrder=Rechercher une commande
MenuOrdersToBill=Commandes <20> facturer MenuOrdersToBill=Commandes <20> facturer
Sending=Exp<78>dition Sending=Exp<78>dition
@@ -59,7 +62,7 @@ CloseOrder=Cloturer commande
ConfirmCloseOrder=<3D>tes-vous sur de vouloir cloturer cette commande ? Une fois une commande clotur<75>e, elle doit <20>tre factur<75>e. ConfirmCloseOrder=<3D>tes-vous sur de vouloir cloturer cette commande ? Une fois une commande clotur<75>e, elle doit <20>tre factur<75>e.
ConfirmCloseOrderIfSending=<3D>tes-vous sur de vouloir cloturer cette commande ? Vous ne devez cloturer une commande qu'une fois les produits exp<78>di<64>s. ConfirmCloseOrderIfSending=<3D>tes-vous sur de vouloir cloturer cette commande ? Vous ne devez cloturer une commande qu'une fois les produits exp<78>di<64>s.
ConfirmDeleteOrder=<3D>tes-vous sur de vouloir effacer cette commande ? ConfirmDeleteOrder=<3D>tes-vous sur de vouloir effacer cette commande ?
ConfirmValidateOrder=<3D>tes-vous sur de vouloir valider cette commande ? ConfirmValidateOrder=<3D>tes-vous sur de vouloir valider cette commande sous la r<>f<EFBFBD>rence %s ?
ConfirmCancelOrder=<3D>tes-vous sur de vouloir annuler cette commande ? ConfirmCancelOrder=<3D>tes-vous sur de vouloir annuler cette commande ?
GenerateBill=Facturer GenerateBill=Facturer
ClassifyBilled=Classer "Factur<75>e" ClassifyBilled=Classer "Factur<75>e"
@@ -75,6 +78,7 @@ SendOrderByMail=Envoi commande par mail
ActionsOnOrder=Actions sur la commande ActionsOnOrder=Actions sur la commande
NoArticleOfTypeProduct=Pas d'article de type 'produit' et donc exp<78>diable dans cette commande NoArticleOfTypeProduct=Pas d'article de type 'produit' et donc exp<78>diable dans cette commande
OrderMode=M<>thode de commande OrderMode=M<>thode de commande
AuthorRequest=Auteur/Demandeur
# Sources # Sources
OrderSource0=Proposition commerciale OrderSource0=Proposition commerciale
OrderSource1=Internet OrderSource1=Internet

View File

@@ -41,18 +41,18 @@ class DolEditor
/** /**
\brief DolEditor \brief DolEditor
\param htmlname Nom formulaire html WYSIWIG \param htmlname Nom formulaire html WYSIWIG
\param content Contenu <20>dition WYSIWIG \param content Contenu <20>dition WYSIWIG
\param height Hauteur en pixel de la zone <20>dition \param height Hauteur en pixel de la zone <20>dition
\param toolbarname Nom barre de menu <20>diteur \param toolbarname Nom barre de menu <20>diteur
\param toolbarlocation Emplacement de la barre de menu : \param toolbarlocation Emplacement de la barre de menu :
'In' chaque fen<65>tre d'<27>dition a <20>a propre barre d'outils 'In' chaque fen<65>tre d'<27>dition a <20>a propre barre d'outils
'Out:nom' partage de la barre d'outils o<> 'nom' est le nom du DIV qui affiche la barre 'Out:nom' partage de la barre d'outils o<> 'nom' est le nom du DIV qui affiche la barre
\param toolbarstartexpanded visible ou non au d<>marrage \param toolbarstartexpanded visible ou non au d<>marrage
*/ */
function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false) function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false)
{ {
global $conf; global $conf,$langs;
dolibarr_syslog("DolEditor::DolEditor"); dolibarr_syslog("DolEditor::DolEditor");
@@ -62,11 +62,15 @@ class DolEditor
$this->editor->Height = $height; $this->editor->Height = $height;
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js')) if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js'))
{ {
$this->editor->Config["CustomConfigurationsPath"] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js'; $this->editor->Config['CustomConfigurationsPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js';
$this->editor->ToolbarSet = $toolbarname; $this->editor->ToolbarSet = $toolbarname;
$this->editor->Config[ 'ToolbarLocation' ] = $toolbarlocation ; $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In';
$this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded;
$this->editor->Config['SkinPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/'; $this->editor->Config['SkinPath'] = DOL_URL_ROOT.'/theme/'.$conf->theme.'/fckeditor/';
// if ($langs->origlang=='auto')
// {
$this->editor->Config['AutoDetectLanguage'] = 'true';
// }
} }
} }

View File

@@ -86,11 +86,12 @@ class Notify
{ {
$num=-1; $num=-1;
$sql = "SELECT s.nom, c.email, c.idp, c.name, c.firstname, a.titre,n.rowid"; $sql = "SELECT n.rowid, c.email, c.idp, c.name, c.firstname, a.titre, s.nom";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action"; $sql.= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action";
$sql .= " AND n.fk_soc = s.idp AND n.fk_action = ".$action; $sql.= " AND n.fk_soc = s.idp";
$sql .= " AND s.idp = ".$socid; $sql.= " AND n.fk_action = ".$action;
$sql.= " AND s.idp = ".$socid;
dolibarr_syslog("Notify.class::countDefinedNotifications $action, $socid"); dolibarr_syslog("Notify.class::countDefinedNotifications $action, $socid");

View File

@@ -1009,7 +1009,7 @@ class Product
/** /**
* \brief Charge tableau des stats commande fournisseur pour le produit/service * \brief Charge tableau des stats commande fournisseur pour le produit/service
* \param socid Id societe pour filtrer sur une soci<63>t<EFBFBD> * \param socid Id societe pour filtrer sur une soci<63>t<EFBFBD>
* \param filtrestatut Id statut pour filtrer sur un statut * \param filtrestatut Id des statuts pour filtrer sur des statuts
* \return array Tableau des stats * \return array Tableau des stats
*/ */
function load_stats_commande_fournisseur($socid=0,$filtrestatut='') function load_stats_commande_fournisseur($socid=0,$filtrestatut='')
@@ -1027,9 +1027,9 @@ class Product
{ {
$sql.= " AND c.fk_soc = ".$socid; $sql.= " AND c.fk_soc = ".$socid;
} }
if ($filtrestatut) if ($filtrestatut != '') // Peut valoir 0
{ {
$sql.= " AND c.fk_statut = ".$filtrestatut; $sql.= " AND c.fk_statut in (".$filtrestatut.")";
} }
$result = $this->db->query($sql) ; $result = $this->db->query($sql) ;

View File

@@ -136,14 +136,14 @@ if ($_GET["id"] || $_GET["ref"])
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Commandes // Commandes clients
if ($conf->commande->enabled) if ($conf->commande->enabled)
{ {
$ret=$product->load_stats_commande($socidp); $ret=$product->load_stats_commande($socidp);
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("orders"); $langs->load("orders");
print '<tr><td>'; print '<tr><td>';
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("Orders").'</a>'; print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_commande['customers']; print $product->stats_commande['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -177,7 +177,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("bills"); $langs->load("bills");
print '<tr><td>'; print '<tr><td>';
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("Bills").'</a>'; print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_facture['customers']; print $product->stats_facture['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -194,7 +194,7 @@ if ($_GET["id"] || $_GET["ref"])
$sql = "SELECT distinct(s.nom), s.idp, s.code_client, c.rowid, c.total_ht as amount, c.ref,"; $sql = "SELECT distinct(s.nom), s.idp, s.code_client, c.rowid, c.total_ht as amount, c.ref,";
$sql.= " ".$db->pdate("c.date_creation")." as date, c.fk_statut as statut, c.rowid as commandeid"; $sql.= " ".$db->pdate("c.date_creation")." as date, c.fk_statut as statut, c.facture, c.rowid as commandeid";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."commandedet as d"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."commande as c, ".MAIN_DB_PREFIX."commandedet as d";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -213,7 +213,7 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
print_barre_liste($langs->trans("Orders"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("CustomersOrders"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num);
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
@@ -246,7 +246,7 @@ if ($_GET["id"] || $_GET["ref"])
print "<td align=\"center\">"; print "<td align=\"center\">";
print dolibarr_print_date($objp->date)."</td>"; print dolibarr_print_date($objp->date)."</td>";
print "<td align=\"right\">".price($objp->amount)."</td>\n"; print "<td align=\"right\">".price($objp->amount)."</td>\n";
print '<td align="right">'.$commandestatic->LibStatut($objp->statut,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($objp->statut,$objp->facture,5).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@@ -142,7 +142,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("orders"); $langs->load("orders");
print '<tr><td>'; print '<tr><td>';
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("Orders").'</a>'; print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_commande['customers']; print $product->stats_commande['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -176,7 +176,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("bills"); $langs->load("bills");
print '<tr><td>'; print '<tr><td>';
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("Bills").'</a>'; print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_facture['customers']; print $product->stats_facture['customers'];
print '</td><td align="right">'; print '</td><td align="right">';

View File

@@ -107,10 +107,10 @@ if ($_GET["id"] || $_GET["ref"])
print $product->getLibStatut(2); print $product->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top" width="28%">'.$langs->trans("Referers").'</td>'; print '<tr><td valign="top" width="25%">'.$langs->trans("Referers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("NbOfCustomers").'</td>'; print '<td align="right" width="25%">'.$langs->trans("NbOfCustomers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("NbOfReferers").'</td>'; print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("TotalQuantity").'</td>'; print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
print '</tr>'; print '</tr>';
// Propals // Propals
@@ -137,7 +137,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("orders"); $langs->load("orders");
print '<tr><td>'; print '<tr><td>';
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("Orders").'</a>'; print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_commande['customers']; print $product->stats_commande['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -171,7 +171,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("bills"); $langs->load("bills");
print '<tr><td>'; print '<tr><td>';
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("Bills").'</a>'; print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_facture['customers']; print $product->stats_facture['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -207,7 +207,7 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
print_barre_liste($langs->trans("Bills"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&amp;id=$product->id",$sortfield,$sortorder,'',$num);
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";

View File

@@ -132,7 +132,7 @@ if ($_GET["id"] || $_GET["ref"])
// Reference // Reference
print '<tr>'; print '<tr>';
print '<td width="28%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="3">';
$product->load_previous_next_ref(); $product->load_previous_next_ref();
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':''; $previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':''; $next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
@@ -152,10 +152,10 @@ if ($_GET["id"] || $_GET["ref"])
print $product->getLibStatut(2); print $product->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
print '<tr><td valign="top" width="28%">'.$langs->trans("Referers").'</td>'; print '<tr><td valign="top" width="25%">'.$langs->trans("Referers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("NbOfCustomers").'</td>'; print '<td align="right" width="25%">'.$langs->trans("NbOfCustomers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("NbOfReferers").'</td>'; print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
print '<td align="right" width="24%">'.$langs->trans("TotalQuantity").'</td>'; print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
print '</tr>'; print '</tr>';
// Propals // Propals
@@ -182,7 +182,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("orders"); $langs->load("orders");
print '<tr><td>'; print '<tr><td>';
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("Orders").'</a>'; print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_commande['customers']; print $product->stats_commande['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -216,7 +216,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("bills"); $langs->load("bills");
print '<tr><td>'; print '<tr><td>';
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("Bills").'</a>'; print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_facture['customers']; print $product->stats_facture['customers'];
print '</td><td align="right">'; print '</td><td align="right">';

View File

@@ -141,7 +141,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("orders"); $langs->load("orders");
print '<tr><td>'; print '<tr><td>';
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("Orders").'</a>'; print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_commande['customers']; print $product->stats_commande['customers'];
print '</td><td align="right">'; print '</td><td align="right">';
@@ -175,7 +175,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($ret < 0) dolibarr_print_error($db); if ($ret < 0) dolibarr_print_error($db);
$langs->load("bills"); $langs->load("bills");
print '<tr><td>'; print '<tr><td>';
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("Bills").'</a>'; print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
print '</td><td align="right">'; print '</td><td align="right">';
print $product->stats_facture['customers']; print $product->stats_facture['customers'];
print '</td><td align="right">'; print '</td><td align="right">';

View File

@@ -35,6 +35,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("products"); $langs->load("products");
$langs->load("orders");
$langs->load("bills"); $langs->load("bills");
$user->getrights('produit'); $user->getrights('produit');
@@ -119,7 +120,7 @@ if ($_GET["id"] || $_GET["ref"])
// Reference // Reference
print '<tr>'; print '<tr>';
print '<td width="15%">'.$langs->trans("Ref").'</td><td>'; print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
$product->load_previous_next_ref(); $product->load_previous_next_ref();
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':''; $previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':''; $next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
@@ -179,14 +180,14 @@ if ($_GET["id"] || $_GET["ref"])
// Nbre de commande fournisseurs en cours // Nbre de commande fournisseurs en cours
if ($conf->fournisseur->enabled) if ($conf->fournisseur->enabled)
{ {
$result=$product->load_stats_commande_fournisseur(0,'1'); $result=$product->load_stats_commande_fournisseur(0,'2');
if ($result < 0) dolibarr_print_error($db,$product->error); if ($result < 0) dolibarr_print_error($db,$product->error);
print '<tr><td>'.$langs->trans("SuppliersOrders").'</td>'; print '<tr><td>'.$langs->trans("SuppliersOrders").'</td>';
print '<td>'; print '<td>';
print $product->stats_commande_fournisseur['qty']; print $product->stats_commande_fournisseur['qty'];
$result=$product->load_stats_commande_fournisseur(0,'0'); $result=$product->load_stats_commande_fournisseur(0,'0,1');
if ($result < 0) dolibarr_print_error($db,$product->error); if ($result < 0) dolibarr_print_error($db,$product->error);
print ' ('.$langs->trans("Draft").': '.$product->stats_commande_fournisseur['qty'].')'; print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')';
print '</td></tr>'; print '</td></tr>';
} }

View File

@@ -32,6 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
$langs->load("companies"); $langs->load("companies");
$langs->load("mails");
$user->getrights('commercial'); $user->getrights('commercial');

View File

@@ -34,7 +34,8 @@
class Translate { class Translate {
var $dir; var $dir;
var $defaultlang; var $origlang; // Langue origine
var $defaultlang; // Langue courante en vigueur de l'utilisateur
var $tab_loaded=array(); // Tableau pour signaler les fichiers deja charg<72>s var $tab_loaded=array(); // Tableau pour signaler les fichiers deja charg<72>s
var $tab_translate=array(); // Tableau des traductions var $tab_translate=array(); // Tableau des traductions
@@ -81,11 +82,13 @@ class Translate {
/** /**
* \brief Accesseur de this->defaultlang * \brief Accesseur de this->defaultlang
* \param defaultlang Langue par defaut <EFBFBD> utiliser * \param srclang Langue <20> utiliser
*/ */
function setDefaultLang($defaultlang='fr_FR') function setDefaultLang($srclang='fr_FR')
{ {
if ($defaultlang == 'auto') $this->origlang=$srclang;
if ($srclang == 'auto')
{ {
$langpref=$_SERVER['HTTP_ACCEPT_LANGUAGE']; $langpref=$_SERVER['HTTP_ACCEPT_LANGUAGE'];
$langpref=eregi_replace(";[^,]*","",$langpref); $langpref=eregi_replace(";[^,]*","",$langpref);
@@ -95,11 +98,11 @@ class Translate {
$langpart=split("_",$langlist[0]); $langpart=split("_",$langlist[0]);
if (isset($langpart[1])) $defaultlang=strtolower($langpart[0])."_".strtoupper($langpart[1]); if (isset($langpart[1])) $srclang=strtolower($langpart[0])."_".strtoupper($langpart[1]);
else $defaultlang=strtolower($langpart[0])."_".strtoupper($langpart[0]); else $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
} }
$this->defaultlang=$defaultlang; $this->defaultlang=$srclang;
} }

View File

@@ -1031,10 +1031,10 @@ class User
$result = $this->db->query($sql); $result = $this->db->query($sql);
} }
/** /**
* \brief Retire l'utilisateur d'un groupe * \brief Retire l'utilisateur d'un groupe
* \param group id du groupe * \param group id du groupe
*/ */
function RemoveFromGroup($group) function RemoveFromGroup($group)
{ {
@@ -1044,7 +1044,32 @@ class User
$result = $this->db->query($sql); $result = $this->db->query($sql);
} }
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto Inclut le picto dans le lien
* \param option Sur quoi pointe le lien
* \return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='')
{
global $langs;
$result='';
$lien = '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$this->id.'">';
$lienfin='</a>';
if ($option == 'xxx')
{
$lien = '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$this->id.'">';
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin.' ');
$result.=$lien.$this->nom.' '.$this->prenom.$lienfin;
return $result;
}
} }
?> ?>

View File

@@ -52,6 +52,7 @@ insert into llx_sqltables (name, loaded) values ('llx_album',0);
delete from llx_action_def; delete from llx_action_def;
insert into llx_action_def (rowid,code,titre,description,objet_type) values (1,'NOTIFY_VAL_FICHINTER','Validation fiche intervention','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une fiche d\'intervention','ficheinter'); insert into llx_action_def (rowid,code,titre,description,objet_type) values (1,'NOTIFY_VAL_FICHINTER','Validation fiche intervention','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une fiche d\'intervention','ficheinter');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (2,'NOTIFY_VAL_FAC','Validation facture','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une facture','facture'); insert into llx_action_def (rowid,code,titre,description,objet_type) values (2,'NOTIFY_VAL_FAC','Validation facture','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une facture','facture');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (3,'NOTIFY_VAL_ORDER_SUUPLIER','Validation commande fournisseur','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une commande fournisseur','order_supplier');
-- --
-- Constantes de configuration -- Constantes de configuration

View File

@@ -334,4 +334,6 @@ alter table llx_commande drop column fk_soc_contact;
alter table llx_livraison drop column fk_soc_contact; alter table llx_livraison drop column fk_soc_contact;
alter table llx_propal drop column fk_soc_contact; alter table llx_propal drop column fk_soc_contact;
alter table llx_c_pays modify libelle varchar(50) NOT NULL; alter table llx_c_pays modify libelle varchar(50) NOT NULL;
insert into llx_action_def (rowid,code,titre,description,objet_type) values (3,'NOTIFY_VAL_ORDER_SUUPLIER','Validation commande fournisseur','D<EFBFBD>clench<EFBFBD> lors de la validation d\'une commande fournisseur','order_supplier');