Skip to content
Snippets Groups Projects
Commit 5a622162 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Add graph for orders.

parent 4b5c1830
No related branches found
No related tags found
No related merge requests found
...@@ -15,44 +15,47 @@ For users: ...@@ -15,44 +15,47 @@ For users:
(Save 2 clicks). (Save 2 clicks).
- In commercial main menu, left menu are already opened. This save one click - In commercial main menu, left menu are already opened. This save one click
to open a proposal or order. to open a proposal or order.
- New: First graph using javascripts. - Can add a discount for third party, during invoice edition (and we
- New: Can add a discount for third party, during invoice edition (and we
saved clicks again). saved clicks again).
- New: Add status for third parties. - New: Add graph using Jquery Flot.
- New: Usage of Jquery Notify to show result or error messages on action.
- New: Add status for third parties to disable a third party.
- New: Can send interventions cards by email. - New: Can send interventions cards by email.
- New: Add option MAIN_FIRST_TO_UPPER to force upper case of first - New: Add option MAIN_FIRST_TO_UPPER to force upper case of first
letters for names and firstname. letters for names and firstname.
- New: Can filter of payment type in bank transaction list. - New: Can filter of payment type in bank transaction list.
- New: Status is visible into user list. - New: Status of users is visible into user list.
- New: Support BSB code for bank account in australia. - New: Support BSB code for bank account in australia.
- New: Can set date of payment for autocreate invoice/payment when - New: Can set date of payment for autocreate invoice/payment when
creating a foundation subscription. creating a foundation subscription.
- New: Can edit note of payment. - New: Can edit note of payment.
- New: Login is not mandatory in member module. - New: Login is not mandatory in member module.
- New: Add box last members for foundation module. - New: Add box for last members for foundation module.
- New: A specialized menu is now used when using smartphones. - New: A specialized menu can now be used when using smartphones.
- New: Can add information on current user on odt generation - New: Can add information on current user on odt generation
- New: Prefix on third party is not used by default. Hidden option - New: Prefix on third party is not used by default. Hidden option
SOCIETE_USEPREFIX can restore old feature. SOCIETE_USEPREFIX can restore old feature.
- New: Standing orders module use bank account from banks module. - New: Standing orders module use bank account from banks module.
- New: Ask password when creating a user from a contact. - New: Ask password when creating a user from a contact.
- New: task #10577: Use a numbering module for shipment and contract - New: task #10577: Use a numbering module for shipment and contract.
- New: Can create manually order from proposal.
- New: Add a first workflow module to create automatic action on some - New: Add a first workflow module to create automatic action on some
events (create order on proposal closing). events (create order on proposal closing).
- New: Can create manually order from proposal.
- New: Use autocompletion on invoice select when creating replacement - New: Use autocompletion on invoice select when creating replacement
or credit note invoice. or credit note invoice.
- New: task #10885: Add a week view for calendar - New: task #10885: Add a week view for calendar.
- New: task #11018 : Add a status "not applicable" on event - New: task #11018: Add a status "not applicable" on events.
- New: Add country/region/town statistics for member module. - New: Add country/region/town statistics for member module.
- New: Can define a proxy for external web access. - New: Can define a proxy for external web access.
- New: task #11003: checkbox on checks to deposit - New: task #11003: checkbox on checks to deposit
- New: Numbering module for invoice use same number for invoice
and credit note if mask is same.
- New: Add status into export. Add default language into export. - New: Add status into export. Add default language into export.
- New: Can remove a project if project has tasks. - New: Can remove a project if project has tasks.
- New: Can filter on date when building cheque receipts. - New: Can filter on date when building cheque receipts.
- New: Paypal module can show paypal list of transaction and convert one
into an order.
- Fix: Better Postgresql compatibility. - Fix: Better Postgresql compatibility.
- Fix: Numbering module for invoices use same number for invoice
and credit note if mask is same.
For developers: For developers:
- New: External modules can add tabs on agenda views. - New: External modules can add tabs on agenda views.
......
...@@ -136,6 +136,13 @@ print $langs->trans("Other").':</td><td><input type="text" name="sall" class="fl ...@@ -136,6 +136,13 @@ print $langs->trans("Other").':</td><td><input type="text" name="sall" class="fl
print '</td></tr>'; print '</td></tr>';
print "</table></form>"; print "</table></form>";
/*
* Statistics
*/
if ($conf->use_javascript_ajax)
{
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
...@@ -180,6 +187,7 @@ print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="rig ...@@ -180,6 +187,7 @@ print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="rig
print $SommeA+$SommeB+$SommeC+$SommeD; print $SommeA+$SommeB+$SommeC+$SommeD;
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
}
print '</td><td class="notopnoleftnoright" valign="top">'; print '</td><td class="notopnoleftnoright" valign="top">';
......
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -77,7 +77,82 @@ print "</form></table><br>\n"; ...@@ -77,7 +77,82 @@ print "</form></table><br>\n";
/* /*
* Commandes brouillons * Statistics
*/
$sql = "SELECT count(cf.rowid), cf.fk_statut, cf.facture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as cf";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE cf.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
if ($user->societe_id) $sql.=' AND cf.fk_soc = '.$user->societe_id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY cf.fk_statut, cf.facture";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=True;
$total=0;
$totalinprocess=0;
$dataseries=array();
$vals=array();
// -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not)
while ($i < $num)
{
$row = $db->fetch_row($resql);
if ($row)
{
if ($row[1]!=3 || $row[2]!=1)
{
$vals[$row[1]]=$row[0];
$totalinprocess+=$row[0];
}
$total+=$row[0];
}
$i++;
}
$db->free($resql);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
print "</tr>\n";
foreach (array(1,2,3,-1) as $statut)
{
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,0),'values'=>array(0=>(isset($vals[$statut])?$vals[$statut]:0)));
if (! $conf->use_javascript_ajax)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.$commandestatic->LibStatut($statut,0).'</td>';
print '<td align="right"><a href="liste.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
print "</tr>\n";
}
}
if ($conf->use_javascript_ajax)
{
print '<tr><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie');
print '</td></tr>';
}
//if ($totalinprocess != $total)
print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("CustomersOrders").')</td><td align="right">'.$total.'</td></tr>';
print "</table><br>";
}
else
{
dol_print_error($db);
}
/*
* Draft orders
*/ */
if ($conf->commande->enabled) if ($conf->commande->enabled)
{ {
......
...@@ -71,7 +71,7 @@ print "</form></table><br>\n"; ...@@ -71,7 +71,7 @@ print "</form></table><br>\n";
/* /*
* Legends / Status * Statistics
*/ */
$sql = "SELECT count(cf.rowid), fk_statut"; $sql = "SELECT count(cf.rowid), fk_statut";
...@@ -90,27 +90,58 @@ if ($resql) ...@@ -90,27 +90,58 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
print '<table class="liste" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Status").'</td>';
print '<td align="right">'.$langs->trans("Nb").'</td>';
print "</tr>\n";
$var=True; $var=True;
$total=0;
$totalinprocess=0;
$dataseries=array();
$vals=array();
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
// -> 7=Canceled/Never received -> (reopen) 3=Process runing
// -> 6=Canceled -> (reopen) 2=Approved
while ($i < $num) while ($i < $num)
{ {
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
$var=!$var; if ($row)
{
print "<tr $bc[$var]>"; if ($row[1]!=7 && $row[1]!=6 && $row[1]!=5)
print '<td>'.$langs->trans($commandestatic->statuts[$row[1]]).'</td>'; {
print '<td align="right"><a href="liste.php?statut='.$row[1].'">'.$row[0].' '.$commandestatic->LibStatut($row[1],3).'</a></td>'; $vals[$row[1]]=$row[0];
$totalinprocess+=$row[0];
}
$total+=$row[0];
}
$i++;
}
$db->free($resql);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
print "</tr>\n"; print "</tr>\n";
$i++; foreach (array(0,1,2,3,4) as $statut)
{
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,0),'values'=>array(0=>(isset($vals[$statut])?$vals[$statut]:0)));
if (! $conf->use_javascript_ajax)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.$commandestatic->LibStatut($statut,0).'</td>';
print '<td align="right"><a href="liste.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
print "</tr>\n";
}
}
if ($conf->use_javascript_ajax)
{
print '<tr><td align="center" colspan="2">';
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie');
print '</td></tr>';
} }
//if ($totalinprocess != $total)
print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrdersRunning").')</td><td align="right">'.$totalinprocess.'</td></tr>';
print '<tr class="liste_total"><td>'.$langs->trans("Total").' ('.$langs->trans("SuppliersOrders").')</td><td align="right">'.$total.'</td></tr>';
print "</table><br>"; print "</table><br>";
$db->free($resql);
} }
else else
{ {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224); $theme_bordercolor = array(235,235,224);
$theme_datacolor = array(array(120,130,150), array(200,160,180), array(190,190,220), array(140,170,150)); $theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170));
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224); $theme_bordercolor = array(235,235,224);
$theme_datacolor = array(array(120,130,150), array(200,160,180), array(190,190,220), array(140,170,150)); $theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170));
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment