Quelques améliorations et traduction sur les rapports bilans recette-dépenses et CA

Ajout d'un cartouche commun
Utilisation du style liste_total pour les totaux.
This commit is contained in:
Laurent Destailleur 2005-05-03 00:41:51 +00:00
parent 3065fe12a4
commit 7a31971c32
5 changed files with 109 additions and 73 deletions

View File

@ -20,9 +20,16 @@
* $Source$ * $Source$
* *
*/ */
/**
\file htdocs/compta/resultat/clientfourn.php
\brief Page reporting resultat
\version $Revision$
*/
require("./pre.inc.php"); require("./pre.inc.php");
require("../../tva.class.php"); require_once("../../tva.class.php");
require("../../chargesociales.class.php"); require_once("../../chargesociales.class.php");
$langs->load("bills"); $langs->load("bills");
@ -30,39 +37,45 @@ $user->getrights('compta');
if (!$user->rights->compta->resultat->lire) if (!$user->rights->compta->resultat->lire)
accessforbidden(); accessforbidden();
llxHeader();
$year=$_GET["year"]; $year=$_GET["year"];
if (! $year) { $year = strftime("%Y", time()); } if (! $year) { $year = strftime("%Y", time()); }
$modecompta = $conf->compta->mode; $modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
print_fiche_titre("Résultat exercice, par client/fournisseur",($year?"&nbsp; <a href='clientfourn.php?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> Année $year <a href='clientfourn.php?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>":""));
print '<br>';
print "Cet état permet de faire un bilan des recettes et dépenses:<br>"; llxHeader();
$html=new Form($db);
// Affiche en-tête de rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
print $langs->trans("RulesResultDue"); $nom="Bilan des recettes et dépenses, détail";
print '(Voir le rapport en <a href="clientfourn.php?year='.$year.'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées).<br>'; $nom.=' (Voir le rapport en <a href="clientfourn.php?year='.$year.'&modecompta=RECETTES-DEPENSES">recettes-dépenses</a> pour n\'inclure que les factures effectivement payées)';
print '<br>'; $period="<a href='clientfourn.php?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='clientfourn.php?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
$description=$langs->trans("RulesResultDue");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
else { else {
print $langs->trans("RulesResultInOut"); $nom="Bilan des recettes et dépenses, détail";
print '(Voir le rapport en <a href="clientfourn.php?year='.$year.'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée).<br>'; $nom.=' (Voir le rapport en <a href="clientfourn.php?year='.$year.'&modecompta=CREANCES-DETTES">créances-dettes</a> pour inclure les factures non encore payée)';
print '<br>'; $period="<a href='clientfourn.php?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='clientfourn.php?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
$description=$langs->trans("RulesResultInOut");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
// Affiche rapport
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="10%">&nbsp;</td><td>'.$langs->trans("Element").'</td>'; print '<td width="10%">&nbsp;</td><td>'.$langs->trans("Element").'</td>';
if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".$langs->trans("AmountHT")."</td>"; if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".$langs->trans("AmountHT")."</td>";
print "<td align=\"right\">".$langs->trans("AmountTTC")."</td>"; print "<td align=\"right\">".$langs->trans("AmountTTC")."</td>";
print "</tr>\n"; print "</tr>\n";
print '<tr><td colspan="4">&nbsp;</td></tr>';
/* /*
* Factures clients * Factures clients
@ -133,28 +146,36 @@ if ($modecompta != 'CREANCES-DETTES') {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$var=true; $var=true;
while ($i < $num) if ($num) {
{ while ($i < $num)
$objp = $db->fetch_object($result); {
$var=!$var; $objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]><td>&nbsp</td>";
print "<td>".$langs->trans("Bills")." ".$langs->trans("Other")."\n";
if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".price($objp->amount_ht)."</td>\n";
print "<td align=\"right\">".price($objp->amount_ttc)."</td>\n";
$total_ht = $total_ht + $objp->amount_ht;
$total_ttc = $total_ttc + $objp->amount_ttc;
print "</tr>\n";
$i++;
}
}
else {
$var=!$var;
print "<tr $bc[$var]><td>&nbsp</td>"; print "<tr $bc[$var]><td>&nbsp</td>";
print "<td>".$langs->trans("Bills")." ".$langs->trans("Other")."\n"; print '<td colspan="3">'.$langs->trans("None").'</td>';
print '</tr>';
if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".price($objp->amount_ht)."</td>\n";
print "<td align=\"right\">".price($objp->amount_ttc)."</td>\n";
$total_ht = $total_ht + $objp->amount_ht;
$total_ttc = $total_ttc + $objp->amount_ttc;
print "</tr>\n";
$i++;
} }
$db->free($result); $db->free($result);
} else { } else {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
print '<tr>'; print '<tr class="liste_total">';
if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" align="right">'.price($total_ht).'</td>'; if ($modecompta == 'CREANCES-DETTES') print '<td colspan="3" align="right">'.price($total_ht).'</td>';
print '<td colspan="3" align="right">'.price($total_ttc).'</td>'; print '<td colspan="3" align="right">'.price($total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -191,8 +212,8 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$var=true;
if ($num > 0) { if ($num > 0) {
$var=True;
while ($i < $num) { while ($i < $num) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var=!$var; $var=!$var;
@ -211,6 +232,13 @@ if ($result) {
$i++; $i++;
} }
} }
else {
$var=!$var;
print "<tr $bc[$var]><td>&nbsp</td>";
print '<td colspan="3">'.$langs->trans("None").'</td>';
print '</tr>';
}
$db->free($result); $db->free($result);
} else { } else {
dolibarr_print_error($db); dolibarr_print_error($db);

View File

@ -39,9 +39,6 @@ else {
$year_end=$year_start+2; $year_end=$year_start+2;
} }
llxHeader();
/* /*
* Sécurité accés client * Sécurité accés client
*/ */
@ -54,24 +51,30 @@ $modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
$title="Résultat exercice, résumé annuel"; llxHeader();
$lien=($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>":"");
print_fiche_titre($title,$lien);
print '<br>';
// Affiche règles de calcul $html=new Form($db);
print "Cet état permet de faire un bilan des recettes et dépenses:<br>\n";
// Affiche en-tête du rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
print $langs->trans("RulesResultDue"); $nom="Bilan des recettes et dépenses, résumé annuel";
print '(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).<br>'; $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)';
print '<br>'; $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>":"");
$description=$langs->trans("RulesResultDue");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
else { else {
print $langs->trans("RulesResultInOut"); $nom="Bilan des recettes et dépenses, résumé annuel";
print '(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).<br>'; $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)';
print '<br>'; $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>":"");
$description=$langs->trans("RulesResultInOut");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
/* /*
* Factures clients * Factures clients
@ -287,7 +290,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
} }
$var=!$var; $var=!$var;
print "<tr $bc[$var]><td><b>".$langs->trans("TotalTTC")."</b></td>"; print '<tr class="liste_total"><td>'.$langs->trans("TotalTTC").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{ {
print '<td align="right">'.price($totentrees[$annee]).'</td><td align="right">'.price($totsorties[$annee]).'</td>'; print '<td align="right">'.price($totentrees[$annee]).'</td><td align="right">'.price($totsorties[$annee]).'</td>';
@ -298,6 +301,6 @@ print "</table>";
$db->close(); $db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>"); llxFooter('$Date$ - $Revision$');
?> ?>

View File

@ -39,9 +39,6 @@ else {
$year_end=$year_start + 4; $year_end=$year_start + 4;
} }
llxHeader();
/* /*
* Sécurité accés client * Sécurité accés client
*/ */
@ -53,32 +50,32 @@ if ($user->societe_id > 0)
$modecompta = $conf->compta->mode; $modecompta = $conf->compta->mode;
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"]; 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?"<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>":"");
print_fiche_titre($title,$lien);
// Affiche règles de calcul llxHeader();
print "<br>";
print "Cet état présente le CA:<br>\n";
$html=new Form($db);
// Affiche en-tête du rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
print $langs->trans("RulesCADue"); $nom="Chiffre d'affaire (".$conf->monnaie." HT)";
print '(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).<br>'; $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)';
print '<br>'; $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>":"");
$description=$langs->trans("RulesCADue");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
else { else {
print $langs->trans("RulesCAIn"); $nom="Chiffre d'affaire (".$conf->monnaie." TTC)";
print '(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).<br>'; $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)';
print '<br>'; $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>":"");
$description=$langs->trans("RulesCAIn");
$builddate=time();
$exportlink=$langs->trans("NotYetAvailable");
} }
$html->report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
print '<br>';
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
@ -220,13 +217,13 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
} }
// Affiche total // Affiche total
print "<tr><td><b>".$langs->trans("Total")." :</b></td>"; print '<tr class="liste_total"><td>'.$langs->trans("Total").':</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{ {
// Montant total // Montant total
if ($annee >= $minyear && $annee <= max($nowyear,$maxyear)) if ($annee >= $minyear && $annee <= max($nowyear,$maxyear))
{ {
print "<td align=\"right\" nowrap><b>".($total[$annee]?price($total[$annee]):"0")."</b></td>"; print "<td align=\"right\" nowrap>".($total[$annee]?price($total[$annee]):"0")."</td>";
} }
else else
{ {

View File

@ -219,4 +219,8 @@ AttachedFiles=Attached files and documents
FileTransferComplete=File was updloaded successfuly FileTransferComplete=File was updloaded successfuly
DateFormatYYYYMM=YYYY-MM DateFormatYYYYMM=YYYY-MM
DateFormatYYYYMMDD=YYYY-MM-DD DateFormatYYYYMMDD=YYYY-MM-DD
DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
ReportName=Report name
ReportPeriod=Report period
ReportDescription=Description
Report=Report

View File

@ -220,3 +220,7 @@ FileTransferComplete=Le fichier a
DateFormatYYYYMM=YYYY-MM DateFormatYYYYMM=YYYY-MM
DateFormatYYYYMMDD=YYYY-MM-DD DateFormatYYYYMMDD=YYYY-MM-DD
DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
ReportName=Nom du rapport
ReportPeriod=Période d'analyse
ReportDescription=Description
Report=Rapport