fix propal fetch
This commit is contained in:
parent
27d47a855f
commit
6f93deae40
@ -13,7 +13,7 @@
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1467,10 +1467,8 @@ class Propal extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
@ -1481,12 +1479,12 @@ class Propal extends CommonObject
|
||||
$this->remise = $obj->remise;
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->remise_absolue = $obj->remise_absolue;
|
||||
$this->total = $obj->total; // TODO deprecated
|
||||
$this->total = $obj->total_ttc; // TODO deprecated
|
||||
$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;
|
||||
$this->total_ttc = $obj->total_ttc;
|
||||
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
|
||||
@ -1553,8 +1551,7 @@ class Propal extends CommonObject
|
||||
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||
|
||||
if ($obj->fk_statut == self::STATUS_DRAFT)
|
||||
{
|
||||
if ($obj->fk_statut == self::STATUS_DRAFT) {
|
||||
$this->brouillon = 1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user