bugfix
This commit is contained in:
parent
63eda7e7f1
commit
7774c3ac59
@ -221,7 +221,8 @@ function pt ($db, $sql, $year) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ppt ($db, $year, $socidp) {
|
function ppt ($db, $year, $socidp)
|
||||||
|
{
|
||||||
global $bc;
|
global $bc;
|
||||||
print "<table width=\"100%\">";
|
print "<table width=\"100%\">";
|
||||||
|
|
||||||
@ -234,9 +235,10 @@ function ppt ($db, $year, $socidp) {
|
|||||||
print "<tr><td valign=\"top\" width=\"30%\">";
|
print "<tr><td valign=\"top\" width=\"30%\">";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as sum, round(date_format(f.datep,'%m')) as dm";
|
$sql = "SELECT sum(f.price - f.remise) as sum, round(date_format(f.datep,'%m')) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep,'%Y') = $year ";
|
$sql .= " FROM llx_propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep,'%Y') = $year ";
|
||||||
|
|
||||||
if ($socidp) {
|
if ($socidp)
|
||||||
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,8 +250,8 @@ function ppt ($db, $year, $socidp) {
|
|||||||
|
|
||||||
$sql = "SELECT sum(f.amount) as sum, round(date_format(f.datef, '%m')) as dm";
|
$sql = "SELECT sum(f.amount) as sum, round(date_format(f.datef, '%m')) as dm";
|
||||||
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
$sql .= " FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef,'%Y') = $year ";
|
||||||
|
if ($socidp)
|
||||||
if ($socidp) {
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY dm";
|
$sql .= " GROUP BY dm";
|
||||||
@ -265,7 +267,8 @@ function ppt ($db, $year, $socidp) {
|
|||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
$var = 1 ;
|
$var = 1 ;
|
||||||
for ($b = 1 ; $b <= 12 ; $b++) {
|
for ($b = 1 ; $b <= 12 ; $b++)
|
||||||
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
$delta = $ca[$b] - $prev[$b];
|
$delta = $ca[$b] - $prev[$b];
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
function get_ca_propal ($db, $year, $socidp)
|
function get_ca_propal ($db, $year, $socidp)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as sum FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep, '%Y') = $year ";
|
$sql = "SELECT sum(f.price - f.remise) as sum FROM llx_propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = $year ";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socidp";
|
$sql .= " AND f.fk_soc = $socidp";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user