Debug reporting
This commit is contained in:
parent
cb61c1cc1e
commit
d82fff31d4
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -19,9 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/resultat/clientfourn.php
|
* \file htdocs/compta/resultat/clientfourn.php
|
||||||
\brief Page reporting resultat
|
* \brief Page reporting resultat
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -35,8 +35,33 @@ $langs->load("bills");
|
|||||||
if (!$user->rights->facture->lire)
|
if (!$user->rights->facture->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$year=$_GET["year"];
|
// Date range
|
||||||
if (! $year) { $year = strftime("%Y", time()); }
|
$year=$_REQUEST["year"];
|
||||||
|
if (empty($year))
|
||||||
|
{
|
||||||
|
$year_current = strftime("%Y",dol_now());
|
||||||
|
$year_start = $year_current;
|
||||||
|
} else {
|
||||||
|
$year_current = $year;
|
||||||
|
$year_start = $year;
|
||||||
|
}
|
||||||
|
$date_start=dol_mktime($_REQUEST["date_starthour"],$_REQUEST["date_startmin"],$_REQUEST["date_startsec"],$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
||||||
|
$date_end=dol_mktime($_REQUEST["date_endhour"],$_REQUEST["date_endmin"],$_REQUEST["date_endsec"],$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||||
|
// Quarter
|
||||||
|
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||||
|
{
|
||||||
|
$q=(! empty($_REQUEST["q"]))?$_REQUEST["q"]:1; // TODO Set current quarter
|
||||||
|
if ($q==1) { $date_start=dol_get_first_day($year_start,1); $date_end=dol_get_last_day($year_start,3); }
|
||||||
|
if ($q==2) { $date_start=dol_get_first_day($year_start,4); $date_end=dol_get_last_day($year_start,6); }
|
||||||
|
if ($q==3) { $date_start=dol_get_first_day($year_start,7); $date_end=dol_get_last_day($year_start,9); }
|
||||||
|
if ($q==4) { $date_start=dol_get_first_day($year_start,10); $date_end=dol_get_last_day($year_start,12); }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO We define q
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
||||||
$modecompta = $conf->compta->mode;
|
$modecompta = $conf->compta->mode;
|
||||||
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
||||||
|
|||||||
@ -113,12 +113,10 @@ if ($modetax==1) // Calculate on invoice for goods and services
|
|||||||
$elementcust=$langs->trans("CustomersInvoices");
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
$productcust=$langs->trans("Description");
|
$productcust=$langs->trans("Description");
|
||||||
$amountcust=$langs->trans("AmountHT");
|
$amountcust=$langs->trans("AmountHT");
|
||||||
$vatcust=$langs->trans("VATReceived");
|
|
||||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
$elementsup=$langs->trans("SuppliersInvoices");
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
$productsup=$langs->trans("Description");
|
$productsup=$langs->trans("Description");
|
||||||
$amountsup=$langs->trans("AmountHT");
|
$amountsup=$langs->trans("AmountHT");
|
||||||
$vatsup=$langs->trans("VATPaid");
|
|
||||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
}
|
}
|
||||||
if ($modetax==0) // Invoice for goods, payment for services
|
if ($modetax==0) // Invoice for goods, payment for services
|
||||||
@ -137,21 +135,22 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
$elementcust=$langs->trans("CustomersInvoices");
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
$productcust=$langs->trans("Description");
|
$productcust=$langs->trans("Description");
|
||||||
$amountcust=$langs->trans("AmountHT");
|
$amountcust=$langs->trans("AmountHT");
|
||||||
$vatcust=$langs->trans("VATReceived");
|
|
||||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
$elementsup=$langs->trans("SuppliersInvoices");
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
$productsup=$langs->trans("Description");
|
$productsup=$langs->trans("Description");
|
||||||
$amountsup=$langs->trans("AmountHT");
|
$amountsup=$langs->trans("AmountHT");
|
||||||
$vatsup=$langs->trans("VATPaid");
|
|
||||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
}
|
}
|
||||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
||||||
|
|
||||||
|
$vatcust=$langs->trans("VATReceived");
|
||||||
|
$vatsup=$langs->trans("VATPaid");
|
||||||
|
|
||||||
|
|
||||||
// VAT Received
|
// VAT Received
|
||||||
|
|
||||||
print "<br>";
|
//print "<br>";
|
||||||
print_titre($vatcust);
|
//print_titre($vatcust);
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
@ -215,15 +214,15 @@ else
|
|||||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
//print '</table>';
|
||||||
|
|
||||||
|
|
||||||
// VAT Paid
|
// VAT Paid
|
||||||
|
|
||||||
print "<br>";
|
//print "<br>";
|
||||||
print_titre($vatsup);
|
//print_titre($vatsup);
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
//print "<table class=\"noborder\" width=\"100%\">";
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
print '<td align="left">'.$langs->trans("Num")."</td>";
|
print '<td align="left">'.$langs->trans("Num")."</td>";
|
||||||
print '<td align="left">'.$langs->trans("Supplier")."</td>";
|
print '<td align="left">'.$langs->trans("Supplier")."</td>";
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -174,9 +174,15 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
}
|
}
|
||||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
||||||
|
|
||||||
|
$vatcust=$langs->trans("VATReceived");
|
||||||
|
$vatsup=$langs->trans("VATPaid");
|
||||||
|
|
||||||
|
|
||||||
// VAT Received and paid
|
// VAT Received and paid
|
||||||
|
|
||||||
|
//print "<br>";
|
||||||
|
//print_titre($vatcust);
|
||||||
|
|
||||||
echo '<table class="noborder" width="100%">';
|
echo '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
$y = $year_current;
|
$y = $year_current;
|
||||||
@ -402,6 +408,8 @@ else
|
|||||||
$x_coll_sum += $temp_vat;
|
$x_coll_sum += $temp_vat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Total customers
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
@ -415,7 +423,6 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
||||||
|
|
||||||
//print table headers for this quadri - expenses now
|
//print table headers for this quadri - expenses now
|
||||||
@ -538,6 +545,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Total suppliers
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
@ -555,11 +563,11 @@ else
|
|||||||
|
|
||||||
// Total to pay
|
// Total to pay
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre" colspan="'.($span-1).'"></td><td class="liste_titre" align="right" colspan="2">'.$langs->trans("TotalToPay").', '.$langs->trans("Quadri").' '.$q.':</td>';
|
print '<td class="liste_titre" colspan="'.($span-1).'"></td><td class="liste_titre" align="right" colspan="2">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').':</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$diff = $x_coll_sum - $x_paye_sum;
|
$diff = $x_coll_sum - $x_paye_sum;
|
||||||
print '<tr class="list_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="liste_total" colspan="'.$span.'"></td>';
|
print '<td class="liste_total" colspan="'.$span.'"></td>';
|
||||||
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user