Update propal.class.php

This commit is contained in:
Frédéric FRANCE 2021-02-22 21:00:24 +01:00 committed by GitHub
parent 6f93deae40
commit 926a88ff51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1463,7 +1463,9 @@ class Propal extends CommonObject
if ($ref) {
$sql .= " WHERE p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid
$sql .= " AND p.ref='".$this->db->escape($ref)."'";
} else $sql .= " WHERE p.rowid=".$rowid;
} else {
$sql .= " WHERE p.rowid=".$rowid;
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1480,11 +1482,11 @@ class Propal extends CommonObject
$this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue;
$this->total = $obj->total_ttc; // TODO deprecated
$this->total_ttc = $obj->total_ttc;
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total_ttc;
$this->socid = $obj->fk_soc;
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
@ -1535,8 +1537,8 @@ class Propal extends CommonObject
$this->extraparams = (array) json_decode($obj->extraparams, true);
$this->user_author_id = $obj->fk_user_author;
$this->user_valid_id = $obj->fk_user_valid;
$this->user_close_id = $obj->fk_user_cloture;
$this->user_valid_id = $obj->fk_user_valid;
$this->user_close_id = $obj->fk_user_cloture;
//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
@ -1548,8 +1550,8 @@ class Propal extends CommonObject
$this->multicurrency_code = $obj->multicurrency_code;
$this->multicurrency_tx = $obj->multicurrency_tx;
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
if ($obj->fk_statut == self::STATUS_DRAFT) {
$this->brouillon = 1;
@ -1565,8 +1567,7 @@ class Propal extends CommonObject
// Lines
$result = $this->fetch_lines();
if ($result < 0)
{
if ($result < 0) {
return -3;
}