commit
8ae2dfbf9e
@ -1411,32 +1411,32 @@ class BonPrelevement extends CommonObject
|
|||||||
fputs($this->file, ' </CstmrDrctDbtInitn>'.$CrLf);
|
fputs($this->file, ' </CstmrDrctDbtInitn>'.$CrLf);
|
||||||
fputs($this->file, '</Document>'.$CrLf);
|
fputs($this->file, '</Document>'.$CrLf);
|
||||||
|
|
||||||
$sql = "SELECT pl.amount";
|
$sql = "SELECT pl.amount";
|
||||||
$sql.= " FROM";
|
$sql.= " FROM";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
|
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||||
$sql.= " WHERE pl.fk_prelevement_bons = ".$this->id;
|
$sql.= " WHERE pl.fk_prelevement_bons = ".$this->id;
|
||||||
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
|
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
|
||||||
$sql.= " AND pf.fk_facture = f.rowid";
|
$sql.= " AND pf.fk_facture = f.rowid";
|
||||||
|
|
||||||
//Lines
|
//Lines
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$this->total = $this->total + $obj->amount;
|
$this->total = $this->total + $obj->amount;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = -2;
|
$result = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user