New: Ajout ligne total
This commit is contained in:
parent
aa013f14ac
commit
c1f0a2721b
@ -173,11 +173,6 @@ if ($db->query($sql))
|
||||
}
|
||||
}
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td> </td>';
|
||||
print '<td align="right">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total).'</td><td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
$db->free();
|
||||
|
||||
@ -53,7 +53,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$nom="Bilan des recettes et dépenses, détail";
|
||||
$nom.=' (Voir le rapport en <a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
|
||||
$period='<a href='.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous()."</a> ".$langs->trans("Year")." ".$year.' <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$period=$langs->trans("Year")." ".$year;
|
||||
$periodlink='<a href='.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$description=$langs->trans("RulesResultDue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -61,7 +62,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
else {
|
||||
$nom="Bilan des recettes et dépenses, détail";
|
||||
$nom.=' (Voir le rapport en <a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
|
||||
$period='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous()."</a> ".$langs->trans("Year")." ".$year.' <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$period=$langs->trans("Year")." ".$year;
|
||||
$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$description=$langs->trans("RulesResultInOut");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -429,7 +431,7 @@ $subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$var=true;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
@ -532,7 +534,7 @@ print '<tr>';
|
||||
print '<td colspan="4"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">Résultat</td>';
|
||||
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Profit").'</td>';
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td class="border" align="right">'.price($total_ht).'</td>';
|
||||
print '<td class="border" align="right">'.price($total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -61,7 +61,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$nom="Bilan des recettes et dépenses, résumé annuel";
|
||||
$nom.=' (Voir le rapport <a href="index.php?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
|
||||
$period=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$period="$year_start - $year_end";
|
||||
$periodlink=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesResultDue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -69,7 +70,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
else {
|
||||
$nom="Bilan des recettes et dépenses, résumé annuel";
|
||||
$nom.=' (Voir le rapport en <a href="index.php?year_start='.$year_start.'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
|
||||
$period=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$period="$year_start - $year_end";
|
||||
$periodlink=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesResultInOut");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -383,7 +385,8 @@ print '</tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("Income").'</td><td align="right">'.$langs->trans("Outcome").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Outcome").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Income").'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -395,6 +398,15 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
print "<td>".strftime("%B",mktime(1,1,1,$mois,1,$annee))."</td>";
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right"> ';
|
||||
$case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee));
|
||||
if ($decaiss_ttc[$case]>0)
|
||||
{
|
||||
print price($decaiss_ttc[$case]);
|
||||
$totsorties[$annee]+=$decaiss_ttc[$case];
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td align="right"> ';
|
||||
$case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee));
|
||||
if ($encaiss_ttc[$case]>0)
|
||||
@ -404,14 +416,6 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td align="right"> ';
|
||||
$case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee));
|
||||
if ($decaiss_ttc[$case]>0)
|
||||
{
|
||||
print price($decaiss_ttc[$case]);
|
||||
$totsorties[$annee]+=$decaiss_ttc[$case];
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
@ -419,20 +423,27 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
|
||||
// Total
|
||||
$var=!$var;
|
||||
$nbcols=0;
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("TotalTTC").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right">'.(isset($totentrees[$annee])?price($totentrees[$annee]):' ').'</td>';
|
||||
print '<td align="right">'.(isset($totsorties[$annee])?price($totsorties[$annee]):' ').'</td>';
|
||||
$nbcols+=2;
|
||||
print '<td align="right">'.(isset($totsorties[$annee])?price($totsorties[$annee]):' ').'</td>';
|
||||
print '<td align="right">'.(isset($totentrees[$annee])?price($totentrees[$annee]):' ').'</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
// Ligne vierge
|
||||
print '<tr><td> </td>';
|
||||
print '<td colspan="'.$nbcols.'"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Balance
|
||||
$var=!$var;
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Profit").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="center" colspan="2"> ';
|
||||
print '<td align="right" colspan="2"> ';
|
||||
if (isset($totentrees[$annee]) || isset($totsorties[$annee])) {
|
||||
print price($totentrees[$annee]-$totsorties[$annee]).'</td>';
|
||||
// print '<td> </td>';
|
||||
|
||||
@ -37,8 +37,8 @@ if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
||||
|
||||
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
if (! $sortorder) $sortorder="desc";
|
||||
if (! $sortfield) $sortfield="amount_ttc";
|
||||
if (! $sortorder) $sortorder="asc";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0) $socidp = $user->societe_id;
|
||||
@ -54,7 +54,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$nom="Chiffre d'affaire par utilisateur, auteur de la facture";
|
||||
$nom.=' (Voir le rapport <a href="'.$_SERVER["PHP_SELF"].'?year='.($year).'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
|
||||
$period="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
|
||||
$period=$langs->trans("Year")." $year";
|
||||
$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
|
||||
$description=$langs->trans("RulesCADue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -62,7 +63,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
else {
|
||||
$nom="Chiffre d'affaire par utilisateur, auteur de la facture";
|
||||
$nom.=' (Voir le rapport en <a href="'.$_SERVER["PHP_SELF"].'?year='.($year).'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
|
||||
$period="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
|
||||
$period=$langs->trans("Year")." $year";
|
||||
$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
|
||||
$description=$langs->trans("RulesCAIn");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -157,11 +159,11 @@ if (sizeof($amount))
|
||||
$arrayforsort=$name;
|
||||
|
||||
// On définit tableau arrayforsort
|
||||
if ($sortfield == 'nom' && $sortorder == 'asc') {
|
||||
if ($sortfield == 'name' && $sortorder == 'asc') {
|
||||
asort($name);
|
||||
$arrayforsort=$name;
|
||||
}
|
||||
if ($sortfield == 'nom' && $sortorder == 'desc') {
|
||||
if ($sortfield == 'name' && $sortorder == 'desc') {
|
||||
arsort($name);
|
||||
$arrayforsort=$name;
|
||||
}
|
||||
@ -174,7 +176,7 @@ if (sizeof($amount))
|
||||
$arrayforsort=$amount;
|
||||
}
|
||||
|
||||
foreach($amount as $key=>$value)
|
||||
foreach($arrayforsort as $key=>$value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -36,8 +36,8 @@ if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
||||
|
||||
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
if (! $sortorder) $sortorder="desc";
|
||||
if (! $sortfield) $sortfield="amount_ttc";
|
||||
if (! $sortorder) $sortorder="asc";
|
||||
if (! $sortfield) $sortfield="nom";
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0) $socidp = $user->societe_id;
|
||||
@ -52,7 +52,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$nom="Chiffre d'affaire par société";
|
||||
$nom.=' (Voir le rapport en <a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
|
||||
$period='<a href='.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous()."</a> ".$langs->trans("Year")." ".$year.' <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$period=$langs->trans("Year")." ".$year;
|
||||
$periodlink='<a href='.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$description=$langs->trans("RulesCADue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -60,7 +61,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
else {
|
||||
$nom="Chiffre d'affaire par société";
|
||||
$nom.=' (Voir le rapport en <a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
|
||||
$period='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous()."</a> ".$langs->trans("Year")." ".$year.' <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$period=$langs->trans("Year")." ".$year;
|
||||
$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
|
||||
$description=$langs->trans("RulesCAIn");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
||||
@ -62,7 +62,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
$nom="Chiffre d'affaire";
|
||||
$nom.=' (Voir le rapport <a href="index.php?year_start='.($year_start).'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
|
||||
$period=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$period="$year_start - $year_end";
|
||||
$periodlink=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesCADue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -70,7 +71,8 @@ if ($modecompta=="CREANCES-DETTES")
|
||||
else {
|
||||
$nom="Chiffre d'affaire";
|
||||
$nom.=' (Voir le rapport en <a href="index.php?year_start='.($year_start).'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
|
||||
$period=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$period="$year_start - $year_end";
|
||||
$periodlink=($year_start?"<a href='index.php?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='index.php?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesCAIn");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
@ -156,7 +158,7 @@ print '<tr class="liste_titre"><td rowspan="2">'.$langs->trans("Month").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="center" width="10%" colspan="2"><a href="casoc.php?year='.$annee.'">'.$annee.'</a></td>';
|
||||
print '<td width="15"> </td>';
|
||||
if ($annee != $year_end) print '<td width="15"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -164,8 +166,8 @@ print '<tr class="liste_titre">';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Delta").'</td>';
|
||||
print '<td width="15"> </td>';
|
||||
print '<td align="right">'.$langs->trans("Delta").'</td>';
|
||||
if ($annee != $year_end) print '<td width="15"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -231,21 +233,21 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td align="right">';
|
||||
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
|
||||
else { print ' '; }
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
$total[$annee]+=$cum[$case];
|
||||
print '<td width="15"> </td>';
|
||||
if ($annee != $year_end) print '<td width="15"> </td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Affiche total
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").':</td>';
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
// Montant total
|
||||
@ -279,13 +281,13 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<td align="right">';
|
||||
if ($minyear <= $annee && $annee <= max($nowyear,$maxyear)) { print '-'; }
|
||||
else { print ' '; }
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td width="15"> </td>';
|
||||
if ($annee != $year_end) print '<td width="15"> </td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
@ -50,7 +50,6 @@ function llxHeader($head = "") {
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/stats/prev.php","Prévisionnel");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/stats/comp.php","Transformé");
|
||||
}
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/stats/exercices.php","Evolution");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/stats/casoc.php",$langs->trans("ByCompanies"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/compta/stats/cabyuser.php",$langs->trans("ByUsers"));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user