Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Multiple account filter in Revenue

Adarsh Nowlakha   ( User )

Commented 6 years ago

I need to to filter more than one account in revenue ( not the All Accounts but a few combination of accounts) for that I have made several changes to my files:


 


In app/Filters/incomes/Revenues.php


    public function account($account)


    {


        foreach ($account as $account) {


          return $this->where('account_id', $account);


}


    }


 


In resources/views/incomes/revenues/index.blade.php


            {!! Form::select('account', $accounts, request('account'), ['multiple' => 'true','class' => 'form-control input-filter input-sm']) !!}


To make the select box into multiple option select box


 


I am getting a Whoops, looks like something went wrong.


Please can anyone guide me. Thanks.

Wisdom Oppong yeboah   ( User )

Commented 6 years ago

Adarsh, my guess is $account is not an array, so looping over it won't give you the results you are hoping for.


To know exactly what went wrong, try setting APP_ENV to development and APP_DEBUG to true in your env file.


good luck 

Adarsh Nowlakha   ( User )

Commented 6 years ago

Thanks Wisdom Oppong yeboah for advice. I was able to achieve this by creating another select field and filtering revenues using from -to method

Please login or register to leave a response.

Showing 1 to 3 of 3 discussions