mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-29 02:11:12 -06:00
New views and layouts for the account controller.
This commit is contained in:
parent
899f61671f
commit
e5f8db78f9
@ -4,98 +4,53 @@
|
||||
{{Form::hidden('what',$what)}}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h4>Mandatory fields</h4>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa {{{$subTitleIcon}}}"></i> Mandatory fields
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{Form::ffText('name')}}
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', 'Account name', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::text('name', Input::old('name'), ['class' => 'form-control']) }}
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
@if($what == 'asset')
|
||||
<span class="help-block">
|
||||
Use something descriptive such as "checking account" or "My Bank Main Account".
|
||||
</span>
|
||||
@endif
|
||||
@if($what == 'expense')
|
||||
<span class="help-block">
|
||||
Use something descriptive such as "Albert Heijn" or "Amazon".
|
||||
</span>
|
||||
@endif
|
||||
@if($what == 'revenue')
|
||||
<span class="help-block">
|
||||
Use something descriptive such as "my mom" or "my job".
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="btn btn-lg btn-success">
|
||||
<i class="fa fa-plus-circle"></i> Store new {{{$what}}} account
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
@if($what == 'asset')
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('openingbalance', 'Opening balance', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
{{Form::input('number','openingbalance', Input::old('openingbalance'), ['step' => 'any', 'class' => 'form-control'])}}
|
||||
</div>
|
||||
|
||||
@if($errors->has('openingbalance'))
|
||||
<p class="text-danger">{{$errors->first('openingbalance')}}</p>
|
||||
@else
|
||||
<span class="help-block">What's the current balance of this new account?</span>
|
||||
@endif
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-smile-o"></i> Optional fields
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@if($what == 'asset')
|
||||
{{Form::ffBalance('openingbalance')}}
|
||||
{{Form::ffDate('openingbalancedate', date('Y-m-d'))}}
|
||||
@endif
|
||||
{{Form::ffCheckbox('active','1',true)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('openingbalancedate', 'Opening balance date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::input('date','openingbalancedate', Input::old('openingbalancedate') ?: date('Y-m-d'), ['class'
|
||||
=> 'form-control']) }}
|
||||
@if($errors->has('openingbalancedate'))
|
||||
<p class="text-danger">{{$errors->first('openingbalancedate')}}</p>
|
||||
@else
|
||||
<span class="help-block">When was this the balance of the new account? Since your bank statements may lag behind, update this date to match the date of the last known balance of the account.</span>
|
||||
@endif
|
||||
|
||||
|
||||
<!-- panel for options -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-bolt"></i> Options
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{Form::ffOptionsList('create','account')}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
||||
<!-- add another after this one? -->
|
||||
<div class="form-group">
|
||||
<label for="create" class="col-sm-4 control-label"> </label>
|
||||
<div class="col-sm-8">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
{{Form::checkbox('create',1,Input::old('create') == '1')}}
|
||||
Create another (return to this form)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Create the {{{$what}}} account</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{Form::close()}}
|
||||
@stop
|
@ -1,44 +1,38 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<p class="lead">
|
||||
Remember that deleting something is permanent.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('accounts.destroy',$account->id)])}}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
@if($account->transactions()->count() > 0)
|
||||
<p class="text-info">
|
||||
Account "{{{$account->name}}}" still has {{$account->transactions()->count()}} transaction(s) associated to it.
|
||||
These will be deleted as well.
|
||||
</p>
|
||||
@endif
|
||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||
<div class="panel panel-red">
|
||||
<div class="panel-heading">
|
||||
Delete account "{{{$account->name}}}"
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
Are you sure?
|
||||
</p>
|
||||
|
||||
<p class="text-danger">
|
||||
Press "Delete permanently" If you are sure you want to delete "{{{$account->name}}}".
|
||||
</p>
|
||||
@if($account->transactions()->count() > 0)
|
||||
<p class="text-info">
|
||||
Account "{{{$account->name}}}" still has {{$account->transactions()->count()}} transaction(s) associated to it.
|
||||
These will be deleted as well.
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<p>
|
||||
<button type="submit" class="btn btn-default btn-danger">Delete permanently</button>
|
||||
<a href="{{URL::previous()}}" class="btn-default btn">Cancel</a >
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-danger">Delete permanently</button>
|
||||
@if($account->accountType->type == 'Asset account' || $account->accountType->type == 'Default account')
|
||||
<a href="{{route('accounts.asset')}}" class="btn-default btn">Cancel</a >
|
||||
@endif
|
||||
@if($account->accountType->type == 'Expense account' || $account->accountType->type == 'Beneficiary account')
|
||||
<a href="{{route('accounts.expense')}}" class="btn-default btn">Cancel</a >
|
||||
@endif
|
||||
@if($account->accountType->type == 'Revenue account')
|
||||
<a href="{{route('accounts.revenue')}}" class="btn-default btn">Cancel</a >
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,79 +11,46 @@
|
||||
{{Form::model($account, ['class' => 'form-horizontal','url' => route('accounts.update',$account->id)])}}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<h4>Mandatory fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', 'Account name', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::text('name', Input::old('name'), ['class' => 'form-control']) }}
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span
|
||||
class="help-block">Use something descriptive such as "checking account" or "Albert Heijn".</span>
|
||||
@endif
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<i class="fa {{{$subTitleIcon}}}"></i> Mandatory fields
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{Form::ffText('name')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="btn btn-lg btn-success">
|
||||
Update account
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
@if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account')
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('openingbalance', 'Opening balance', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
@if(!is_null($openingBalance))
|
||||
{{Form::input('number','openingbalance', Input::old('openingbalance') ?: $openingBalance->transactions[1]->amount, ['step' => 'any', 'class' => 'form-control'])}}
|
||||
@else
|
||||
{{Form::input('number','openingbalance', Input::old('openingbalance'), ['step' => 'any', 'class' => 'form-control'])}}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@if($errors->has('openingbalance'))
|
||||
<p class="text-danger">{{$errors->first('openingbalance')}}</p>
|
||||
@else
|
||||
<span class="help-block">What's the current balance of this new account?</span>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-smile-o"></i> Optional fields
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{Form::ffCheckbox('active','1')}}
|
||||
@if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account')
|
||||
{{Form::ffBalance('openingbalance')}}
|
||||
{{Form::ffDate('openingbalancedate')}}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('openingbalancedate', 'Opening balance date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
@if(!is_null($openingBalance))
|
||||
{{ Form::input('date','openingbalancedate', Input::old('openingbalancedate') ?: $openingBalance->date->format('Y-m-d'), ['class' => 'form-control']) }}
|
||||
@else
|
||||
{{ Form::input('date','openingbalancedate', Input::old('openingbalancedate') ?: '', ['class' => 'form-control']) }}
|
||||
@endif
|
||||
@if($errors->has('openingbalancedate'))
|
||||
<p class="text-danger">{{$errors->first('openingbalancedate')}}</p>
|
||||
@else
|
||||
<span class="help-block">When was this the balance of the new account? Since your bank statements may lag behind, update this date to match the date of the last known balance of the account.</span>
|
||||
@endif
|
||||
|
||||
<!-- panel for options -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-bolt"></i> Options
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{Form::ffOptionsList('create','account')}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit" class="btn btn-default btn-success">Update {{{$account->name}}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{Form::close()}}
|
||||
@stop
|
@ -2,42 +2,49 @@
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Accounts</small>
|
||||
</h1>
|
||||
<p class="lead">
|
||||
Accounts are the record holders for transactions and transfers. Money moves from one account to another.
|
||||
</p>
|
||||
<p class="text-info">
|
||||
In a double-entry bookkeeping system almost <em>everything</em> is an account. Your own personal
|
||||
bank accounts are representated as accounts (naturally), but the stores you buy stuff at are also
|
||||
represented as accounts. Likewise, if you have a job, your salary is drawn from their account.
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{route('accounts.create')}}" class="btn btn-success">Create a new account</a>
|
||||
</p>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa {{{$subTitleIcon}}}"></i> {{{$subTitle}}}
|
||||
|
||||
<!-- ACTIONS MENU -->
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
|
||||
Actions
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
<li><a href="{{route('accounts.create',$what)}}"><i class="fa fa-plus fa-fw"></i> New {{$what}} account</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table id="accountTable" class="table table-striped table-bordered" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>balance</th>
|
||||
<th>ID</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
@if(count($accounts['personal']) > 0)
|
||||
<h3>Your accounts</h3>
|
||||
<p style="width:50%;" class="text-info">
|
||||
These are your personal accounts.
|
||||
</p>
|
||||
@stop
|
||||
@section('scripts')
|
||||
{{HTML::script('assets/javascript/datatables/jquery.dataTables.min.js')}}
|
||||
{{HTML::script('assets/javascript/datatables/dataTables.bootstrap.js')}}
|
||||
<script type="text/javascript">
|
||||
var URL = '{{route('accounts.json',e($what))}}';
|
||||
</script>
|
||||
<script src="assets/javascript/firefly/accounts.js"></script>
|
||||
@stop
|
||||
|
||||
@include('accounts.list',['accounts' => $accounts['personal']])
|
||||
@endif
|
||||
|
||||
@if(count($accounts['beneficiaries']) > 0)
|
||||
<h3>Beneficiaries</h3>
|
||||
<p style="width:50%;" class="text-info">
|
||||
These are beneficiaries; places where you spend money or people who pay you.
|
||||
</p>
|
||||
@include('accounts.list',['accounts' => $accounts['beneficiaries']])
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@section('styles')
|
||||
{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}}
|
||||
@endsection
|
46
app/views/accounts/sankey.blade.php
Normal file
46
app/views/accounts/sankey.blade.php
Normal file
@ -0,0 +1,46 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
|
||||
|
||||
<div id="sankey_multiple" style="width: 900px; height: 400px;"></div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@stop
|
||||
@section('scripts')
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['sankey']}]}">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
google.setOnLoadCallback(drawChart);
|
||||
function drawChart() {
|
||||
var data = new google.visualization.DataTable();
|
||||
data.addColumn('string', 'From');
|
||||
data.addColumn('string', 'To');
|
||||
data.addColumn('number', 'Weight');
|
||||
data.addRows([
|
||||
<?php $c = 0;?>
|
||||
@foreach($filtered as $index => $entry)
|
||||
[ '{{{$entry['from']}}}', '{{{$entry['to']}}}', {{{$entry['amount']}}} ], // {{$c}}
|
||||
<?php $c++ ?>
|
||||
@endforeach
|
||||
|
||||
]);
|
||||
|
||||
// Set chart options
|
||||
var options = {
|
||||
width: 600,
|
||||
|
||||
sankey: {
|
||||
link: { color: { fill: '#9fa8da', fillOpacity: 0.8 } },
|
||||
node: { color: { fill: '#a61d4c' },
|
||||
label: { color: '#871b47' } }
|
||||
}
|
||||
};
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var chart = new google.visualization.Sankey(document.getElementById('sankey_multiple'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
</script>
|
||||
@stop
|
@ -4,68 +4,86 @@
|
||||
<div class="col-lg-8 col-md-6 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa {{$subTitleIcon}} fa-fw"></i> {{{$account->name}}}
|
||||
<i class="fa fa-fw {{$subTitleIcon}} fa-fw"></i> {{{$account->name}}}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="chart"></div>
|
||||
<div id="accountTransactionsTable"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<!-- time based navigation -->
|
||||
@include('partials.date_nav')
|
||||
|
||||
<!-- summary of the selected period -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-align-justify"></i> Summary
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{{--
|
||||
<table class="table table-striped table-condensed">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Expense / income</th>
|
||||
<th>Transfers</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Out</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['out'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transactions&show=expenses"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['t_out'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transfers&show=out"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>In</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['in'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transactions&show=income"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['t_in'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transfers&show=in"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Difference</td>
|
||||
<td>{{mf($show['statistics']['period']['diff'])}}</td>
|
||||
<td>{{mf($show['statistics']['period']['t_diff'])}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Summary
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped table-condensed">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Expense / income</th>
|
||||
<th>Transfers</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Out</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['out'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transactions&show=expenses"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['t_out'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transfers&show=out"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>In</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['in'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transactions&show=income"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
<td>
|
||||
{{mf($show['statistics']['period']['t_in'])}}
|
||||
<a href="{{route('accounts.show',$account->id)}}?type=transfers&show=in"><span class="glyphicon glyphicon-circle-arrow-right"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Difference</td>
|
||||
<td>{{mf($show['statistics']['period']['diff'])}}</td>
|
||||
<td>{{mf($show['statistics']['period']['t_diff'])}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Related
|
||||
<i class="fa fa-repeat fa-fw"></i> Transaction
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<table id="transactionByAccountTable" class="table table-striped table-bordered" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Description</th>
|
||||
<th>Amount (€)</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
<th>Budget / category</th>
|
||||
<th>ID</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
{{--
|
||||
<table class="table table-striped table-condensed">
|
||||
@if(count($show['statistics']['accounts']) > 0)
|
||||
<tr>
|
||||
@ -98,30 +116,49 @@
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-repeat fa-fw"></i> Transaction
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
|
||||
|
||||
<h4>Transactions <small> For selected account and period</small></h4>
|
||||
@include('paginated.transactions',['journals' => $show['journals'],'sum' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
--}}
|
||||
@stop
|
||||
|
||||
@section('styles')
|
||||
{{HTML::style('assets/stylesheets/highslide/highslide.css')}}
|
||||
{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}}
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
var accountID = {{$account->id}};
|
||||
var accountID = {{{$account->id}}};
|
||||
var URL = 'bla bla bla';
|
||||
var container = 'transactionByAccountTable';
|
||||
</script>
|
||||
{{HTML::script('assets/javascript/datatables/jquery.dataTables.min.js')}}
|
||||
{{HTML::script('assets/javascript/datatables/dataTables.bootstrap.js')}}
|
||||
{{HTML::script('assets/javascript/datatables/transactions.js')}}
|
||||
{{HTML::script('assets/javascript/highcharts/highcharts.js')}}
|
||||
{{HTML::script('assets/javascript/firefly/accounts.js')}}
|
||||
@stop
|
@ -1,12 +1,72 @@
|
||||
$(function () {
|
||||
if($('#chart').length == 1) {
|
||||
/**
|
||||
* get data from controller for home charts:
|
||||
*/
|
||||
if ($('#accountTable').length == 1) {
|
||||
drawDatatable();
|
||||
}
|
||||
//if ($('#accountTransactionsTable').length == 1) {
|
||||
// drawTransactionsForAccount();
|
||||
//}
|
||||
if ($('#transactionByAccountTable').length == 1) {
|
||||
renderTransactionsFromURL(URL, container);
|
||||
}
|
||||
});
|
||||
|
||||
function drawDatatable() {
|
||||
var opt = {
|
||||
serverSide: true,
|
||||
ajax: URL,
|
||||
paging: true,
|
||||
processing: true,
|
||||
columns: [
|
||||
{
|
||||
name: 'name',
|
||||
data: 'name',
|
||||
searchable: true,
|
||||
render: function (data) {
|
||||
return '<a href="' + data.url + '">' + data.name + '</a>';
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
name: 'balance',
|
||||
data: 'balance',
|
||||
title: 'Amount (\u20AC)',
|
||||
searchable: false,
|
||||
sortable: true,
|
||||
render: function (data) {
|
||||
var amount = parseInt(data);
|
||||
if (amount < 0) {
|
||||
'<span class="text-danger">\u20AC ' + data.toFixed(2) + '</span>'
|
||||
}
|
||||
if (amount > 0) {
|
||||
'<span class="text-info">\u20AC ' + data.toFixed(2) + '</span>'
|
||||
}
|
||||
return '<span class="text-info">\u20AC ' + data.toFixed(2) + '</span>'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'id',
|
||||
data: 'id',
|
||||
title: '',
|
||||
render: function (data) {
|
||||
return '<div class="btn-group btn-group-xs">' +
|
||||
'<a class="btn btn-default btn-xs" href="' + data.edit + '">' +
|
||||
'<span class="glyphicon glyphicon-pencil"</a>' +
|
||||
'<a class="btn btn-danger btn-xs" href="' + data.delete + '">' +
|
||||
'<span class="glyphicon glyphicon-trash"</a>' +
|
||||
'</a></div>';
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
$('#accountTable').DataTable(opt);
|
||||
}
|
||||
|
||||
|
||||
function drawTransactionsForAccount() {
|
||||
$.getJSON('chart/home/account/' + accountID).success(function (data) {
|
||||
var options = {
|
||||
chart: {
|
||||
renderTo: 'chart',
|
||||
renderTo: 'accountTransactionsTable',
|
||||
type: 'spline'
|
||||
},
|
||||
|
||||
@ -18,7 +78,7 @@ if($('#chart').length == 1) {
|
||||
allowDecimals: false,
|
||||
labels: {
|
||||
formatter: function () {
|
||||
if(this.value >= 1000 || this.value <= -1000) {
|
||||
if (this.value >= 1000 || this.value <= -1000) {
|
||||
return '\u20AC ' + (this.value / 1000) + 'k';
|
||||
}
|
||||
return '\u20AC ' + this.value;
|
||||
@ -37,10 +97,10 @@ if($('#chart').length == 1) {
|
||||
text: null
|
||||
}
|
||||
},
|
||||
legend: {enabled:false},
|
||||
legend: {enabled: false},
|
||||
tooltip: {
|
||||
formatter: function () {
|
||||
return this.series.name + ': \u20AC ' + Highcharts.numberFormat(this.y,2);
|
||||
return this.series.name + ': \u20AC ' + Highcharts.numberFormat(this.y, 2);
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
@ -68,10 +128,84 @@ if($('#chart').length == 1) {
|
||||
enabled: false
|
||||
}
|
||||
};
|
||||
$('#chart').highcharts(options);
|
||||
$('#accountTransactionsTable').highcharts(options);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
//$(function () {
|
||||
//if($('#chart').length == 1) {
|
||||
// /**
|
||||
// * get data from controller for home charts:
|
||||
// */
|
||||
// $.getJSON('chart/home/account/' + accountID).success(function (data) {
|
||||
// var options = {
|
||||
// chart: {
|
||||
// renderTo: 'chart',
|
||||
// type: 'spline'
|
||||
// },
|
||||
//
|
||||
// series: data.series,
|
||||
// title: {
|
||||
// text: null
|
||||
// },
|
||||
// yAxis: {
|
||||
// allowDecimals: false,
|
||||
// labels: {
|
||||
// formatter: function () {
|
||||
// if(this.value >= 1000 || this.value <= -1000) {
|
||||
// return '\u20AC ' + (this.value / 1000) + 'k';
|
||||
// }
|
||||
// return '\u20AC ' + this.value;
|
||||
//
|
||||
// }
|
||||
// },
|
||||
// title: {text: null}
|
||||
// },
|
||||
// xAxis: {
|
||||
// type: 'datetime',
|
||||
// dateTimeLabelFormats: {
|
||||
// day: '%e %b',
|
||||
// week: '%e %b'
|
||||
// },
|
||||
// title: {
|
||||
// text: null
|
||||
// }
|
||||
// },
|
||||
// legend: {enabled:false},
|
||||
// tooltip: {
|
||||
// formatter: function () {
|
||||
// return this.series.name + ': \u20AC ' + Highcharts.numberFormat(this.y,2);
|
||||
// }
|
||||
// },
|
||||
// plotOptions: {
|
||||
// line: {
|
||||
// shadow: true
|
||||
// },
|
||||
// series: {
|
||||
// cursor: 'pointer',
|
||||
// negativeColor: '#FF0000',
|
||||
// threshold: 0,
|
||||
// lineWidth: 1,
|
||||
// marker: {
|
||||
// radius: 0
|
||||
// },
|
||||
// point: {
|
||||
// events: {
|
||||
// click: function (e) {
|
||||
// alert('click!');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// credits: {
|
||||
// enabled: false
|
||||
// }
|
||||
// };
|
||||
// $('#chart').highcharts(options);
|
||||
// });
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
//});
|
Loading…
Reference in New Issue
Block a user