Skip to content
Snippets Groups Projects
Commit c84e74c0 authored by Ion Agorria's avatar Ion Agorria
Browse files

Fix dynamic price parsing in fournisseurs.php

parent 351ce622
No related branches found
No related tags found
No related merge requests found
......@@ -228,14 +228,8 @@ if (empty($reshook))
if (!empty($conf->dynamicprices->enabled) && $price_expression !== '')
{
//Check the expression validity by parsing it
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->id = $prodid;
$prod_supplier->fourn_qty = $quantity;
$prod_supplier->fourn_tva_tx = $tva_tx;
$prod_supplier->fourn_id = $id_fourn;
$prod_supplier->fk_supplier_price_expression = $price_expression;
$priceparser = new PriceParser($db);
$price_result = $priceparser->parseProductSupplier($prod_supplier);
$price_result = $priceparser->parseProductSupplier($object);
if ($price_result < 0) { //Expression is not valid
$error++;
setEventMessages($priceparser->translatedError(), null, 'errors');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment