Merge pull request #4607 from atm-gauthier/3.8_fix_search_customer_product_price
FIX : search product in customer product prices doesn't work
This commit is contained in:
commit
a022665db8
@ -346,6 +346,8 @@ class Productcustomerprice extends CommonObject
|
|||||||
$sql .= ' AND ' . $key . ' = \'' . $value . '\'';
|
$sql .= ' AND ' . $key . ' = \'' . $value . '\'';
|
||||||
} elseif ($key == 'soc.nom') {
|
} elseif ($key == 'soc.nom') {
|
||||||
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
||||||
|
} elseif ($key == 'prod.ref') {
|
||||||
|
$sql .= ' AND ' . $key . ' LIKE \'%' . $value . '%\'';
|
||||||
} else {
|
} else {
|
||||||
$sql .= ' AND ' . $key . ' = ' . $value;
|
$sql .= ' AND ' . $key . ' = ' . $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,9 +241,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
't.fk_soc' => $object->id
|
't.fk_soc' => $object->id
|
||||||
);
|
);
|
||||||
|
|
||||||
$search_soc = GETPOST('search_soc');
|
$search_prod = GETPOST('search_prod');
|
||||||
if (! empty($search_soc)) {
|
if (! empty($search_prod)) {
|
||||||
$filter ['soc.nom'] = $search_soc;
|
$filter ['prod.ref'] = $search_prod;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add_customer_price') {
|
if ($action == 'add_customer_price') {
|
||||||
@ -487,7 +487,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
setEventMessage($prodcustprice->error, 'errors');
|
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);
|
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 '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
|
print '<td><input type="text" class="flat" name="search_prod" value="' . $search_prod . '" size="20"></td>';
|
||||||
print '<td colspan="8"> </td>';
|
print '<td colspan="8"> </td>';
|
||||||
// Print the search button
|
// Print the search button
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user