Merge branch 'master' of github.com:akaunting/akaunting into 2.1-dev
# Conflicts: # composer.lock
This commit is contained in:
commit
72231b10ce
@ -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');
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -10,15 +10,15 @@ return [
|
||||
|
||||
'minor' => '0',
|
||||
|
||||
'patch' => '24',
|
||||
'patch' => '25',
|
||||
|
||||
'build' => '',
|
||||
|
||||
'status' => 'Stable',
|
||||
|
||||
'date' => '21-October-2020',
|
||||
'date' => '26-October-2020',
|
||||
|
||||
'time' => '14:00',
|
||||
'time' => '15:00',
|
||||
|
||||
'zone' => 'GMT +3',
|
||||
|
||||
|
@ -27,19 +27,53 @@ class PhpExecutableFinder
|
||||
//$this->executableFinder = new ExecutableFinder();
|
||||
}
|
||||
|
||||
public function getPhpPath()
|
||||
{
|
||||
if ($this->isCpanel()) {
|
||||
return '/usr/local/bin/php';
|
||||
}
|
||||
|
||||
return 'php';
|
||||
}
|
||||
|
||||
public function isCpanel()
|
||||
{
|
||||
return is_dir('/usr/local/cpanel');
|
||||
return $this->checkFolderAndPort('/usr/local/cpanel', 2082);
|
||||
}
|
||||
|
||||
public function isPlesk()
|
||||
{
|
||||
return is_dir('/usr/local/psa');
|
||||
return $this->checkFolderAndPort('/usr/local/psa', 8443);
|
||||
}
|
||||
|
||||
public function isVirtualmin()
|
||||
{
|
||||
return is_dir('/usr/share/webmin');
|
||||
return $this->checkFolderAndPort('/usr/share/webmin', 10000);
|
||||
}
|
||||
|
||||
public function checkFolderAndPort($folder, $port)
|
||||
{
|
||||
try {
|
||||
return is_dir($folder);
|
||||
} catch (\ErrorException | \Exception | \Throwable $e) {
|
||||
return $this->checkSocket($port);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSocket($port)
|
||||
{
|
||||
try {
|
||||
$ip = @gethostbyname('localhost');
|
||||
$link = @fsockopen($ip, $port, $errno, $error);
|
||||
|
||||
if ($link) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (\ErrorException | \Exception | \Throwable $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,11 +85,7 @@ class PhpExecutableFinder
|
||||
{
|
||||
# @override
|
||||
// Not working on shared hosting due to "open_basedir" restriction applied by cPanel/Plesk
|
||||
if ($this->isCpanel()) {
|
||||
return '/usr/local/bin/php';
|
||||
} else {
|
||||
return 'php';
|
||||
}
|
||||
return $this->getPhpPath();
|
||||
|
||||
if ($php = getenv('PHP_BINARY')) {
|
||||
if (!is_executable($php)) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="input-group input-group-merge" :class="group_class">
|
||||
<div v-if="icon" class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa fa-" :class="icon"></i>
|
||||
<i :class="'fa fa-' + icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 long-texts">@date($item->paid_at)</td>
|
||||
<td class="col-md-2 text-center d-none d-md-block">{{ $item->description }}</td>
|
||||
<td class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ $item->contact->name }}</td>
|
||||
@if ($item->type == 'income')
|
||||
@if ($item->isIncome())
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
|
||||
@else
|
||||
@ -83,14 +83,15 @@
|
||||
@endif
|
||||
<td class="col-md-1 text-right d-none d-md-block">
|
||||
<div class="custom-control custom-checkbox">
|
||||
{{ Form::checkbox($item->type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
|
||||
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
|
||||
{{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
|
||||
'data-field' => 'transactions',
|
||||
'v-model' => 'form.transactions.' . $item->type . '_' . $item->id,
|
||||
'id' => 'transaction-' . $item->id . '-'. $item->type,
|
||||
'v-model' => 'form.transactions.' . $type . '_' . $item->id,
|
||||
'id' => 'transaction-' . $item->id . '-'. $type,
|
||||
'class' => 'custom-control-input',
|
||||
'@change' => 'onCalculate'
|
||||
]) }}
|
||||
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $item->type }}"></label>
|
||||
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $type }}"></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -46,7 +46,7 @@
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 long-texts">@date($item->paid_at)</td>
|
||||
<td class="col-md-2 text-center d-none d-md-block">{{ $item->description }}</td>
|
||||
<td class="col-md-2 col-sm-3 col-md-3 d-none d-sm-block">{{ $item->contact->name }}</td>
|
||||
@if ($item->type == 'income')
|
||||
@if ($item->isIncome())
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
|
||||
@else
|
||||
@ -55,14 +55,15 @@
|
||||
@endif
|
||||
<td class="col-md-1 text-right d-none d-md-block">
|
||||
<div class="custom-control custom-checkbox">
|
||||
{{ Form::checkbox($item->type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
|
||||
@php $type = $item->isIncome() ? 'income' : 'expense'; @endphp
|
||||
{{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [
|
||||
'data-field' => 'transactions',
|
||||
'v-model' => 'form.transactions.' . $item->type . '_' . $item->id,
|
||||
'id' => 'transaction-' . $item->id . '-'. $item->type,
|
||||
'v-model' => 'form.transactions.' . $type . '_' . $item->id,
|
||||
'id' => 'transaction-' . $item->id . '-'. $type,
|
||||
'class' => 'custom-control-input',
|
||||
'@change' => 'onCalculate'
|
||||
]) }}
|
||||
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $item->type }}"></label>
|
||||
<label class="custom-control-label" for="transaction-{{ $item->id . '-'. $type }}"></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user