pmp inventory conf MAIN_PRODUCT_PERENTITY_SHARED

This commit is contained in:
Quentin VIAL-GOUTEYRON 2022-04-11 15:47:38 +02:00
parent c7e8a2bd8f
commit 67e7c91c3e

View File

@ -194,6 +194,15 @@ if (empty($reshook)) {
setEventMessages($db->lasterror(), null, 'errors');
break;
}
if(!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product_perentity SET pmp = '.((float) $line->pmp_real).' WHERE fk_product = '.((int) $line->fk_product).' AND entity='.$conf->entity;
$resqlpmp = $db->query($sqlpmp);
if (! $resqlpmp) {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
break;
}
}
}
// Update line with id of stock movement (and the start quantity if it has changed this last recording)