Add search by client from invoices

This commit is contained in:
David Bomba 2023-03-15 09:40:31 +11:00
parent f9d4889a96
commit 7ad1c08d51
2 changed files with 5 additions and 2 deletions

View File

@ -108,7 +108,10 @@ class InvoiceFilters extends QueryFilters
->orWhere('custom_value1', 'like', '%'.$filter.'%')
->orWhere('custom_value2', 'like', '%'.$filter.'%')
->orWhere('custom_value3', 'like', '%'.$filter.'%')
->orWhere('custom_value4', 'like', '%'.$filter.'%');
->orWhere('custom_value4', 'like', '%'.$filter.'%')
->orWhereHas('client', function ($q) use ($filter){
$q->where('name', 'like', '%'.$filter.'%');
});
});
}

View File

@ -100,7 +100,7 @@ class PaymentMigrationRepository extends BaseRepository
$payment->deleted_at = $data['deleted_at'] ?: null;
$payment->save();
if (array_key_exists('currency_id', $data) && $data['currency_id'] == 0) {
if ($payment->currency_id == 0) {
$payment->currency_id = $payment->company->settings->currency_id;
$payment->save();
}