Debug v20

This commit is contained in:
Laurent Destailleur
2024-04-29 11:04:19 +02:00
parent 37f6731d7e
commit 9e654e65dd
12 changed files with 165 additions and 84 deletions

View File

@@ -292,7 +292,7 @@ class Reception extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."reception");
$sql = "UPDATE ".MAIN_DB_PREFIX."reception";
$sql .= " SET ref = '(PROV".$this->id.")'";
$sql .= " SET ref = '(PROV".((int) $this->id).")'";
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
@@ -420,6 +420,7 @@ class Reception extends CommonObject
$this->shipping_method_id = $obj->fk_shipping_method;
$this->tracking_number = $obj->tracking_number;
$this->origin = ($obj->origin ? $obj->origin : 'commande'); // For compatibility
$this->origin_type = ($obj->origin ? $obj->origin : 'commande'); // For compatibility
$this->origin_id = $obj->origin_id;
$this->trueWeight = $obj->weight;
@@ -1193,7 +1194,9 @@ class Reception extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."receptiondet_batch WHERE fk_reception = ".((int) $this->id);
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."receptiondet_batch";
$sql .= " WHERE fk_reception = ".((int) $this->id);
$resql = $this->db->query($sql);
if (!empty($resql)) {
@@ -1221,7 +1224,7 @@ class Reception extends CommonObject
$line->subprice = $obj->subprice;
$line->multicurrency_subprice = $obj->multicurrency_subprice;
$line->remise_percent = $obj->remise_percent;
$line->label = !empty($obj->label) ? $obj->label : $line->product->label;
$line->label = !empty($obj->label) ? $obj->label : (is_object($line->product) ? $line->product->label : '');
$line->ref_supplier = $obj->ref;
$line->total_ht = $obj->total_ht;
$line->total_ttc = $obj->total_ttc;
@@ -1246,6 +1249,7 @@ class Reception extends CommonObject
$detail_batch->sellby = $line->sellby;
$detail_batch->batch = $line->batch;
$detail_batch->qty = $line->qty;
$line->detail_batch[] = $detail_batch;
}