Skip to content
Snippets Groups Projects
Commit 5ea37d78 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: limit prefix_com field

Fix: use invoice field entity in stat
Fix: replaced invoice is already with statut 3
parent de4cf814
No related branches found
No related tags found
No related merge requests found
......@@ -58,20 +58,20 @@ class FactureStats extends Stats
if ($mode == 'customer')
{
$object=new Facture($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as p, ".MAIN_DB_PREFIX."societe as s";
$this->from = MAIN_DB_PREFIX.$object->table_element;
$this->field='total';
}
if ($mode == 'supplier')
{
$object=new FactureFournisseur($this->db);
$this->from = MAIN_DB_PREFIX.$object->table_element." as p, ".MAIN_DB_PREFIX."societe as s";
$this->from = MAIN_DB_PREFIX.$object->table_element;
$this->field='total_ht';
}
$this->socid = $socid;
$this->where =" fk_statut > 0";
$this->where.= " AND p.fk_soc = s.rowid AND s.entity = ".$conf->entity;
if ($mode == 'customer') $this->where.=" AND (fk_statut != 3 OR close_code != 'replaced')"; // Exclude replaced invoices
$this->where.= " AND entity = ".$conf->entity;
if ($mode == 'customer') $this->where.=" AND fk_statut != 3"; // Exclude replaced invoices
if ($this->socid)
{
$this->where.=" AND fk_soc = ".$this->socid;
......@@ -81,7 +81,7 @@ class FactureStats extends Stats
/**
* \brief Renvoie le nombre de facture par anne
* \brief Renvoie le nombre de facture par annee
* \return array Array of values
*/
function getNbByYear()
......@@ -96,7 +96,7 @@ class FactureStats extends Stats
/**
* \brief Renvoie le nombre de facture par mois pour une anne donne
* \brief Renvoie le nombre de facture par mois pour une annee donnee
* \param year Year to scan
* \return array Array of values
*/
......@@ -115,7 +115,7 @@ class FactureStats extends Stats
/**
* \brief Renvoie le montant de facture par mois pour une anne donne
* \brief Renvoie le montant de facture par mois pour une annee donnee
* \param year Year to scan
* \return array Array of values
*/
......
......@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php");
$WIDTH=500;
$HEIGHT=200;
// Scurit accs client
// Securite acces client
if ($user->societe_id > 0)
{
$action = '';
......
......@@ -397,7 +397,7 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
if ($soc->particulier)
{
print '<tr><td>'.$langs->trans('LastName').'</td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
print '<tr><td>'.$langs->trans('FirstName').'</td><td><input type="text" size="30" name="prenom" value="'.$soc->firstname.'"></td>';
print '<td colspan=2>&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
......@@ -407,7 +407,7 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
else
{
print '<tr><td>'.$langs->trans('Name').'</td><td><input type="text" size="30" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
}
// Client / Prospect
......@@ -735,7 +735,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
}
else
{
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
print '<input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
}
print '</td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment