Accounts show see performance button development start..
This commit is contained in:
parent
98566cfa17
commit
05120a94b4
@ -10,6 +10,7 @@ use App\Jobs\Banking\UpdateAccount;
|
||||
use App\Models\Banking\Account;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Banking\Transfer;
|
||||
use App\Utilities\Reports as Utility;
|
||||
use App\Models\Setting\Currency;
|
||||
|
||||
class Accounts extends Controller
|
||||
@ -243,6 +244,23 @@ class Accounts extends Controller
|
||||
return redirect()->route('transfers.create')->withInput($data);
|
||||
}
|
||||
|
||||
public function seePerformance(Account $account)
|
||||
{
|
||||
$data['account_id'] = $account->id;
|
||||
|
||||
$report = Utility::getClassInstance('App\Reports\IncomeExpenseSummary');
|
||||
|
||||
if (empty($report) || empty($report->model)) {
|
||||
$message = trans('accounts.create_report');
|
||||
|
||||
flash($message)->warning()->important();
|
||||
|
||||
return redirect()->route('reports.create');
|
||||
}
|
||||
|
||||
return redirect()->route('reports.show', $report->model->id)->withInput($data);
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
$account_id = (int) request('account_id');
|
||||
|
@ -10,5 +10,7 @@ return [
|
||||
'bank_phone' => 'Bank Phone',
|
||||
'bank_address' => 'Bank Address',
|
||||
'default_account' => 'Default Account',
|
||||
'see_performance' => 'See Performance',
|
||||
'create_report' => 'If you want to see account performance. You can create Income vs Expense report instance.',
|
||||
|
||||
];
|
||||
|
@ -49,8 +49,8 @@
|
||||
|
||||
@stack('performance_button_start')
|
||||
@can('read-banking-accounts')
|
||||
<a class="dropdown-item" href="#">
|
||||
See Performance
|
||||
<a class="dropdown-item" href="{{ route('accounts.see-performance', $account->id) }}">
|
||||
{{ trans('accounts.see_performance') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('performance_button_end')
|
||||
|
@ -131,6 +131,7 @@ Route::group(['prefix' => 'banking'], function () {
|
||||
Route::get('accounts/{account}/create-revenue', 'Banking\Accounts@createRevenue')->name('accounts.create-revenue');
|
||||
Route::get('accounts/{account}/create-payment', 'Banking\Accounts@createPayment')->name('accounts.create-payment');
|
||||
Route::get('accounts/{account}/create-transfer', 'Banking\Accounts@createTransfer')->name('accounts.create-transfer');
|
||||
Route::get('accounts/{account}/see-performance', 'Banking\Accounts@seePerformance')->name('accounts.see-performance');
|
||||
Route::get('accounts/{account}/enable', 'Banking\Accounts@enable')->name('accounts.enable');
|
||||
Route::get('accounts/{account}/disable', 'Banking\Accounts@disable')->name('accounts.disable');
|
||||
Route::get('accounts/{account}/duplicate', 'Banking\Accounts@duplicate')->name('accounts.duplicate');
|
||||
|
Loading…
x
Reference in New Issue
Block a user