Modif calcul prix de la propale
This commit is contained in:
parent
4f10641bc6
commit
f06fee38b7
@ -25,7 +25,7 @@ require("./lib.inc.php");
|
|||||||
|
|
||||||
function propals ($db, $year, $month) {
|
function propals ($db, $year, $month) {
|
||||||
global $bc;
|
global $bc;
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
|
||||||
$sql .= " AND c.id in (1,2,4)";
|
$sql .= " AND c.id in (1,2,4)";
|
||||||
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
$sql .= " AND date_format(p.datep, '%Y') = $year ";
|
||||||
@ -243,7 +243,7 @@ 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) as sum, round(date_format(f.datep,'%m')) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in (1,2,4) 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)
|
||||||
|
|||||||
@ -94,7 +94,7 @@ print '<table width="100%">';
|
|||||||
|
|
||||||
print '<tr><td valign="top">';
|
print '<tr><td valign="top">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as amount, date_format(f.datep,'%Y-%m') as dm";
|
$sql = "SELECT sum(f.price) as amount, date_format(f.datep,'%Y-%m') as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@ -106,7 +106,7 @@ pt($db, $sql, "Mois");
|
|||||||
|
|
||||||
print '</td><td valign="top">';
|
print '</td><td valign="top">';
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as amount, year(f.datep) as dm";
|
$sql = "SELECT sum(f.price) as amount, year(f.datep) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
@ -118,7 +118,7 @@ pt($db, $sql, "Ann
|
|||||||
|
|
||||||
print "<P>";
|
print "<P>";
|
||||||
|
|
||||||
$sql = "SELECT sum(f.price - f.remise) as amount, month(f.datep) as dm";
|
$sql = "SELECT sum(f.price) as amount, month(f.datep) as dm";
|
||||||
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
|
||||||
if ($socidp)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user