Add trigger for virtual stock

Allow to add/sustract some qty for GPAO OF running
This commit is contained in:
BENKE Charlene 2018-05-02 17:29:31 +02:00 committed by GitHub
parent 2f2d17926d
commit 5ac0f77d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3925,7 +3925,7 @@ class Product extends CommonObject
*/
function load_virtual_stock()
{
global $conf;
global $conf, $user, $langs;
$stock_commande_client=0;
$stock_commande_fournisseur=0;
@ -3975,6 +3975,16 @@ class Product extends CommonObject
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
$this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur;
}
// Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LOAD_VIRTUAL_STOCK', $this, $user, $langs, $conf);
if ($result < 0) {
$this->errors=$interface->errors;
return -1;
}
}