Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a3e461c211
@ -1941,20 +1941,23 @@ class Facture extends CommonObject
|
|||||||
{
|
{
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php');
|
||||||
|
|
||||||
dol_syslog("Facture::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type", LOG_DEBUG);
|
dol_syslog("Facture::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG);
|
||||||
|
|
||||||
if ($this->brouillon)
|
if ($this->brouillon)
|
||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$remise_percent=price2num($remise_percent);
|
if (empty($qty)) $qty=0;
|
||||||
$qty=price2num($qty);
|
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||||
if (! $qty) $qty=0;
|
|
||||||
$pu = price2num($pu);
|
$remise_percent = price2num($remise_percent);
|
||||||
$txtva=price2num($txtva);
|
$qty = price2num($qty);
|
||||||
$txlocaltax1=price2num($txlocaltax1);
|
$pu = price2num($pu);
|
||||||
$txlocaltax2=price2num($txlocaltax2);
|
$txtva = price2num($txtva);
|
||||||
|
$txlocaltax1 = price2num($txlocaltax1);
|
||||||
|
$txlocaltax2 = price2num($txlocaltax2);
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($type < 0) return -1;
|
if ($type < 0) return -1;
|
||||||
|
|
||||||
@ -3593,7 +3596,6 @@ class FactureLigne
|
|||||||
if ($this->date_end) { $sql.= ",date_end='".$this->db->idate($this->date_end)."'"; }
|
if ($this->date_end) { $sql.= ",date_end='".$this->db->idate($this->date_end)."'"; }
|
||||||
else { $sql.=',date_end=null'; }
|
else { $sql.=',date_end=null'; }
|
||||||
$sql.= ",product_type=".$this->product_type;
|
$sql.= ",product_type=".$this->product_type;
|
||||||
$sql.= ",rang='".$this->rang."'";
|
|
||||||
$sql.= ",info_bits='".$this->info_bits."'";
|
$sql.= ",info_bits='".$this->info_bits."'";
|
||||||
if (empty($this->skip_update_total))
|
if (empty($this->skip_update_total))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -839,6 +839,8 @@ abstract class CommonObject
|
|||||||
$sql.= ' WHERE '.$this->fk_element.'='.$this->id;
|
$sql.= ' WHERE '.$this->fk_element.'='.$this->id;
|
||||||
if (! $renum) $sql.= ' AND rang = 0';
|
if (! $renum) $sql.= ' AND rang = 0';
|
||||||
if ($renum) $sql.= ' AND rang <> 0';
|
if ($renum) $sql.= ' AND rang <> 0';
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::line_order sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -850,6 +852,8 @@ abstract class CommonObject
|
|||||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||||
$sql.= ' ORDER BY rang ASC, rowid '.$rowidorder;
|
$sql.= ' ORDER BY rang ASC, rowid '.$rowidorder;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::line_order sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -910,6 +914,8 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET rang = '.$rang;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET rang = '.$rang;
|
||||||
$sql.= ' WHERE rowid = '.$rowid;
|
$sql.= ' WHERE rowid = '.$rowid;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::updateRangOfLine sql=".$sql, LOG_DEBUG);
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user