Fix custom fields in product datatable

This commit is contained in:
Hillel Coren 2018-02-21 16:25:05 +02:00
parent 663d26ede4
commit cf9165154d
2 changed files with 5 additions and 3 deletions

View File

@ -43,14 +43,14 @@ class ProductDatatable extends EntityDatatable
$account->invoice_item_taxes, $account->invoice_item_taxes,
], ],
[ [
'-' . Utils::getCustomLabel($account->custom_invoice_item_label1), 'custom_value1',
function ($model) { function ($model) {
return $model->custom_value1; return $model->custom_value1;
}, },
$account->custom_invoice_item_label1 $account->custom_invoice_item_label1
], ],
[ [
'-' . Utils::getCustomLabel($account->custom_invoice_item_label2), 'custom_value2',
function ($model) { function ($model) {
return $model->custom_value2; return $model->custom_value2;
}, },

View File

@ -41,7 +41,9 @@ class ProductRepository extends BaseRepository
if ($filter) { if ($filter) {
$query->where(function ($query) use ($filter) { $query->where(function ($query) use ($filter) {
$query->where('products.product_key', 'like', '%'.$filter.'%') $query->where('products.product_key', 'like', '%'.$filter.'%')
->orWhere('products.notes', 'like', '%'.$filter.'%'); ->orWhere('products.notes', 'like', '%'.$filter.'%')
->orWhere('products.custom_value1', 'like', '%'.$filter.'%')
->orWhere('products.custom_value2', 'like', '%'.$filter.'%');
}); });
} }