Quelques amliorations et traduction sur les rapports bilans recette-dpenses et CA
Ajout d'un cartouche commun Utilisation du style liste_total pour les totaux.
This commit is contained in:
parent
3065fe12a4
commit
7a31971c32
@ -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?" <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")
|
||||
{
|
||||
print $langs->trans("RulesResultDue");
|
||||
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>';
|
||||
print '<br>';
|
||||
$nom="Bilan des recettes et dépenses, détail";
|
||||
$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)';
|
||||
$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 {
|
||||
print $langs->trans("RulesResultInOut");
|
||||
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>';
|
||||
print '<br>';
|
||||
$nom="Bilan des recettes et dépenses, détail";
|
||||
$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)';
|
||||
$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 '<tr class="liste_titre">';
|
||||
print '<td width="10%"> </td><td>'.$langs->trans("Element").'</td>';
|
||||
if ($modecompta == 'CREANCES-DETTES') print "<td align=\"right\">".$langs->trans("AmountHT")."</td>";
|
||||
print "<td align=\"right\">".$langs->trans("AmountTTC")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr><td colspan="4"> </td></tr>';
|
||||
|
||||
/*
|
||||
* 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 "<tr $bc[$var]><td> </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> </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++;
|
||||
print '<td colspan="3">'.$langs->trans("None").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($result);
|
||||
} else {
|
||||
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>';
|
||||
print '<td colspan="3" align="right">'.price($total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
@ -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 "<tr $bc[$var]><td> </td>";
|
||||
print '<td colspan="3">'.$langs->trans("None").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
} else {
|
||||
dolibarr_print_error($db);
|
||||
|
||||
@ -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?"<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>';
|
||||
llxHeader();
|
||||
|
||||
// Affiche règles de calcul
|
||||
print "Cet état permet de faire un bilan des recettes et dépenses:<br>\n";
|
||||
$html=new Form($db);
|
||||
|
||||
// Affiche en-tête du rapport
|
||||
if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
print $langs->trans("RulesResultDue");
|
||||
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>';
|
||||
print '<br>';
|
||||
$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>":"");
|
||||
$description=$langs->trans("RulesResultDue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
else {
|
||||
print $langs->trans("RulesResultInOut");
|
||||
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>';
|
||||
print '<br>';
|
||||
$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>":"");
|
||||
$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 "<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++)
|
||||
{
|
||||
print '<td align="right">'.price($totentrees[$annee]).'</td><td align="right">'.price($totsorties[$annee]).'</td>';
|
||||
@ -298,6 +301,6 @@ print "</table>";
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
|
||||
@ -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?"<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
|
||||
print "<br>";
|
||||
print "Cet état présente le CA:<br>\n";
|
||||
llxHeader();
|
||||
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
// Affiche en-tête du rapport
|
||||
if ($modecompta=="CREANCES-DETTES")
|
||||
{
|
||||
print $langs->trans("RulesCADue");
|
||||
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>';
|
||||
print '<br>';
|
||||
$nom="Chiffre d'affaire (".$conf->monnaie." HT)";
|
||||
$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>":"");
|
||||
$description=$langs->trans("RulesCADue");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
else {
|
||||
print $langs->trans("RulesCAIn");
|
||||
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>';
|
||||
print '<br>';
|
||||
$nom="Chiffre d'affaire (".$conf->monnaie." TTC)";
|
||||
$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>":"");
|
||||
$description=$langs->trans("RulesCAIn");
|
||||
$builddate=time();
|
||||
$exportlink=$langs->trans("NotYetAvailable");
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
$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 "<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++)
|
||||
{
|
||||
// Montant total
|
||||
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
|
||||
{
|
||||
|
||||
@ -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
|
||||
DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS
|
||||
ReportName=Report name
|
||||
ReportPeriod=Report period
|
||||
ReportDescription=Description
|
||||
Report=Report
|
||||
@ -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
|
||||
Loading…
Reference in New Issue
Block a user