mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:40:09 -05:00 
			
		
		
		
	Improve bank transaction filters
This commit is contained in:
		
							parent
							
								
									9d0ba8d30a
								
							
						
					
					
						commit
						3a376fddf6
					
				@ -153,6 +153,21 @@ class BankTransactionFilters extends QueryFilters
 | 
			
		||||
    {
 | 
			
		||||
        $sort_col = explode('|', $sort);
 | 
			
		||||
 | 
			
		||||
        if(!is_array($sort_col))
 | 
			
		||||
            return $this->builder;
 | 
			
		||||
        
 | 
			
		||||
        if($sort_col[0] == 'deposit')
 | 
			
		||||
            return $this->builder->where('base_type', 'CREDIT')->orderBy('amount', $sort_col[1]);
 | 
			
		||||
 | 
			
		||||
        if($sort_col[0] == 'withdrawal')
 | 
			
		||||
            return $this->builder->where('base_type', 'DEBIT')->orderBy('amount', $sort_col[1]);
 | 
			
		||||
 | 
			
		||||
        if($sort_col[0] == 'status')
 | 
			
		||||
            $sort_col[0] = 'status_id';
 | 
			
		||||
 | 
			
		||||
        if(in_array($sort_col[0],['invoices','expense']))
 | 
			
		||||
            return $this->builder;
 | 
			
		||||
 | 
			
		||||
        return $this->builder->orderBy($sort_col[0], $sort_col[1]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user