fixes for filters
This commit is contained in:
parent
1f6b1819a4
commit
9954ce482e
|
|
@ -108,13 +108,19 @@ class ExpenseFilters extends QueryFilters
|
||||||
|
|
||||||
if (in_array('paid', $status_parameters)) {
|
if (in_array('paid', $status_parameters)) {
|
||||||
$query->orWhere(function ($query) {
|
$query->orWhere(function ($query) {
|
||||||
$query->whereNotNull('payment_date');
|
$query->whereNotNull('payment_date')
|
||||||
|
->orWhere('transaction_reference', '!=', '')
|
||||||
|
->orWhereNotNull('transaction_reference');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('unpaid', $status_parameters)) {
|
if (in_array('unpaid', $status_parameters)) {
|
||||||
$query->orWhere(function ($query) {
|
$query->orWhere(function ($query) {
|
||||||
$query->whereNull('payment_date');
|
$query->whereNull('payment_date')
|
||||||
|
->where(function ($query) {
|
||||||
|
$query->where('transaction_reference', '')
|
||||||
|
->orWhereNull('transaction_reference');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,10 @@ class StoreExpenseRequest extends Request
|
||||||
|
|
||||||
$input = $this->decodePrimaryKeys($input);
|
$input = $this->decodePrimaryKeys($input);
|
||||||
|
|
||||||
|
if(isset($input['invoice_id'])){
|
||||||
|
unset($input['invoice_id']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->file('documents') instanceof \Illuminate\Http\UploadedFile) {
|
if ($this->file('documents') instanceof \Illuminate\Http\UploadedFile) {
|
||||||
$this->files->set('documents', [$this->file('documents')]);
|
$this->files->set('documents', [$this->file('documents')]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue