Ajout syslog
This commit is contained in:
parent
2099c1863e
commit
29783055c4
@ -723,51 +723,55 @@ class Facture
|
|||||||
* \return int 0 si erreur
|
* \return int 0 si erreur
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $datestart='', $dateend='')
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $datestart='', $dateend='')
|
||||||
{
|
{
|
||||||
if ($this->brouillon)
|
dolibarr_syslog("Facture::UpdateLine");
|
||||||
{
|
|
||||||
if (strlen(trim($qty))==0)
|
if ($this->brouillon)
|
||||||
{
|
{
|
||||||
$qty=1;
|
if (strlen(trim($qty))==0)
|
||||||
}
|
{
|
||||||
$remise = 0;
|
$qty=1;
|
||||||
$price = ereg_replace(",",".",$pu);
|
}
|
||||||
$subprice = $price;
|
$remise = 0;
|
||||||
if (trim(strlen($remise_percent)) > 0)
|
$price = ereg_replace(",",".",$pu);
|
||||||
{
|
$subprice = $price;
|
||||||
$remise = round(($pu * $remise_percent / 100), 2);
|
if (trim(strlen($remise_percent)) > 0)
|
||||||
$price = $pu - $remise;
|
{
|
||||||
}
|
$remise = round(($pu * $remise_percent / 100), 2);
|
||||||
else
|
$price = $pu - $remise;
|
||||||
{
|
}
|
||||||
$remise_percent=0;
|
else
|
||||||
}
|
{
|
||||||
|
$remise_percent=0;
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc'";
|
}
|
||||||
$sql .= ",price='" . ereg_replace(",",".",$price)."'";
|
|
||||||
$sql .= ",subprice='" . ereg_replace(",",".",$subprice)."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc'";
|
||||||
$sql .= ",remise='". ereg_replace(",",".",$remise)."'";
|
$sql .= ",price='" . ereg_replace(",",".",$price)."'";
|
||||||
$sql .= ",remise_percent='".ereg_replace(",",".",$remise_percent)."'";
|
$sql .= ",subprice='" . ereg_replace(",",".",$subprice)."'";
|
||||||
$sql .= ",qty='$qty'";
|
$sql .= ",remise='". ereg_replace(",",".",$remise)."'";
|
||||||
|
$sql .= ",remise_percent='".ereg_replace(",",".",$remise_percent)."'";
|
||||||
if ($datestart) { $sql.= ",date_start='$datestart'"; }
|
$sql .= ",qty='$qty'";
|
||||||
else { $sql.=",date_start=null"; }
|
|
||||||
if ($dateend) { $sql.= ",date_end='$dateend'"; }
|
if ($datestart) { $sql.= ",date_start='$datestart'"; }
|
||||||
else { $sql.=",date_end=null"; }
|
else { $sql.=",date_start=null"; }
|
||||||
|
if ($dateend) { $sql.= ",date_end='$dateend'"; }
|
||||||
$sql .= " WHERE rowid = $rowid ;";
|
else { $sql.=",date_end=null"; }
|
||||||
|
|
||||||
$result = $this->db->query( $sql);
|
$sql .= " WHERE rowid = $rowid ;";
|
||||||
if ($result) {
|
|
||||||
|
$result = $this->db->query( $sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
$this->updateprice($this->id);
|
$this->updateprice($this->id);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
dolibarr_print_error($this->db);
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Supprime une ligne facture de la base
|
* \brief Supprime une ligne facture de la base
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user