Skip to content
Snippets Groups Projects
Commit c940d2de authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #4729 from IonAgorria/fix-dynprice-supplier

Fix: dynamic price parser and button not using selected expression
parents 4ae3fe63 2bca2b27
No related branches found
No related tags found
No related merge requests found
......@@ -229,6 +229,7 @@ if (empty($reshook))
{
//Check the expression validity by parsing it
$priceparser = new PriceParser($db);
$object->fk_supplier_price_expression = $price_expression;
$price_result = $priceparser->parseProductSupplier($object);
if ($price_result < 0) { //Expression is not valid
$error++;
......@@ -470,7 +471,7 @@ if ($id > 0 || $ref)
on_change();
}
function on_click() {
window.location = "'.DOL_URL_ROOT.'/product/dynamic_price/editor.php?id='.$id.'&tab=fournisseurs&eid=" + $("#eid").attr("value");
window.location = "'.DOL_URL_ROOT.'/product/dynamic_price/editor.php?id='.$id.'&tab=fournisseurs&eid=" + $("#eid").val();
}
function on_change() {
if ($("#eid").val() == 0) {
......
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