mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:17:34 -05:00 
			
		
		
		
	Updates for expense filters
This commit is contained in:
		
							parent
							
								
									e248e96868
								
							
						
					
					
						commit
						4b397b5b39
					
				@ -107,6 +107,12 @@ class ExpenseFilters extends QueryFilters
 | 
			
		||||
                    $query->whereNull('payment_date');
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if(in_array('uncategorized', $status_parameters)){
 | 
			
		||||
                $query->orWhere(function ($query){
 | 
			
		||||
                    $query->whereNull('category_id');
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // nlog($this->builder->toSql());
 | 
			
		||||
@ -200,7 +206,7 @@ class ExpenseFilters extends QueryFilters
 | 
			
		||||
            return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) {
 | 
			
		||||
        if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['amount', 'public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) {
 | 
			
		||||
            return $this->builder->orderBy($sort_col[0], $sort_col[1]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user