Merge branch 'master' of github.com:akaunting/akaunting into 2.1-dev

# Conflicts:
#	composer.lock
This commit is contained in:
Cüneyt Şentürk
2020-11-11 18:48:33 +03:00
8 changed files with 61 additions and 28 deletions

View File

@ -177,10 +177,10 @@ class Reconciliations extends Controller
*/
protected function getTransactions($account, $started_at, $ended_at)
{
$started = explode(' ', $started_at);
$ended = explode(' ', $ended_at);
$started = explode(' ', $started_at)[0] . ' 00:00:00';
$ended = explode(' ', $ended_at)[0] . ' 23:59:59';
$transactions = Transaction::where('account_id', $account->id)->whereBetween('paid_at', [$started[0], $ended[0]])->get();
$transactions = Transaction::where('account_id', $account->id)->whereBetween('paid_at', [$started, $ended])->get();
return collect($transactions)->sortByDesc('paid_at');
}

View File

@ -13,6 +13,7 @@ use App\Models\Common\Widget;
use App\Traits\DateTime;
use App\Traits\Users;
use App\Utilities\Widgets;
use Illuminate\Database\Eloquent\ModelNotFoundException;
class Dashboards extends Controller
{
@ -51,9 +52,9 @@ class Dashboards extends Controller
{
$dashboard_id = $dashboard_id ?? session('dashboard_id');
if (!empty($dashboard_id)) {
$dashboard = Dashboard::find($dashboard_id);
} else {
try {
$dashboard = Dashboard::findOrFail($dashboard_id);
} catch (ModelNotFoundException $e) {
$dashboard = user()->dashboards()->enabled()->first();
}