From 756b50b9d320ebbc0d5cc3103051aa20313d452a Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 12 Feb 2016 12:06:23 +0100 Subject: [PATCH] FIX : search product in customer product prices doesn't work --- htdocs/product/class/productcustomerprice.class.php | 2 ++ htdocs/societe/price.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 86228db70c5..f2adc298a76 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -346,6 +346,8 @@ class Productcustomerprice extends CommonObject $sql .= ' AND ' . $key . ' = \'' . $value . '\''; } elseif ($key == 'soc.nom') { $sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\''; + } elseif ($key == 'prod.ref') { + $sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\''; } else { $sql .= ' AND ' . $key . ' = ' . $value; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 82adbd96607..0259150ccc4 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -241,9 +241,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { 't.fk_soc' => $object->id ); - $search_soc = GETPOST('search_soc'); - if (! empty($search_soc)) { - $filter ['soc.nom'] = $search_soc; + $search_prod = GETPOST('search_prod'); + if (! empty($search_prod)) { + $filter ['prod.ref'] = $search_prod; } if ($action == 'add_customer_price') { @@ -487,7 +487,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { setEventMessage($prodcustprice->error, 'errors'); } - $option = '&search_soc=' . $search_soc . '&id=' . $object->id; + $option = '&search_prod=' . $search_prod . '&id=' . $object->id; print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); @@ -512,7 +512,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ''; - print ''; + print ''; print ' '; // Print the search button print '';