NEW - Add origin info when create a product batch when created from a movement stock

This commit is contained in:
kkhelifa 2023-03-06 14:57:07 +01:00
parent 3c96c42f32
commit e5c9e14c0f

View File

@ -368,6 +368,8 @@ class MouvementStock extends CommonObject
}
} else { // If not found, we add record
$productlot = new Productlot($this->db);
$productlot->origin = !empty($this->origin) ? (empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type) : '';
$productlot->origin_id = !empty($this->origin) ? $this->origin->id : 0;
$productlot->entity = $conf->entity;
$productlot->fk_product = $fk_product;
$productlot->batch = $batch;