Fix warnings

This commit is contained in:
Laurent Destailleur 2020-12-07 18:29:14 +01:00
parent 7ad5a89a16
commit 6e403e6ce0
3 changed files with 14 additions and 6 deletions

View File

@ -1099,7 +1099,7 @@ class Propal extends CommonObject
if ($this->id)
{
$this->ref = '(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".((int) $this->id);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1111,7 +1111,7 @@ class Propal extends CommonObject
}
// Add object linked
if (!$error && $this->id && is_array($this->linked_objects) && !empty($this->linked_objects))
if (!$error && $this->id && !empty($this->linked_objects) && is_array($this->linked_objects))
{
foreach ($this->linked_objects as $origin => $tmp_origin_id)
{
@ -3753,7 +3753,10 @@ class PropaleLigne extends CommonObjectLine
public $product_type = Product::TYPE_PRODUCT;
public $qty;
public $tva_tx;
public $vat_src_code;
public $subprice;
public $remise_percent;
public $fk_remise_except;
@ -3805,6 +3808,11 @@ class PropaleLigne extends CommonObjectLine
* @see $product_label
*/
public $libelle;
/**
* @deprecated
* @see $product_label
*/
public $label;
/**
* Product label
* @var string

View File

@ -3161,7 +3161,7 @@ abstract class CommonObject
$this->multicurrency_total_ttc += isset($this->revenuestamp) ? ($this->revenuestamp * $multicurrency_tx) : 0;
// Situations totals
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits') && $this->type != $this::TYPE_CREDIT_NOTE)
if (!empty($this->situation_cycle_ref) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits') && $this->type != $this::TYPE_CREDIT_NOTE)
{
$prev_sits = $this->get_prev_sits();

View File

@ -190,11 +190,11 @@ class PropalTest extends PHPUnit\Framework\TestCase
$langs=$this->savlangs;
$db=$this->savdb;
$localobject->note_private='New note private after update';
$result=$localobject->update($user);
$localobject->note_private = 'New note private after update';
$result = $localobject->update($user);
$this->assertLessThan($result, 0);
print __METHOD__." id=".$id." result=".$result."\n";
print __METHOD__." id=".$localobject->id." result=".$result."\n";
return $localobject;
}