New: Add graph for orders.
This commit is contained in:
parent
4b5c1830b1
commit
5a6221629e
29
ChangeLog
29
ChangeLog
@ -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 graph using Jquery Flot.
|
||||||
- New: Add status for third parties.
|
- 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,50 +136,58 @@ 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>";
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
|
|
||||||
print '<tr><td align="center">';
|
|
||||||
|
|
||||||
$SommeA=0;
|
|
||||||
$SommeB=0;
|
|
||||||
$SommeC=0;
|
|
||||||
$SommeD=0;
|
|
||||||
$dataval=array();
|
|
||||||
$datalabels=array();
|
|
||||||
$dataseries=array();
|
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
|
||||||
{
|
|
||||||
$datalabels[]=$adhtype->getNomUrl(0,dol_size(16));
|
|
||||||
$dataval['draft'][]=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
|
||||||
$dataval['notuptodate'][]=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
|
||||||
$dataval['uptodate'][]=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
|
||||||
$dataval['resiliated'][]=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
|
||||||
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
|
||||||
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
|
||||||
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
|
||||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=> $dataval['draft']);
|
* Statistics
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataval['notuptodate']);
|
*/
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']);
|
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']);
|
if ($conf->use_javascript_ajax)
|
||||||
$data=array('series'=>$dataseries,'xlabel'=>$datalabels);
|
{
|
||||||
dol_print_graph('stats2',300,180,$data,1,'bar');
|
print '<br>';
|
||||||
$dataseries=array();
|
print '<table class="noborder" width="100%">';
|
||||||
*/
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB)));
|
print '<tr><td align="center">';
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC)));
|
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD)));
|
$SommeA=0;
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=>array(round($SommeA)));
|
$SommeB=0;
|
||||||
$data=array('series'=>$dataseries);
|
$SommeC=0;
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie');
|
$SommeD=0;
|
||||||
print '</td></tr>';
|
$dataval=array();
|
||||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
|
$datalabels=array();
|
||||||
print $SommeA+$SommeB+$SommeC+$SommeD;
|
$dataseries=array();
|
||||||
print '</td></tr>';
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
print '</table>';
|
{
|
||||||
|
$datalabels[]=$adhtype->getNomUrl(0,dol_size(16));
|
||||||
|
$dataval['draft'][]=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
||||||
|
$dataval['notuptodate'][]=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
||||||
|
$dataval['uptodate'][]=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
||||||
|
$dataval['resiliated'][]=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||||
|
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
||||||
|
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0;
|
||||||
|
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
||||||
|
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=> $dataval['draft']);
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=> $dataval['notuptodate']);
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=> $dataval['uptodate']);
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=> $dataval['resiliated']);
|
||||||
|
$data=array('series'=>$dataseries,'xlabel'=>$datalabels);
|
||||||
|
dol_print_graph('stats2',300,180,$data,1,'bar');
|
||||||
|
$dataseries=array();
|
||||||
|
*/
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'values'=>array(round($SommeB)));
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'values'=>array(round($SommeC)));
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'values'=>array(round($SommeD)));
|
||||||
|
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'values'=>array(round($SommeA)));
|
||||||
|
$data=array('series'=>$dataseries);
|
||||||
|
dol_print_graph('stats',300,180,$data,1,'pie');
|
||||||
|
print '</td></tr>';
|
||||||
|
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
|
||||||
|
print $SommeA+$SommeB+$SommeC+$SommeD;
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</td><td class="notopnoleftnoright" valign="top">';
|
print '</td><td class="notopnoleftnoright" valign="top">';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?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";
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,8 +40,8 @@ $langs->load("orders");
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("SuppliersOrdersArea"));
|
llxHeader('',$langs->trans("SuppliersOrdersArea"));
|
||||||
|
|
||||||
@ -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";
|
||||||
@ -87,34 +87,65 @@ $sql.= " GROUP BY cf.fk_statut";
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<table class="liste" width="100%">';
|
$var=True;
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Status").'</td>';
|
$total=0;
|
||||||
print '<td align="right">'.$langs->trans("Nb").'</td>';
|
$totalinprocess=0;
|
||||||
print "</tr>\n";
|
$dataseries=array();
|
||||||
$var=True;
|
$vals=array();
|
||||||
|
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
|
||||||
while ($i < $num)
|
// -> 7=Canceled/Never received -> (reopen) 3=Process runing
|
||||||
|
// -> 6=Canceled -> (reopen) 2=Approved
|
||||||
|
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];
|
||||||
print "</tr>\n";
|
}
|
||||||
$i++;
|
$total+=$row[0];
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
$db->free($resql);
|
||||||
$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(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>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -122,41 +153,41 @@ else
|
|||||||
*/
|
*/
|
||||||
if ($conf->fournisseur->enabled)
|
if ($conf->fournisseur->enabled)
|
||||||
{
|
{
|
||||||
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
$sql.= " AND c.entity = ".$conf->entity;
|
||||||
$sql.= " AND c.fk_statut = 0";
|
$sql.= " AND c.fk_statut = 0";
|
||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="2">'.$langs->trans("DraftOrders").'</td></tr>';
|
print '<td colspan="2">'.$langs->trans("DraftOrders").'</td></tr>';
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
|
print "<a href=\"fiche.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
|
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -178,35 +209,35 @@ $sql.= " AND subperms = 'approuver'";
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("UserWithApproveOrderGrant").'</td>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("UserWithApproveOrderGrant").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$userstatic->id=$obj->rowid;
|
$userstatic->id=$obj->rowid;
|
||||||
$userstatic->nom=$obj->name;
|
$userstatic->nom=$obj->name;
|
||||||
$userstatic->prenom=$obj->firstname;
|
$userstatic->prenom=$obj->firstname;
|
||||||
print $userstatic->getNomUrl(1);
|
print $userstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -234,52 +265,52 @@ $sql.= $db->plimit($max, 0);
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4">'.$langs->trans("LastModifiedOrders",$max).'</td></tr>';
|
print '<td colspan="4">'.$langs->trans("LastModifiedOrders",$max).'</td></tr>';
|
||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td width="20%" nowrap="nowrap">';
|
print '<td width="20%" nowrap="nowrap">';
|
||||||
|
|
||||||
$commandestatic->id=$obj->rowid;
|
$commandestatic->id=$obj->rowid;
|
||||||
$commandestatic->ref=$obj->ref;
|
$commandestatic->ref=$obj->ref;
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td width="94" class="nobordernopadding" nowrap="nowrap">';
|
print '<td width="94" class="nobordernopadding" nowrap="nowrap">';
|
||||||
print $commandestatic->getNomUrl(1);
|
print $commandestatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
|
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
||||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
|
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
@ -288,70 +319,70 @@ else dol_print_error($db);
|
|||||||
* Orders to process
|
* Orders to process
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
$sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
$sql.= " AND c.entity = ".$conf->entity;
|
||||||
$sql.= " AND c.fk_statut = 1";
|
$sql.= " AND c.fk_statut = 1";
|
||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " ORDER BY c.rowid DESC";
|
$sql.= " ORDER BY c.rowid DESC";
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=1">('.$num.')</a></td></tr>';
|
print '<td colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?viewstatut=1">('.$num.')</a></td></tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
|
|
||||||
$commandestatic->id=$obj->rowid;
|
$commandestatic->id=$obj->rowid;
|
||||||
$commandestatic->ref=$obj->ref;
|
$commandestatic->ref=$obj->ref;
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td width="94" class="nobordernopadding" nowrap="nowrap">';
|
print '<td width="94" class="nobordernopadding" nowrap="nowrap">';
|
||||||
print $commandestatic->getNomUrl(1);
|
print $commandestatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
|
print '<td width="16" class="nobordernopadding" nowrap="nowrap">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" align="right" class="nobordernopadding">';
|
print '<td width="16" align="right" class="nobordernopadding">';
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
|
||||||
|
|
||||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -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 @@
|
|||||||
|
|
||||||
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'));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user