Debug barcode module
This commit is contained in:
parent
2819aa1ed2
commit
79eb1e85a8
@ -18,12 +18,12 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/admin/barcode.php
|
\file htdocs/admin/barcode.php
|
||||||
\ingroup barcode
|
\ingroup barcode
|
||||||
\brief Page d'administration/configuration du module Code barre
|
\brief Page d'administration/configuration du module Code barre
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
@ -34,7 +34,7 @@ $dir = DOL_DOCUMENT_ROOT."/includes/modules/barcode/";
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
if ($_POST["action"] == 'setcoder')
|
if ($_POST["action"] == 'setcoder')
|
||||||
{
|
{
|
||||||
@ -47,17 +47,23 @@ if ($_POST["action"] == 'setcoder')
|
|||||||
else if ($_POST["action"] == 'setgenbarcodelocation')
|
else if ($_POST["action"] == 'setgenbarcodelocation')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "GENBARCODE_LOCATION",$_POST["genbarcodelocation"]);
|
dolibarr_set_const($db, "GENBARCODE_LOCATION",$_POST["genbarcodelocation"]);
|
||||||
Header("Location: barcode.php");
|
}
|
||||||
exit;
|
else if ($_POST["action"] == 'setdefaultbarcodetype')
|
||||||
|
{
|
||||||
|
dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $_POST["coder_id"]);
|
||||||
|
}
|
||||||
|
else if ($_POST["action"] == 'GENBARCODE_BARCODETYPE_THIRDPARTY')
|
||||||
|
{
|
||||||
|
dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $_POST["coder_id"]);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
else if ($_POST["action"] == 'setproductusebarcode')
|
else if ($_POST["action"] == 'setproductusebarcode')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_USE_BARCODE",$_POST["value"]);
|
dolibarr_set_const($db, "PRODUIT_USE_BARCODE",$_POST["value"]);
|
||||||
Header("Location: barcode.php");
|
Header("Location: barcode.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
@ -80,21 +86,21 @@ $var=true;
|
|||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||||
{
|
{
|
||||||
if (is_readable($dir.$file))
|
if (is_readable($dir.$file))
|
||||||
{
|
{
|
||||||
if (eregi('(.*)\.modules\.php',$file,$reg))
|
if (eregi('(.*)\.modules\.php',$file,$reg))
|
||||||
{
|
{
|
||||||
$filebis=$reg[1];
|
$filebis=$reg[1];
|
||||||
|
|
||||||
// Chargement de la classe de codage
|
// Chargement de la classe de codage
|
||||||
require_once($dir.$file);
|
require_once($dir.$file);
|
||||||
$classname = "mod".ucfirst($filebis);
|
$classname = "mod".ucfirst($filebis);
|
||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
// Show modules according to features level
|
// Show modules according to features level
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
$barcodelist[$filebis]=$module->info();
|
$barcodelist[$filebis]=$module->info();
|
||||||
}
|
}
|
||||||
@ -126,7 +132,7 @@ if ($resql)
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -134,7 +140,7 @@ if ($resql)
|
|||||||
print '<tr '.$bc[$var].'><td width="100">';
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
print $obj->libelle;
|
print $obj->libelle;
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||||
//print "L'EAN se compose de 8 caract<63>res, 7 chiffres plus une cl<63> de contr<74>le.<br>";
|
//print "L'EAN se compose de 8 caract<63>res, 7 chiffres plus une cl<63> de contr<74>le.<br>";
|
||||||
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupr<70>s d'organisme tel que GENCOD.<br>";
|
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupr<70>s d'organisme tel que GENCOD.<br>";
|
||||||
//print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
//print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
||||||
@ -153,7 +159,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding);
|
||||||
//print $url;
|
//print $url;
|
||||||
print '<img src="'.$url.'" border="0">';
|
print '<img src="'.$url.'" title="'.$obj->example.'" border="0">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -213,137 +219,153 @@ if (!isset($_ENV['windir']) && !file_exists($_ENV['windir']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Module produits
|
// Module produits
|
||||||
/*
|
if ($conf->societe->enabled)
|
||||||
if ($conf->produit->enabled)
|
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||||
print '<input type="hidden" name="action" value="setproductusebarcode">';
|
print "<input type=\"hidden\" name=\"action\" value=\"setdefaultbarcodetype\">";
|
||||||
print '<tr '.$bc[$var].'>';
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>'.$langs->trans("UseBarcodeInProductModule").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||||
print '<td width="60" align="right">';
|
print '<td width="60" align="right">';
|
||||||
print $html->selectyesno('value',$conf->global->PRODUIT_USE_BARCODE,1);
|
print $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"coder_id",1);
|
||||||
print '</td>';
|
print '</td><td align="right">';
|
||||||
print '<td width="60" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print "</td>";
|
||||||
|
print '</tr>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Module produits
|
||||||
|
if ($conf->produit->enabled)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"GENBARCODE_BARCODETYPE_THIRDPARTY\">";
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||||
|
print '<td width="60" align="right">';
|
||||||
|
print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"coder_id",1);
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print "</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//EAN13
|
//EAN13
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
print "EAN13";
|
print "EAN13";
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
|
|
||||||
print "L'EAN se compose de 13 caract<63>res, 12 chiffres plus une cl<63> de contr<74>le. Il fonctionne de la m<>me mani<6E>re que l'UPC, avec lequel il est compatible.<br>";
|
|
||||||
print "L'utilisation des symbologies EAN13 impose la souscription et l'abonnement aupr<70>s d'organisme tel que GENCOD.<br>";
|
|
||||||
print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
print "L'EAN se compose de 13 caract<63>res, 12 chiffres plus une cl<63> de contr<74>le. Il fonctionne de la m<>me mani<6E>re que l'UPC, avec lequel il est compatible.<br>";
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('123456789012','EAN',1).'"></td>';
|
print "L'utilisation des symbologies EAN13 impose la souscription et l'abonnement aupr<70>s d'organisme tel que GENCOD.<br>";
|
||||||
|
print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
||||||
print '<td align="center">';
|
print '</td>';
|
||||||
print $formbarcode->setBarcodeEncoder('EAN13','form'.$i);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
$i++;
|
|
||||||
|
|
||||||
//UPC
|
// Affiche exemple
|
||||||
$var=!$var;
|
print '<td align="center"><img src="'.dol_genbarcode('123456789012','EAN',1).'"></td>';
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
|
||||||
print "UPC";
|
|
||||||
print "</td><td>\n";
|
|
||||||
print "L'UPC est l'<27>quivalent de l'EAN8/13 pour des pays codificateurs autre que l'Europe.<br>";
|
|
||||||
print "Il ne comporte que 11 chiffres plus la cl<63>.<br>";
|
|
||||||
print "C'est en r<>alit<69> un code EAN13 dont le premier chiffre serait z<>ro et dont la pr<70>sentation serait l<>g<EFBFBD>rement diff<66>rente.<br>";
|
|
||||||
print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
print '<td align="center">';
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('123456789012','UPC',1).'"></td>';
|
print $formbarcode->setBarcodeEncoder('EAN13','form'.$i);
|
||||||
|
print "</td></tr>\n";
|
||||||
print '<td align="center">';
|
$i++;
|
||||||
print $formbarcode->setBarcodeEncoder('UPC','form'.$i);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
$i++;
|
|
||||||
|
|
||||||
//ISBN
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
|
||||||
print "ISBN";
|
|
||||||
print "</td><td>\n";
|
|
||||||
print "Le code ISBN est un code d<>di<64> au milieu de la presse <20>crite.";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
//UPC
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('123456789','ISBN',1).'"></td>';
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
print '<td align="center">';
|
print "UPC";
|
||||||
print $formbarcode->setBarcodeEncoder('ISBN','form'.$i);
|
print "</td><td>\n";
|
||||||
print "</td></tr>\n";
|
print "L'UPC est l'<27>quivalent de l'EAN8/13 pour des pays codificateurs autre que l'Europe.<br>";
|
||||||
$i++;
|
print "Il ne comporte que 11 chiffres plus la cl<63>.<br>";
|
||||||
|
print "C'est en r<>alit<69> un code EAN13 dont le premier chiffre serait z<>ro et dont la pr<70>sentation serait l<>g<EFBFBD>rement diff<66>rente.<br>";
|
||||||
//code 39
|
print "Codes num<75>riques utilis<69>s exclusivement <20> l'identification des produits susceptibles d'<27>tre vendus au grand public.";
|
||||||
$var=!$var;
|
print '</td>';
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
|
||||||
print "Code 39";
|
|
||||||
print "</td><td>\n";
|
|
||||||
print "Premier code alpha num<75>rique utilis<69> massivement dans l'Industrie pour sa capacit<69> d'encodage (chiffres et lettres)<br>";
|
|
||||||
print "ainsi que par son degr<67> de s<>curit<69> <20> l'encodage (clef de contr<74>le).<br>";
|
|
||||||
print "Il met a disposition les 10 chiffres, les 26 lettres de l'alphabet et sept symboles.<br>";
|
|
||||||
print "l'ast<73>risque (*) sert de caract<63>re de bornage. La lecture est bidirectionnelle.<br>";
|
|
||||||
print "La longueur est variable mais en g<>n<EFBFBD>ral ne d<>passe pas 32 caract<63>res.";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
// Affiche exemple
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('1234567890','39',1).'"></td>';
|
print '<td align="center"><img src="'.dol_genbarcode('123456789012','UPC',1).'"></td>';
|
||||||
|
|
||||||
print '<td align="center">';
|
|
||||||
print $formbarcode->setBarcodeEncoder('C39','form'.$i);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
$i++;
|
|
||||||
|
|
||||||
|
|
||||||
//code 128
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
|
||||||
print "Code 128";
|
|
||||||
print "</td><td>\n";
|
|
||||||
print "Ce code \"derni<EFBFBD>re g<>n<EFBFBD>ration\" alpha num<75>rique est susceptible d'encoder les 128 caract<63>res de la table ASCII ( chiffres + lettres + symboles ).<br>";
|
|
||||||
print "Le code 128 poss<73>de des algorithmes de cryptage s<>curis<69>s assez avanc<6E>s.<br>";
|
|
||||||
print "C'est le plus complet des codes <20> barres, il propose 3 jeux de 128 caract<63>res.<br>";
|
|
||||||
print "La lecture est bidirectionnelle.<br>";
|
|
||||||
print "La longueur est variable mais en g<>n<EFBFBD>ral ne d<>passe pas 20 caract<63>res.";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
print '<td align="center">';
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('ABCD1234567890','128',1).'"></td>';
|
print $formbarcode->setBarcodeEncoder('UPC','form'.$i);
|
||||||
|
print "</td></tr>\n";
|
||||||
print '<td align="center">';
|
$i++;
|
||||||
print $formbarcode->setBarcodeEncoder('C128','form'.$i);
|
|
||||||
print "</td></tr>\n";
|
//ISBN
|
||||||
$i++;
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
//I25
|
print "ISBN";
|
||||||
$var=!$var;
|
print "</td><td>\n";
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
print "Le code ISBN est un code d<>di<64> au milieu de la presse <20>crite.";
|
||||||
print "I25";
|
print '</td>';
|
||||||
print "</td><td>\n";
|
|
||||||
print "information";
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Affiche exemple
|
// Affiche exemple
|
||||||
print '<td align="center"><img src="'.dol_genbarcode('1234567890','I25',1).'"></td>';
|
print '<td align="center"><img src="'.dol_genbarcode('123456789','ISBN',1).'"></td>';
|
||||||
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $formbarcode->setBarcodeEncoder('I25','form'.$i);
|
print $formbarcode->setBarcodeEncoder('ISBN','form'.$i);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
*/
|
|
||||||
|
//code 39
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print "Code 39";
|
||||||
|
print "</td><td>\n";
|
||||||
|
print "Premier code alpha num<75>rique utilis<69> massivement dans l'Industrie pour sa capacit<69> d'encodage (chiffres et lettres)<br>";
|
||||||
|
print "ainsi que par son degr<67> de s<>curit<69> <20> l'encodage (clef de contr<74>le).<br>";
|
||||||
|
print "Il met a disposition les 10 chiffres, les 26 lettres de l'alphabet et sept symboles.<br>";
|
||||||
|
print "l'ast<73>risque (*) sert de caract<63>re de bornage. La lecture est bidirectionnelle.<br>";
|
||||||
|
print "La longueur est variable mais en g<>n<EFBFBD>ral ne d<>passe pas 32 caract<63>res.";
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Affiche exemple
|
||||||
|
print '<td align="center"><img src="'.dol_genbarcode('1234567890','39',1).'"></td>';
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $formbarcode->setBarcodeEncoder('C39','form'.$i);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
|
||||||
|
//code 128
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print "Code 128";
|
||||||
|
print "</td><td>\n";
|
||||||
|
print "Ce code \"derni<EFBFBD>re g<>n<EFBFBD>ration\" alpha num<75>rique est susceptible d'encoder les 128 caract<63>res de la table ASCII ( chiffres + lettres + symboles ).<br>";
|
||||||
|
print "Le code 128 poss<73>de des algorithmes de cryptage s<>curis<69>s assez avanc<6E>s.<br>";
|
||||||
|
print "C'est le plus complet des codes <20> barres, il propose 3 jeux de 128 caract<63>res.<br>";
|
||||||
|
print "La lecture est bidirectionnelle.<br>";
|
||||||
|
print "La longueur est variable mais en g<>n<EFBFBD>ral ne d<>passe pas 20 caract<63>res.";
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Affiche exemple
|
||||||
|
print '<td align="center"><img src="'.dol_genbarcode('ABCD1234567890','128',1).'"></td>';
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $formbarcode->setBarcodeEncoder('C128','form'.$i);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
//I25
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
|
print "I25";
|
||||||
|
print "</td><td>\n";
|
||||||
|
print "information";
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Affiche exemple
|
||||||
|
print '<td align="center"><img src="'.dol_genbarcode('1234567890','I25',1).'"></td>';
|
||||||
|
|
||||||
|
print '<td align="center">';
|
||||||
|
print $formbarcode->setBarcodeEncoder('I25','form'.$i);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
$i++;
|
||||||
|
*/
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/admin/produit.php
|
\file htdocs/admin/produit.php
|
||||||
\ingroup produit
|
\ingroup produit
|
||||||
\brief Page d'administration/configuration du module Produit
|
\brief Page d'administration/configuration du module Produit
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
@ -36,87 +36,87 @@ $langs->load("propal");
|
|||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
if ($_POST["action"] == 'nbprod')
|
if ($_POST["action"] == 'nbprod')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", $_POST["value"]);
|
dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", $_POST["value"]);
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'multiprix_num')
|
else if ($_POST["action"] == 'multiprix_num')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", $_POST["value"]);
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", $_POST["value"]);
|
||||||
}
|
}
|
||||||
if ($_POST["action"] == 'multiprix')
|
if ($_POST["action"] == 'multiprix')
|
||||||
{
|
{
|
||||||
$res=$db->DDLDescTable(MAIN_DB_PREFIX."societe","price_level");
|
$res=$db->DDLDescTable(MAIN_DB_PREFIX."societe","price_level");
|
||||||
if(! $db->fetch_row($res))
|
if(! $db->fetch_row($res))
|
||||||
{
|
{
|
||||||
$field_desc = array('type'=>'TINYINT','value'=>'4','default'=>'1');
|
$field_desc = array('type'=>'TINYINT','value'=>'4','default'=>'1');
|
||||||
if ($_POST["activate_multiprix"])
|
if ($_POST["activate_multiprix"])
|
||||||
{
|
{
|
||||||
// on ajoute le champ price_level dans la table societe
|
// on ajoute le champ price_level dans la table societe
|
||||||
if ($db->DDLAddField(MAIN_DB_PREFIX."societe","price_level",$field_desc) < 0)
|
if ($db->DDLAddField(MAIN_DB_PREFIX."societe","price_level",$field_desc) < 0)
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Table definition for ".MAIN_DB_PREFIX."societe already ok");
|
dolibarr_syslog("Table definition for ".MAIN_DB_PREFIX."societe already ok");
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'sousproduits')
|
else if ($_POST["action"] == 'sousproduits')
|
||||||
{
|
{
|
||||||
$res=$db->DDLDescTable(MAIN_DB_PREFIX."product_association");
|
$res=$db->DDLDescTable(MAIN_DB_PREFIX."product_association");
|
||||||
if(! $db->fetch_row($res))
|
if(! $db->fetch_row($res))
|
||||||
{
|
|
||||||
$table = MAIN_DB_PREFIX."product_association";
|
|
||||||
$fields['fk_product_pere'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
|
||||||
$fields['fk_product_fils'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
|
||||||
$fields['qty'] = array('type'=>'double','default'=> 'null');
|
|
||||||
$keys['idx_product_association_fk_product_pere'] = "fk_product_pere" ;
|
|
||||||
$keys['idx_product_association_fk_product_fils'] = "fk_product_fils" ;
|
|
||||||
if ($db->DDLCreateTable($table,$fields,"","InnoDB","","",$keys) < 0)
|
|
||||||
{
|
{
|
||||||
|
$table = MAIN_DB_PREFIX."product_association";
|
||||||
|
$fields['fk_product_pere'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
||||||
|
$fields['fk_product_fils'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
||||||
|
$fields['qty'] = array('type'=>'double','default'=> 'null');
|
||||||
|
$keys['idx_product_association_fk_product_pere'] = "fk_product_pere" ;
|
||||||
|
$keys['idx_product_association_fk_product_fils'] = "fk_product_fils" ;
|
||||||
|
if ($db->DDLCreateTable($table,$fields,"","InnoDB","","",$keys) < 0)
|
||||||
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Table definition already ok");
|
||||||
|
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_syslog("Table definition already ok");
|
|
||||||
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'viewProdDescInForm')
|
else if ($_POST["action"] == 'viewProdDescInForm')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $_POST["activate_viewProdDescInForm"]);
|
dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $_POST["activate_viewProdDescInForm"]);
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'confirmDeleteProdLineInForm')
|
else if ($_POST["action"] == 'confirmDeleteProdLineInForm')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_CONFIRM_DELETE_LINE", $_POST["activate_confirmDeleteProdLineInForm"]);
|
dolibarr_set_const($db, "PRODUIT_CONFIRM_DELETE_LINE", $_POST["activate_confirmDeleteProdLineInForm"]);
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'ProductCanvasAbility')
|
else if ($_POST["action"] == 'ProductCanvasAbility')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]);
|
dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]);
|
||||||
// Create temp directory for smarty
|
// Create temp directory for smarty
|
||||||
if (! empty($dolibarr_smarty_compile)) create_exdir($dolibarr_smarty_compile);
|
if (! empty($dolibarr_smarty_compile)) create_exdir($dolibarr_smarty_compile);
|
||||||
if (! empty($dolibarr_smarty_cache)) create_exdir($dolibarr_smarty_cache);
|
if (! empty($dolibarr_smarty_cache)) create_exdir($dolibarr_smarty_cache);
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'usesearchtoselectproduct')
|
else if ($_POST["action"] == 'usesearchtoselectproduct')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]);
|
dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]);
|
||||||
}
|
}
|
||||||
else if ($_GET["action"] == 'set')
|
else if ($_GET["action"] == 'set')
|
||||||
{
|
{
|
||||||
@ -126,11 +126,7 @@ else if ($_GET["action"] == 'set')
|
|||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'useecotaxe')
|
else if ($_POST["action"] == 'useecotaxe')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_USE_ECOTAXE", $_POST["activate_useecotaxe"]);
|
dolibarr_set_const($db, "PRODUIT_USE_ECOTAXE", $_POST["activate_useecotaxe"]);
|
||||||
}
|
|
||||||
else if ($_POST["action"] == 'setdefaultbarcodetype')
|
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $_POST["coder_id"]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -186,15 +182,15 @@ print '</form>';
|
|||||||
// multiprix nombre de prix a proposer
|
// multiprix nombre de prix a proposer
|
||||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<form method=\"post\" action=\"produit.php\">";
|
print "<form method=\"post\" action=\"produit.php\">";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"multiprix_num\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"multiprix_num\">";
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
|
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
|
||||||
print "<td align=\"right\"><input size=\"3\" type=\"text\" class=\"flat\" name=\"value\" value=\"".$conf->global->PRODUIT_MULTIPRICES_LIMIT."\"></td>";
|
print "<td align=\"right\"><input size=\"3\" type=\"text\" class=\"flat\" name=\"value\" value=\"".$conf->global->PRODUIT_MULTIPRICES_LIMIT."\"></td>";
|
||||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// sousproduits activation/desactivation
|
// sousproduits activation/desactivation
|
||||||
@ -219,17 +215,17 @@ print "<tr ".$bc[$var].">";
|
|||||||
print '<td>'.$langs->trans("UseSearchToSelectProduct").'</td>';
|
print '<td>'.$langs->trans("UseSearchToSelectProduct").'</td>';
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<td nowrap="nowrap" align="right" colspan="2">';
|
print '<td nowrap="nowrap" align="right" colspan="2">';
|
||||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td width="60" align="right">';
|
print '<td width="60" align="right">';
|
||||||
print $html->selectyesno("activate_usesearchtoselectproduct",$conf->global->PRODUIT_USE_SEARCH_TO_SELECT,1);
|
print $html->selectyesno("activate_usesearchtoselectproduct",$conf->global->PRODUIT_USE_SEARCH_TO_SELECT,1);
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -276,25 +272,9 @@ print "</td>";
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
// Barcode
|
|
||||||
if ($conf->global->MAIN_MODULE_BARCODE)
|
|
||||||
{
|
|
||||||
$var=!$var;
|
|
||||||
print "<form method=\"post\" action=\"produit.php\">";
|
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"setdefaultbarcodetype\">";
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td>'.$langs->trans("SetDefaultBarcodeType").'</td>';
|
|
||||||
print '<td width="60" align="right">';
|
|
||||||
print $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"coder_id",1);
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
||||||
print "</td>";
|
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet)
|
// Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet)
|
||||||
if (eregi('^rodolphe',$conf->left_menu) || eregi('^auguria',$conf->left_menu))
|
if (eregi('^rodolphe',$conf->left_menu) || eregi('^auguria',$conf->left_menu))
|
||||||
{
|
{
|
||||||
// Propose utilisation de canvas.
|
// Propose utilisation de canvas.
|
||||||
// Ces derniers ne sont geres que par le menu default
|
// Ces derniers ne sont geres que par le menu default
|
||||||
@ -330,30 +310,30 @@ if (eregi('^rodolphe',$conf->left_menu) || eregi('^auguria',$conf->left_menu))
|
|||||||
if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.')
|
if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.')
|
||||||
{
|
{
|
||||||
$parts = explode('.',$file);
|
$parts = explode('.',$file);
|
||||||
$classname = 'Product'.ucfirst($parts[1]);
|
$classname = 'Product'.ucfirst($parts[1]);
|
||||||
require_once($dir.$file);
|
require_once($dir.$file);
|
||||||
$module = new $classname();
|
$module = new $classname();
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]><td>";
|
print "<tr $bc[$var]><td>";
|
||||||
|
|
||||||
print $module->description;
|
print $module->description;
|
||||||
|
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
|
|
||||||
$const = "PRODUIT_SPECIAL_".strtoupper($parts[1]);
|
$const = "PRODUIT_SPECIAL_".strtoupper($parts[1]);
|
||||||
if ($conf->global->$const)
|
if ($conf->global->$const)
|
||||||
{
|
{
|
||||||
print img_tick();
|
print img_tick();
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$parts[1].'&value=0">'.$langs->trans("Disable").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$parts[1].'&value=0">'.$langs->trans("Disable").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print ' </td><td align="right">';
|
print ' </td><td align="right">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$parts[1].'&value=1">'.$langs->trans("Activate").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&spe='.$parts[1].'&value=1">'.$langs->trans("Activate").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
365
htdocs/compta/facture/retardspaiement.php
Normal file
365
htdocs/compta/facture/retardspaiement.php
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com>
|
||||||
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/compta/facture/retardspaiement.php
|
||||||
|
\ingroup facture
|
||||||
|
\brief Page de liste des factures clients impayées
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
||||||
|
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$facid = isset($_GET["facid"])?$_GET["facid"]:'';
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'facture',$facid,'');
|
||||||
|
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans("BillsLate"));
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
?><script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
function checkall(checked){
|
||||||
|
var checkboxes = [];
|
||||||
|
checkboxes = $$('input').each(function(e){ if(e.type == 'checkbox') checkboxes.push(e) });
|
||||||
|
checkboxes.each(function(e){ e.checked = checked });
|
||||||
|
}
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* Mode Liste *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
$page = $_GET["page"];
|
||||||
|
$sortfield=$_GET["sortfield"];
|
||||||
|
$sortorder=$_GET["sortorder"];
|
||||||
|
if (! $sortfield) $sortfield="f.date_lim_reglement";
|
||||||
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
|
if ($user->rights->facture->lire)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if ($_POST["action"] == "generate_pdf"){
|
||||||
|
if(is_array($_POST['toGenerate']))
|
||||||
|
{
|
||||||
|
|
||||||
|
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ;
|
||||||
|
|
||||||
|
// liste les fichiers
|
||||||
|
$files = array() ;
|
||||||
|
$factures_bak = $factures ;
|
||||||
|
foreach($_POST['toGenerate'] as $basename){
|
||||||
|
foreach($factures as $facture){
|
||||||
|
if(strstr($facture["name"],$basename)){
|
||||||
|
$files[] = DOL_DATA_ROOT . '/facture/' . $basename . '/' . $facture["name"] ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// génère le PDF à partir de tous les autres fichiers
|
||||||
|
$pdf=new FPDI();
|
||||||
|
foreach($files as $file){
|
||||||
|
// Charge un document PDF depuis un fichier.
|
||||||
|
$pagecount = $pdf->setSourceFile($file);
|
||||||
|
for ($i = 1; $i <= $pagecount; $i++) {
|
||||||
|
$tplidx = $pdf->ImportPage($i);
|
||||||
|
$s = $pdf->getTemplatesize($tplidx);
|
||||||
|
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||||
|
$pdf->useTemplate($tplidx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// vérifie que le chemin d'accès est bien accessible
|
||||||
|
if(!is_dir(DOL_DATA_ROOT . '/facture/impayes')) mkdir(DOL_DATA_ROOT . '/facture/impayes') ;
|
||||||
|
|
||||||
|
// enregistre le fichier pdf concaténé
|
||||||
|
$pdf->Output( DOL_DATA_ROOT . '/facture/impayes/impayes '.dolibarr_date('Y-m-d H:i:s',time()).'.pdf');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
print '<div class="error">'.$langs->trans('UnpayedNotChecked').'</div>' ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$limit = $conf->liste_limit;
|
||||||
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
|
$sql = "SELECT s.nom, s.rowid as socid";
|
||||||
|
$sql.= ", f.facnumber,f.increment,f.total as total_ht,f.total_ttc";
|
||||||
|
$sql.= ", ".$db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite";
|
||||||
|
$sql.= ", f.paye as paye, f.rowid as facid, f.fk_statut";
|
||||||
|
$sql.= ", sum(pf.amount) as am";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= ",".MAIN_DB_PREFIX."facture as f";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture ";
|
||||||
|
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND f.paye = 0 AND f.fk_statut = 1 AND f.date_lim_reglement < NOW()";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
|
|
||||||
|
if ($_GET["filtre"])
|
||||||
|
{
|
||||||
|
$filtrearr = split(",", $_GET["filtre"]);
|
||||||
|
foreach ($filtrearr as $fil)
|
||||||
|
{
|
||||||
|
$filt = split(":", $fil);
|
||||||
|
$sql .= " AND " . $filt[0] . " = " . $filt[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["search_ref"])
|
||||||
|
{
|
||||||
|
$sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["search_societe"])
|
||||||
|
{
|
||||||
|
$sql .= " AND s.nom like '%".$_GET["search_societe"]."%'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["search_montant_ht"])
|
||||||
|
{
|
||||||
|
$sql .= " AND f.total = '".$_GET["search_montant_ht"]."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["search_montant_ttc"])
|
||||||
|
{
|
||||||
|
$sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($_POST["sf_ref"]) > 0)
|
||||||
|
{
|
||||||
|
$sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'";
|
||||||
|
}
|
||||||
|
$sql.= " GROUP BY f.facnumber";
|
||||||
|
|
||||||
|
$sql.= " ORDER BY ";
|
||||||
|
$listfield=split(',',$sortfield);
|
||||||
|
foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.",";
|
||||||
|
$sql.= " f.facnumber DESC";
|
||||||
|
|
||||||
|
//$sql .= $db->plimit($limit+1,$offset);
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
|
if ($socid)
|
||||||
|
{
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($socid);
|
||||||
|
}
|
||||||
|
|
||||||
|
$titre=($socid?$langs->trans("BillsCustomersUnpayedForCompany",$soc->nom):$langs->trans("BillsLate"));
|
||||||
|
print_barre_liste($titre,$page,"retardspaiement.php","&socid=$socid",$sortfield,$sortorder,'',0); // We don't want pagination on this page
|
||||||
|
$i = 0;
|
||||||
|
print '<table class="liste" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
|
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Generate"),$_SERVER["PHP_SELF"],"");
|
||||||
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","","&socid=$socid",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","","&socid=$socid",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Lignes des champs de filtre
|
||||||
|
print '<form method="get" action="retardspaiement.php">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td class="liste_titre" valign="right">';
|
||||||
|
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_GET["search_ref"].'"></td>';
|
||||||
|
print '<td class="liste_titre" align="center"><input type="checkbox" onclick="checkall(this.checked);"></td>';
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
print '<td class="liste_titre" align="left">';
|
||||||
|
print '<input class="flat" type="text" name="search_societe" value="'.$_GET["search_societe"].'">';
|
||||||
|
print '</td><td class="liste_titre" align="right">';
|
||||||
|
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET["search_montant_ht"].'">';
|
||||||
|
print '</td><td class="liste_titre" align="right">';
|
||||||
|
print '<input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$_GET["search_montant_ttc"].'">';
|
||||||
|
print '</td><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 '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
$facturestatic=new Facture($db);
|
||||||
|
|
||||||
|
if ($num > 0)
|
||||||
|
{
|
||||||
|
$var=True;
|
||||||
|
$total_ht=0;
|
||||||
|
$total_ttc=0;
|
||||||
|
$total_payed=0;
|
||||||
|
|
||||||
|
print '<form id="form_generate_pdf" method="post" action="retardspaiement.php?sortfield='. $_GET['sortfield'] .'&sortorder='. $_GET['sortorder'] .'">';
|
||||||
|
print '<input type="hidden" name="action" value="generate_pdf">';
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
$class = "impayee";
|
||||||
|
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
|
||||||
|
$facturestatic->id=$objp->facid;
|
||||||
|
$facturestatic->ref=$objp->facnumber;
|
||||||
|
$facturestatic->type=$objp->type;
|
||||||
|
|
||||||
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
|
print '<td width="90" class="nobordernopadding" nowrap="nowrap">';
|
||||||
|
print $facturestatic->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
|
||||||
|
if ($objp->datelimite < (time() - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
|
|
||||||
|
$filename=sanitize_string($objp->facnumber);
|
||||||
|
$filedir=$conf->facture->dir_output . '/' . sanitize_string($objp->facnumber);
|
||||||
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
|
||||||
|
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
|
||||||
|
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print '<td align="center"><input id="cb'.$objp->facid.'" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'"></td>' ;
|
||||||
|
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
print "<td nowrap align=\"center\">".dolibarr_print_date($objp->df)."</td>\n";
|
||||||
|
print "<td nowrap align=\"center\">".dolibarr_print_date($objp->datelimite)."</td>\n";
|
||||||
|
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'</a></td>';
|
||||||
|
|
||||||
|
print "<td align=\"right\">".price($objp->total_ht)."</td>";
|
||||||
|
print "<td align=\"right\">".price($objp->total_ttc)."</td>";
|
||||||
|
print "<td align=\"right\">".price($objp->am)."</td>";
|
||||||
|
|
||||||
|
// Affiche statut de la facture
|
||||||
|
print '<td align="right" nowrap="nowrap">';
|
||||||
|
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
$total_ht+=$objp->total_ht;
|
||||||
|
$total_ttc+=$objp->total_ttc;
|
||||||
|
$total_payed+=$objp->am;
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print "<td colspan=\"4\" align=\"left\">".$langs->trans("Total").": </td>";
|
||||||
|
print "<td align=\"right\"><b>".price($total_ht)."</b></td>";
|
||||||
|
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>";
|
||||||
|
print "<td align=\"right\"><b>".price($total_payed)."</b></td>";
|
||||||
|
print '<td align="center"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gestion des documents générés
|
||||||
|
*/
|
||||||
|
$filedir=$conf->facture->dir_output . '/impayes';
|
||||||
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
||||||
|
$genallowed=$user->rights->facture->creer;
|
||||||
|
$delallowed=$user->rights->facture->supprimer;
|
||||||
|
|
||||||
|
//class="pair" ou "impair" pour les tr
|
||||||
|
$var = false ; $bc = array("pair","impair") ;
|
||||||
|
|
||||||
|
// liste des fichier
|
||||||
|
$file_list=dol_dir_list($filedir,'files',0,'impayes.*','\.meta$','date',SORT_DESC);;
|
||||||
|
|
||||||
|
print '<br>' ;
|
||||||
|
print_titre($langs->trans("Documents"));
|
||||||
|
print '<table class="border" width="60%">';
|
||||||
|
print '<tr class="liste_titre">' ;
|
||||||
|
print '<td align="center">'.$langs->trans("File").'</td><td align="center" width="20%">'.$langs->trans("Size").'</td><td align="center" width="20%">'.$langs->trans("Date").'</td><td align="center" width="20%"><input type="submit" value="'.$langs->trans("Generate").'"></td>' ;
|
||||||
|
print '</tr>' ;
|
||||||
|
// Pour chaque fichier on affiche une ligne
|
||||||
|
foreach($file_list as $file){
|
||||||
|
$filepath = $filedir."/".$file["name"] ;
|
||||||
|
$var = !$var ;
|
||||||
|
print '<tr class="'.$bc[$var].'">' ;
|
||||||
|
// Nom du fichier
|
||||||
|
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=impayes&file='.urlencode($filepath).'">'.img_pdf($file["name"],2)." ".$file["name"].'</td>' ;
|
||||||
|
// Taille
|
||||||
|
print '<td align="center" width="20%">'.filesize($filepath). ' bytes</td>' ;
|
||||||
|
// Date
|
||||||
|
print '<td align="center" width="20%">'.dolibarr_print_date(filemtime($filepath),'dayhour').'</td>' ;
|
||||||
|
// Suppression
|
||||||
|
print '<td align="center" width="20%"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&modulepart=impayes&file='.urlencode($filepath).'&urlsource='.urlencode($urlsource).'">'.img_delete().'</a></td>' ;
|
||||||
|
print '</tr>' ;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
$db->free();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|
||||||
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
?>
|
||||||
@ -108,6 +108,16 @@ if ($modulepart)
|
|||||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='$refname'";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='$refname'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($modulepart == 'impayes')
|
||||||
|
{
|
||||||
|
$user->getrights('facture');
|
||||||
|
if ($user->rights->facture->lire || eregi('^specimen',$original_file))
|
||||||
|
{
|
||||||
|
$accessallowed=1;
|
||||||
|
}
|
||||||
|
$original_file=$original_file;
|
||||||
|
}
|
||||||
|
|
||||||
// Wrapping pour les fiches intervention
|
// Wrapping pour les fiches intervention
|
||||||
if ($modulepart == 'ficheinter')
|
if ($modulepart == 'ficheinter')
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -111,7 +111,7 @@ if ($_GET["id"])
|
|||||||
* Ajouter une photo
|
* Ajouter une photo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $product->isproduct() && $conf->upload)
|
if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $conf->upload)
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("AddPhoto"));
|
print_titre($langs->trans("AddPhoto"));
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
if ($_GET["action"] == '')
|
if ($_GET["action"] == '')
|
||||||
{
|
{
|
||||||
if ( $user->rights->produit->creer && $product->isproduct() && $conf->upload)
|
if ( $user->rights->produit->creer && $conf->upload)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="photos.php?action=ajout_photo&id='.$product->id.'">';
|
print '<a class="butAction" href="photos.php?action=ajout_photo&id='.$product->id.'">';
|
||||||
print $langs->trans("AddPhoto").'</a>';
|
print $langs->trans("AddPhoto").'</a>';
|
||||||
|
|||||||
@ -425,6 +425,8 @@ class MenuLeft {
|
|||||||
}
|
}
|
||||||
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire);
|
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire);
|
||||||
|
|
||||||
|
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/retardspaiement.php?leftmenu=customers_bills",$langs->trans("BillsLate"),2,$user->rights->facture->lire);
|
||||||
|
|
||||||
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
|
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
|
||||||
|
|
||||||
if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
|
if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
|
||||||
|
|||||||
@ -826,7 +826,8 @@ ModifyProductDescAbility=Personalization of descriptions produced in the forms
|
|||||||
ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip)
|
ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip)
|
||||||
UseSearchToSelectProduct=Use a search form to choose a product (intead of using a list box)
|
UseSearchToSelectProduct=Use a search form to choose a product (intead of using a list box)
|
||||||
UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
|
UseEcoTaxeAbility=Support Eco-Taxe (WEEE)
|
||||||
SetDefaultBarcodeType=Default barcode type to use for products
|
SetDefaultBarcodeTypeProducts=Default barcode type to use for products
|
||||||
|
SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties
|
||||||
##### Syslog #####
|
##### Syslog #####
|
||||||
SyslogSetup=Syslog module setup
|
SyslogSetup=Syslog module setup
|
||||||
SyslogOutput=Log output
|
SyslogOutput=Log output
|
||||||
|
|||||||
@ -930,7 +930,7 @@ ModifyProductDescAbility=Personalizaci
|
|||||||
ViewProductDescInFormAbility=Visualización de las descripciones de los productos en los formularios
|
ViewProductDescInFormAbility=Visualización de las descripciones de los productos en los formularios
|
||||||
UseSearchToSelectProduct=Utilizar un formulario de búsqueda para la selección de un producto (en vez de la lista desplegable)
|
UseSearchToSelectProduct=Utilizar un formulario de búsqueda para la selección de un producto (en vez de la lista desplegable)
|
||||||
UseEcoTaxeAbility=Asumir ecotasa (DEEE)
|
UseEcoTaxeAbility=Asumir ecotasa (DEEE)
|
||||||
SetDefaultBarcodeType=tipo códigos de barra utiliazdos por defecto para los productos
|
SetDefaultBarcodeTypeProducts=tipo códigos de barra utiliazdos por defecto para los productos
|
||||||
##### Suppliers #####
|
##### Suppliers #####
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -826,7 +826,8 @@ ViewProductDescInFormAbility=Visualisation des descriptions produits dans les fo
|
|||||||
UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un produit (plutôt que liste déroulante)
|
UseSearchToSelectProduct=Utiliser un formulaire de recherche pour choix d'un produit (plutôt que liste déroulante)
|
||||||
UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE)
|
UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE)
|
||||||
UseMinPrice=Utilisation d'un prix minimum de vente
|
UseMinPrice=Utilisation d'un prix minimum de vente
|
||||||
SetDefaultBarcodeType=Type de code barre utilisé par défaut pour les produits
|
SetDefaultBarcodeTypeProducts=Type de code barre utilisé par défaut pour les produits
|
||||||
|
SetDefaultBarcodeTypeThirdParties=Type de code barre utilisé par défaut pour les tiers
|
||||||
##### Suppliers #####
|
##### Suppliers #####
|
||||||
SuppliersSetup=Configuration du module Fournisseur
|
SuppliersSetup=Configuration du module Fournisseur
|
||||||
##### Syslog #####
|
##### Syslog #####
|
||||||
|
|||||||
@ -7,6 +7,7 @@ BillsCustomersUnpayed=Factures clients impay
|
|||||||
BillsCustomersUnpayedForCompany=Factures clients impayées pour %s
|
BillsCustomersUnpayedForCompany=Factures clients impayées pour %s
|
||||||
BillsSuppliersUnpayed=Factures fournisseurs impayées
|
BillsSuppliersUnpayed=Factures fournisseurs impayées
|
||||||
BillsUnpayed=Impayées
|
BillsUnpayed=Impayées
|
||||||
|
BillsLate=Retards de paiement
|
||||||
BillsStatistics=Statistiques factures
|
BillsStatistics=Statistiques factures
|
||||||
InvoiceStandard=Facture standard
|
InvoiceStandard=Facture standard
|
||||||
InvoiceStandardAsk=Facture standard
|
InvoiceStandardAsk=Facture standard
|
||||||
@ -233,6 +234,7 @@ InvoicePayed=Facture pay
|
|||||||
PaymentNumber=Numéro paiement
|
PaymentNumber=Numéro paiement
|
||||||
RemoveDiscount=Supprimer remise
|
RemoveDiscount=Supprimer remise
|
||||||
WatermarkOnDraftBill=Filigrane sur les brouillons de factures (aucun si vide)
|
WatermarkOnDraftBill=Filigrane sur les brouillons de factures (aucun si vide)
|
||||||
|
UnpayedNotChecked=Aucune facture impayées n'a été sélectionnée
|
||||||
|
|
||||||
# PaymentConditions
|
# PaymentConditions
|
||||||
PaymentConditionShortRECEP=A réception
|
PaymentConditionShortRECEP=A réception
|
||||||
|
|||||||
@ -19,233 +19,233 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/lib/product.lib.php
|
\file htdocs/lib/product.lib.php
|
||||||
\brief Ensemble de fonctions de base pour le module produit et service
|
\brief Ensemble de fonctions de base pour le module produit et service
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function product_prepare_head($product, $user)
|
function product_prepare_head($product, $user)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
|
||||||
$head[$h][1] = $langs->trans("Price");
|
$head[$h][1] = $langs->trans("Price");
|
||||||
$head[$h][2] = 'price';
|
$head[$h][2] = 'price';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
||||||
$head[$h][1] = $langs->trans("Photos");
|
$head[$h][1] = $langs->trans("Photos");
|
||||||
$head[$h][2] = 'photos';
|
$head[$h][2] = 'photos';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
//affichage onglet cat<61>gorie
|
//affichage onglet cat<61>gorie
|
||||||
if ($conf->categorie->enabled)
|
if ($conf->categorie->enabled)
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans('Categories');
|
|
||||||
$head[$h][2] = 'category';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affichage onglet code barre
|
|
||||||
if ($conf->global->MAIN_MODULE_BARCODE && $product->isproduct() && $user->rights->barcode->lire)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans("BarCode");
|
|
||||||
$head[$h][2] = 'barcode';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Multilangs
|
|
||||||
if($conf->global->MAIN_MULTILANGS)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans("Translation");
|
|
||||||
$head[$h][2] = 'translation';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// sousproduits
|
|
||||||
if($conf->global->PRODUIT_SOUSPRODUITS == 1)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/sousproduits/fiche.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans('AssociatedProducts');
|
|
||||||
$head[$h][2] = 'subproduct';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($conf->fournisseur->enabled)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans("Suppliers");
|
|
||||||
$head[$h][2] = 'suppliers';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans('Statistics');
|
|
||||||
$head[$h][2] = 'stats';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
|
|
||||||
$head[$h][1] = $langs->trans('Referers');
|
|
||||||
$head[$h][2] = 'referers';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
|
|
||||||
$head[$h][1] = $langs->trans('Documents');
|
|
||||||
$head[$h][2] = 'documents';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
if($product->isproduct()) // Si produit stockable
|
|
||||||
{
|
|
||||||
if ($conf->stock->enabled)
|
|
||||||
{
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans('Categories');
|
||||||
|
$head[$h][2] = 'category';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage onglet code barre
|
||||||
|
if ($conf->global->MAIN_MODULE_BARCODE)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans("BarCode");
|
||||||
|
$head[$h][2] = 'barcode';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multilangs
|
||||||
|
if($conf->global->MAIN_MULTILANGS)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans("Translation");
|
||||||
|
$head[$h][2] = 'translation';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sousproduits
|
||||||
|
if($conf->global->PRODUIT_SOUSPRODUITS == 1)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/sousproduits/fiche.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans('AssociatedProducts');
|
||||||
|
$head[$h][2] = 'subproduct';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->fournisseur->enabled)
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans("Suppliers");
|
||||||
|
$head[$h][2] = 'suppliers';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans('Statistics');
|
||||||
|
$head[$h][2] = 'stats';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
|
||||||
|
$head[$h][1] = $langs->trans('Referers');
|
||||||
|
$head[$h][2] = 'referers';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
|
||||||
|
$head[$h][1] = $langs->trans('Documents');
|
||||||
|
$head[$h][2] = 'documents';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
if($product->isproduct()) // Si produit stockable
|
||||||
|
{
|
||||||
|
if ($conf->stock->enabled)
|
||||||
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
|
||||||
$head[$h][1] = $langs->trans("Stock");
|
$head[$h][1] = $langs->trans("Stock");
|
||||||
$head[$h][2] = 'stock';
|
$head[$h][2] = 'stock';
|
||||||
$h++;
|
$h++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Onglets additionnels pour les canvas
|
* Onglets additionnels pour les canvas
|
||||||
*/
|
*/
|
||||||
if(is_array($product->onglets))
|
if(is_array($product->onglets))
|
||||||
{
|
|
||||||
foreach ($product->onglets as $onglet)
|
|
||||||
{
|
{
|
||||||
|
foreach ($product->onglets as $onglet)
|
||||||
|
{
|
||||||
$head[$h] = $onglet;
|
$head[$h] = $onglet;
|
||||||
$h++;
|
$h++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function show_stats_for_company($product,$socid)
|
function show_stats_for_company($product,$socid)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user,$db;
|
global $conf,$langs,$user,$db;
|
||||||
|
|
||||||
print '<tr>';
|
|
||||||
print '<td align="left" width="25%" valign="top">'.$langs->trans("Referers").'</td>';
|
|
||||||
print '<td align="right" width="25%">'.$langs->trans("NbOfThirdParties").'</td>';
|
|
||||||
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
|
|
||||||
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Propals
|
|
||||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_propale($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("propal");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="propal.php?id='.$product->id.'">'.img_object('','propal').' '.$langs->trans("Proposals").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_propale['customers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_propale['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_propale['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Commandes clients
|
|
||||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_commande($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("orders");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande['customers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Commandes fournisseurs
|
|
||||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_commande_fournisseur($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("orders");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("SuppliersOrders").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande_fournisseur['suppliers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande_fournisseur['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_commande_fournisseur['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Contrats
|
|
||||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_contrat($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("contracts");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="contrat.php?id='.$product->id.'">'.img_object('','contract').' '.$langs->trans("Contracts").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_contrat['customers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_contrat['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_contrat['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Factures clients
|
|
||||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_facture($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("bills");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture['customers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
// Factures fournisseurs
|
|
||||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
|
||||||
{
|
|
||||||
$ret=$product->load_stats_facture_fournisseur($socid);
|
|
||||||
if ($ret < 0) dolibarr_print_error($db);
|
|
||||||
$langs->load("bills");
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("SuppliersInvoices").'</a>';
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture_fournisseur['suppliers'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture_fournisseur['nb'];
|
|
||||||
print '</td><td align="right">';
|
|
||||||
print $product->stats_facture_fournisseur['qty'];
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
print '<tr>';
|
||||||
|
print '<td align="left" width="25%" valign="top">'.$langs->trans("Referers").'</td>';
|
||||||
|
print '<td align="right" width="25%">'.$langs->trans("NbOfThirdParties").'</td>';
|
||||||
|
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
|
||||||
|
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Propals
|
||||||
|
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_propale($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("propal");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="propal.php?id='.$product->id.'">'.img_object('','propal').' '.$langs->trans("Proposals").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_propale['customers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_propale['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_propale['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
// Commandes clients
|
||||||
|
if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_commande($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("orders");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="commande.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("CustomersOrders").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande['customers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
// Commandes fournisseurs
|
||||||
|
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_commande_fournisseur($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("orders");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('','order').' '.$langs->trans("SuppliersOrders").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande_fournisseur['suppliers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande_fournisseur['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_commande_fournisseur['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
// Contrats
|
||||||
|
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_contrat($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("contracts");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="contrat.php?id='.$product->id.'">'.img_object('','contract').' '.$langs->trans("Contracts").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_contrat['customers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_contrat['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_contrat['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
// Factures clients
|
||||||
|
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_facture($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("bills");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="facture.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("CustomersInvoices").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture['customers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
// Factures fournisseurs
|
||||||
|
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||||
|
{
|
||||||
|
$ret=$product->load_stats_facture_fournisseur($socid);
|
||||||
|
if ($ret < 0) dolibarr_print_error($db);
|
||||||
|
$langs->load("bills");
|
||||||
|
print '<tr><td>';
|
||||||
|
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('','bill').' '.$langs->trans("SuppliersInvoices").'</a>';
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture_fournisseur['suppliers'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture_fournisseur['nb'];
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print $product->stats_facture_fournisseur['qty'];
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user