27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31 $langs->loadLangs(array(
'banks',
'categories'));
34 if ($user->socid) $socid = $user->socid;
42 $companystatic =
new Societe($db);
49 print '<table class="noborder centpercent">';
50 print
"<tr class=\"liste_titre\">";
51 print
'<td>'.$langs->trans(
"Rubrique").
'</td>';
52 print
'<td class="right">'.$langs->trans(
"Nb").
'</td>';
53 print
'<td class="right">'.$langs->trans(
"Total").
'</td>';
54 print
'<td class="right">'.$langs->trans(
"Average").
'</td>';
57 $sql =
"SELECT sum(d.amount) as somme, count(*) as nombre, c.label, c.rowid ";
58 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_categ as c";
59 $sql .=
", ".MAIN_DB_PREFIX.
"bank_class as l";
60 $sql .=
", ".MAIN_DB_PREFIX.
"bank as d";
61 $sql .=
" WHERE c.entity = ".$conf->entity;
62 $sql .=
" AND c.rowid = l.fk_categ";
63 $sql .=
" AND d.rowid = l.lineid";
64 $sql .=
" GROUP BY c.label, c.rowid";
65 $sql .=
" ORDER BY c.label";
67 $result = $db->query($sql);
70 $num = $db->num_rows($result);
71 $i = 0; $total = 0; $totalnb = 0;
75 $objp = $db->fetch_object($result);
77 print
'<tr class="oddeven">';
78 print
"<td><a href=\"".DOL_URL_ROOT.
"/compta/bank/bankentries_list.php?bid=$objp->rowid\">$objp->label</a></td>";
79 print
'<td class="right">'.$objp->nombre.
'</td>';
80 print
'<td class="right">'.price(abs($objp->somme)).
"</td>";
81 print
'<td class="right">'.price(abs(
price2num($objp->somme / $objp->nombre,
'MT'))).
"</td>";
84 $total += abs($objp->somme);
85 $totalnb += $objp->nombre;
89 print
'<tr class="liste_total"><td colspan="2">'.$langs->trans(
"Total").
'</td>';
90 print
'<td class="liste_total right">'.price($total).
'</td>';
91 print
'<td colspan="2" class="liste_total right">'.price($totalnb ?
price2num($total / $totalnb,
'MT') : 0).
'</td></tr>';
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...