Ajout tableau des montant de facture
This commit is contained in:
parent
1a6a287eef
commit
222e8e040f
@ -35,11 +35,50 @@ dolibarr_fiche_head($head, $hselected, "Contrats");
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
|
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top" width="50%">';
|
||||||
|
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=contrats/modereglement.png" alt="Mode de réglement" title="Mode de réglement"><br /><br />'."\n";
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=contrats/modereglement.png" alt="Mode de réglement" title="Mode de réglement"><br /><br />'."\n";
|
||||||
|
|
||||||
print '</td><td valign="top">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
|
$sql = "SELECT date_format(f.date, '%Y%m'), sum(f.cout_vente), c.mode_paiement";
|
||||||
|
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture as f";
|
||||||
|
$sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c";
|
||||||
|
$sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
|
||||||
|
|
||||||
|
$sql .= " WHERE f.fk_ligne = l.rowid";
|
||||||
|
$sql .= " AND l.fk_contrat = c.rowid";
|
||||||
|
|
||||||
|
$sql .= " GROUP BY date_format(f.date, '%Y%m'), c.mode_paiement";
|
||||||
|
$sql .= " ORDER BY date_format(f.date, '%Y%m') DESC";
|
||||||
|
$sql .= " LIMIT 10";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
print '<tr><td>Mois</td><td align="right">Montant</td><td align="center">Mode</td></tr>';
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows();
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
|
print '<tr><td>'.$row[0].'</td>';
|
||||||
|
print '<td align="right">'.sprintf("%01.2f",$row[1]).'</td>';
|
||||||
|
print '<td align="center">'.$row[2].'</td></tr>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user