diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index d3b72be9fb3..a72f52a7806 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -20,9 +20,16 @@
* $Source$
*
*/
+
+/**
+ \file htdocs/compta/resultat/clientfourn.php
+ \brief Page reporting resultat
+ \version $Revision$
+*/
+
require("./pre.inc.php");
-require("../../tva.class.php");
-require("../../chargesociales.class.php");
+require_once("../../tva.class.php");
+require_once("../../chargesociales.class.php");
$langs->load("bills");
@@ -30,39 +37,45 @@ $user->getrights('compta');
if (!$user->rights->compta->resultat->lire)
accessforbidden();
-
-llxHeader();
-
$year=$_GET["year"];
if (! $year) { $year = strftime("%Y", time()); }
$modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
-print_fiche_titre("Résultat exercice, par client/fournisseur",($year?" ".img_previous()." Année $year ".img_next()."":""));
-print '
';
-print "Cet état permet de faire un bilan des recettes et dépenses:
";
+llxHeader();
+
+$html=new Form($db);
+
+// Affiche en-tête de rapport
if ($modecompta=="CREANCES-DETTES")
{
- print $langs->trans("RulesResultDue");
- print '(Voir le rapport en recettes-dépenses pour n\'inclure que les factures effectivement payées).
';
- print '
';
+ $nom="Bilan des recettes et dépenses, détail";
+ $nom.=' (Voir le rapport en recettes-dépenses pour n\'inclure que les factures effectivement payées)';
+ $period="".img_previous()." ".$langs->trans("Year")." $year ".img_next()."";
+ $description=$langs->trans("RulesResultDue");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
else {
- print $langs->trans("RulesResultInOut");
- print '(Voir le rapport en créances-dettes pour inclure les factures non encore payée).
';
- print '
';
+ $nom="Bilan des recettes et dépenses, détail";
+ $nom.=' (Voir le rapport en créances-dettes pour inclure les factures non encore payée)';
+ $period="".img_previous()." ".$langs->trans("Year")." $year ".img_next()."";
+ $description=$langs->trans("RulesResultInOut");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
+$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
-
+// Affiche rapport
print '
';
print '';
print '| | '.$langs->trans("Element").' | ';
if ($modecompta == 'CREANCES-DETTES') print "".$langs->trans("AmountHT")." | ";
print "".$langs->trans("AmountTTC")." | ";
print "
\n";
-
+print '| |
';
/*
* Factures clients
@@ -133,28 +146,36 @@ if ($modecompta != 'CREANCES-DETTES') {
$num = $db->num_rows($result);
$i = 0;
$var=true;
- while ($i < $num)
- {
- $objp = $db->fetch_object($result);
- $var=!$var;
+ if ($num) {
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($result);
+ $var=!$var;
+
+ print "|   | ";
+ print "".$langs->trans("Bills")." ".$langs->trans("Other")."\n";
+ if ($modecompta == 'CREANCES-DETTES') print " | ".price($objp->amount_ht)." | \n";
+ print "".price($objp->amount_ttc)." | \n";
+
+ $total_ht = $total_ht + $objp->amount_ht;
+ $total_ttc = $total_ttc + $objp->amount_ttc;
+ print "
\n";
+ $i++;
+ }
+ }
+ else {
+ $var=!$var;
print "|   | ";
- print "".$langs->trans("Bills")." ".$langs->trans("Other")."\n";
-
- if ($modecompta == 'CREANCES-DETTES') print " | ".price($objp->amount_ht)." | \n";
- print "".price($objp->amount_ttc)." | \n";
-
- $total_ht = $total_ht + $objp->amount_ht;
- $total_ttc = $total_ttc + $objp->amount_ttc;
- print "
\n";
- $i++;
+ print ''.$langs->trans("None").' | ';
+ print '';
}
$db->free($result);
} else {
dolibarr_print_error($db);
}
}
-print '';
+print '
';
if ($modecompta == 'CREANCES-DETTES') print '| '.price($total_ht).' | ';
print ''.price($total_ttc).' | ';
print '
';
@@ -191,8 +212,8 @@ $result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
+ $var=true;
if ($num > 0) {
- $var=True;
while ($i < $num) {
$objp = $db->fetch_object($result);
$var=!$var;
@@ -211,6 +232,13 @@ if ($result) {
$i++;
}
}
+ else {
+ $var=!$var;
+ print "|   | ";
+ print ''.$langs->trans("None").' | ';
+ print '
';
+ }
+
$db->free($result);
} else {
dolibarr_print_error($db);
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index bc12bcacf79..803ada1f2aa 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -39,9 +39,6 @@ else {
$year_end=$year_start+2;
}
-
-llxHeader();
-
/*
* Sécurité accés client
*/
@@ -54,24 +51,30 @@ $modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
-$title="Résultat exercice, résumé annuel";
-$lien=($year_start?"".img_previous()." ".img_next()."":"");
-print_fiche_titre($title,$lien);
-print '
';
+llxHeader();
-// Affiche règles de calcul
-print "Cet état permet de faire un bilan des recettes et dépenses:
\n";
+$html=new Form($db);
+
+// Affiche en-tête du rapport
if ($modecompta=="CREANCES-DETTES")
{
- print $langs->trans("RulesResultDue");
- print '(Voir le rapport recettes-dépenses pour n\'inclure que les factures effectivement payées).
';
- print '
';
+ $nom="Bilan des recettes et dépenses, résumé annuel";
+ $nom.=' (Voir le rapport recettes-dépenses pour n\'inclure que les factures effectivement payées)';
+ $period=($year_start?"".img_previous()." ".img_next()."":"");
+ $description=$langs->trans("RulesResultDue");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
else {
- print $langs->trans("RulesResultInOut");
- print '(Voir le rapport en créances-dettes pour inclure les factures non encore payée).
';
- print '
';
+ $nom="Bilan des recettes et dépenses, résumé annuel";
+ $nom.=' (Voir le rapport en créances-dettes pour inclure les factures non encore payée)';
+ $period=($year_start?"".img_previous()." ".img_next()."":"");
+ $description=$langs->trans("RulesResultInOut");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
+$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
+
/*
* Factures clients
@@ -287,7 +290,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
}
$var=!$var;
-print "| ".$langs->trans("TotalTTC")." | ";
+print '
| '.$langs->trans("TotalTTC").' | ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print ''.price($totentrees[$annee]).' | '.price($totsorties[$annee]).' | ';
@@ -298,6 +301,6 @@ print "
";
$db->close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+llxFooter('$Date$ - $Revision$');
?>
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index b239cd971a5..a99dbec249e 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -39,9 +39,6 @@ else {
$year_end=$year_start + 4;
}
-
-llxHeader();
-
/*
* Sécurité accés client
*/
@@ -53,32 +50,32 @@ if ($user->societe_id > 0)
$modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
-if ($modecompta=='CREANCES-DETTES') {
- $title="Chiffre d'affaire (".$conf->monnaie." HT)";
-} else {
- $title="Chiffre d'affaire (".$conf->monnaie." TTC)";
-}
-$lien=($year_start?"".img_previous()." ".img_next()."":"");
-
-print_fiche_titre($title,$lien);
-// Affiche règles de calcul
-print "
";
-print "Cet état présente le CA:
\n";
+llxHeader();
+
+
+$html=new Form($db);
+
+// Affiche en-tête du rapport
if ($modecompta=="CREANCES-DETTES")
{
- print $langs->trans("RulesCADue");
- print '(Voir le rapport recettes-dépenses pour n\'inclure que les factures effectivement payées).
';
- print '
';
+ $nom="Chiffre d'affaire (".$conf->monnaie." HT)";
+ $nom.=' (Voir le rapport recettes-dépenses pour n\'inclure que les factures effectivement payées)';
+ $period=($year_start?"".img_previous()." ".img_next()."":"");
+ $description=$langs->trans("RulesCADue");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
else {
- print $langs->trans("RulesCAIn");
- print '(Voir le rapport en créances-dettes pour inclure les factures non encore payée).
';
- print '
';
+ $nom="Chiffre d'affaire (".$conf->monnaie." TTC)";
+ $nom.=' (Voir le rapport en créances-dettes pour inclure les factures non encore payée)';
+ $period=($year_start?"".img_previous()." ".img_next()."":"");
+ $description=$langs->trans("RulesCAIn");
+ $builddate=time();
+ $exportlink=$langs->trans("NotYetAvailable");
}
-
-print '
';
+$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
if ($modecompta == 'CREANCES-DETTES') {
@@ -220,13 +217,13 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
}
// Affiche total
-print "| ".$langs->trans("Total")." : | ";
+print '
| '.$langs->trans("Total").': | ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
// Montant total
if ($annee >= $minyear && $annee <= max($nowyear,$maxyear))
{
- print "".($total[$annee]?price($total[$annee]):"0")." | ";
+ print "".($total[$annee]?price($total[$annee]):"0")." | ";
}
else
{
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index c75a4df5370..6b0f5c1b713 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -219,4 +219,8 @@ AttachedFiles=Attached files and documents
FileTransferComplete=File was updloaded successfuly
DateFormatYYYYMM=YYYY-MM
DateFormatYYYYMMDD=YYYY-MM-DD
-DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
\ No newline at end of file
+DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
+ReportName=Report name
+ReportPeriod=Report period
+ReportDescription=Description
+Report=Report
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 2289ddc7846..f6034dc9ead 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -220,3 +220,7 @@ FileTransferComplete=Le fichier a
DateFormatYYYYMM=YYYY-MM
DateFormatYYYYMMDD=YYYY-MM-DD
DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
+ReportName=Nom du rapport
+ReportPeriod=Période d'analyse
+ReportDescription=Description
+Report=Rapport
\ No newline at end of file