diff --git a/app/views/accounts/create.blade.php b/app/views/accounts/create.blade.php index 6e3c7d2128..0a1c2912d9 100644 --- a/app/views/accounts/create.blade.php +++ b/app/views/accounts/create.blade.php @@ -4,98 +4,53 @@ {{Form::hidden('what',$what)}}
-

Mandatory fields

+
+
+ Mandatory fields +
+
+ {{Form::ffText('name')}} + -
- {{ Form::label('name', 'Account name', ['class' => 'col-sm-4 control-label'])}} -
- {{ Form::text('name', Input::old('name'), ['class' => 'form-control']) }} - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - @if($what == 'asset') - - Use something descriptive such as "checking account" or "My Bank Main Account". - - @endif - @if($what == 'expense') - - Use something descriptive such as "Albert Heijn" or "Amazon". - - @endif - @if($what == 'revenue') - - Use something descriptive such as "my mom" or "my job". - - @endif - @endif
- +

+ +

+
- @if($what == 'asset') -

Optional fields

-
- {{ Form::label('openingbalance', 'Opening balance', ['class' => 'col-sm-4 control-label'])}} -
-
- - {{Form::input('number','openingbalance', Input::old('openingbalance'), ['step' => 'any', 'class' => 'form-control'])}} -
- @if($errors->has('openingbalance')) -

{{$errors->first('openingbalance')}}

- @else - What's the current balance of this new account? - @endif +
+
+ Optional fields +
+
+ @if($what == 'asset') + {{Form::ffBalance('openingbalance')}} + {{Form::ffDate('openingbalancedate', date('Y-m-d'))}} + @endif + {{Form::ffCheckbox('active','1',true)}}
-
- {{ Form::label('openingbalancedate', 'Opening balance date', ['class' => 'col-sm-4 control-label'])}} -
- {{ Form::input('date','openingbalancedate', Input::old('openingbalancedate') ?: date('Y-m-d'), ['class' - => 'form-control']) }} - @if($errors->has('openingbalancedate')) -

{{$errors->first('openingbalancedate')}}

- @else - 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. - @endif + + + +
+
+ Options +
+
+ {{Form::ffOptionsList('create','account')}}
- @endif
- -
-
-
- - -
- -
-
- -
-
-
- -
-
- -
-
-
-
- - {{Form::close()}} @stop \ No newline at end of file diff --git a/app/views/accounts/delete.blade.php b/app/views/accounts/delete.blade.php index 7174cb310f..6f2059a15e 100644 --- a/app/views/accounts/delete.blade.php +++ b/app/views/accounts/delete.blade.php @@ -1,44 +1,38 @@ @extends('layouts.default') @section('content') -
-
-

- Remember that deleting something is permanent. -

-
-
- {{Form::open(['class' => 'form-horizontal','url' => route('accounts.destroy',$account->id)])}}
-
- @if($account->transactions()->count() > 0) -

- Account "{{{$account->name}}}" still has {{$account->transactions()->count()}} transaction(s) associated to it. - These will be deleted as well. -

- @endif +
+
+
+ Delete account "{{{$account->name}}}" +
+
+

+ Are you sure? +

-

- Press "Delete permanently" If you are sure you want to delete "{{{$account->name}}}". -

+ @if($account->transactions()->count() > 0) +

+ Account "{{{$account->name}}}" still has {{$account->transactions()->count()}} transaction(s) associated to it. + These will be deleted as well. +

+ @endif + +

+ + Cancel +

+
+
-
- - @if($account->accountType->type == 'Asset account' || $account->accountType->type == 'Default account') - Cancel - @endif - @if($account->accountType->type == 'Expense account' || $account->accountType->type == 'Beneficiary account') - Cancel - @endif - @if($account->accountType->type == 'Revenue account') - Cancel - @endif +
diff --git a/app/views/accounts/edit.blade.php b/app/views/accounts/edit.blade.php index 3393570a0b..eccbd863a0 100644 --- a/app/views/accounts/edit.blade.php +++ b/app/views/accounts/edit.blade.php @@ -11,79 +11,46 @@ {{Form::model($account, ['class' => 'form-horizontal','url' => route('accounts.update',$account->id)])}}
-

Mandatory fields

- -
- {{ Form::label('name', 'Account name', ['class' => 'col-sm-4 control-label'])}} -
- {{ Form::text('name', Input::old('name'), ['class' => 'form-control']) }} - @if($errors->has('name')) -

{{$errors->first('name')}}

- @else - Use something descriptive such as "checking account" or "Albert Heijn". - @endif - +
+
+ Mandatory fields +
+
+ {{Form::ffText('name')}}
- +

+ +

- @if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account') -

Optional fields

- -
- {{ Form::label('openingbalance', 'Opening balance', ['class' => 'col-sm-4 control-label'])}} -
-
- - @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 - -
- - @if($errors->has('openingbalance')) -

{{$errors->first('openingbalance')}}

- @else - What's the current balance of this new account? +
+
+ Optional fields +
+
+ {{Form::ffCheckbox('active','1')}} + @if($account->accounttype->type == 'Default account' || $account->accounttype->type == 'Asset account') + {{Form::ffBalance('openingbalance')}} + {{Form::ffDate('openingbalancedate')}} @endif
-
- {{ Form::label('openingbalancedate', 'Opening balance date', ['class' => 'col-sm-4 control-label'])}} -
- @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')) -

{{$errors->first('openingbalancedate')}}

- @else - 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. - @endif + + +
+
+ Options +
+
+ {{Form::ffOptionsList('create','account')}}
- @endif
- -
-
-
-
-
- -
-
-
-
- - {{Form::close()}} @stop \ No newline at end of file diff --git a/app/views/accounts/index.blade.php b/app/views/accounts/index.blade.php index 545d3f6fc6..d67f0812e1 100644 --- a/app/views/accounts/index.blade.php +++ b/app/views/accounts/index.blade.php @@ -2,42 +2,49 @@ @section('content')
-

Firefly - Accounts -

-

- Accounts are the record holders for transactions and transfers. Money moves from one account to another. -

-

- In a double-entry bookkeeping system almost everything 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. -

-

- Create a new account -

+
+
+ {{{$subTitle}}} + + +
+
+ + +
+
+ + +
+
+ + + + + + + + +
NamebalanceID
+
+
-
-
- @if(count($accounts['personal']) > 0) -

Your accounts

-

- These are your personal accounts. -

+@stop +@section('scripts') +{{HTML::script('assets/javascript/datatables/jquery.dataTables.min.js')}} +{{HTML::script('assets/javascript/datatables/dataTables.bootstrap.js')}} + + +@stop - @include('accounts.list',['accounts' => $accounts['personal']]) - @endif - - @if(count($accounts['beneficiaries']) > 0) -

Beneficiaries

-

- These are beneficiaries; places where you spend money or people who pay you. -

- @include('accounts.list',['accounts' => $accounts['beneficiaries']]) - @endif - -
-
- -@stop \ No newline at end of file +@section('styles') +{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}} +@endsection \ No newline at end of file diff --git a/app/views/accounts/sankey.blade.php b/app/views/accounts/sankey.blade.php new file mode 100644 index 0000000000..b1a29aae7c --- /dev/null +++ b/app/views/accounts/sankey.blade.php @@ -0,0 +1,46 @@ +@extends('layouts.default') +@section('content') + + +
+ + + + +@stop +@section('scripts') + + +@stop \ No newline at end of file diff --git a/app/views/accounts/show.blade.php b/app/views/accounts/show.blade.php index f3148e26f8..e066edc09e 100644 --- a/app/views/accounts/show.blade.php +++ b/app/views/accounts/show.blade.php @@ -4,68 +4,86 @@
- {{{$account->name}}} + {{{$account->name}}}
-
+
@include('partials.date_nav') + + +
+
+ Summary +
+
+ {{-- + + + + + + + + + + + + + + + + + + + + + +
Expense / incomeTransfers
Out + {{mf($show['statistics']['period']['out'])}} + + + {{mf($show['statistics']['period']['t_out'])}} + +
In + {{mf($show['statistics']['period']['in'])}} + + + {{mf($show['statistics']['period']['t_in'])}} + +
Difference{{mf($show['statistics']['period']['diff'])}}{{mf($show['statistics']['period']['t_diff'])}}
+ --}} +
+
-
+
- Summary -
-
- - - - - - - - - - - - - - - - - - - - - -
Expense / incomeTransfers
Out - {{mf($show['statistics']['period']['out'])}} - - - {{mf($show['statistics']['period']['t_out'])}} - -
In - {{mf($show['statistics']['period']['in'])}} - - - {{mf($show['statistics']['period']['t_in'])}} - -
Difference{{mf($show['statistics']['period']['diff'])}}{{mf($show['statistics']['period']['t_diff'])}}
-
-
-
-
-
-
- Related + Transaction
+ + + + + + + + + + + + + +
DateDescriptionAmount (€)FromToBudget / categoryID
+ + {{-- @if(count($show['statistics']['accounts']) > 0) @@ -98,30 +116,49 @@ @endif
+ --}}
+
+
+
+
+ Transaction +
+
+ +
+
+
+
+ +{{--
- -

Transactions For selected account and period

@include('paginated.transactions',['journals' => $show['journals'],'sum' => true])
- +--}} @stop @section('styles') {{HTML::style('assets/stylesheets/highslide/highslide.css')}} +{{HTML::style('assets/stylesheets/datatables/dataTables.bootstrap.css')}} @stop @section('scripts') +{{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 \ No newline at end of file diff --git a/public/assets/javascript/firefly/accounts.js b/public/assets/javascript/firefly/accounts.js index a5fc3b60f3..a6ba2bdb98 100644 --- a/public/assets/javascript/firefly/accounts.js +++ b/public/assets/javascript/firefly/accounts.js @@ -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 '' + data.name + ''; + } + + }, + { + name: 'balance', + data: 'balance', + title: 'Amount (\u20AC)', + searchable: false, + sortable: true, + render: function (data) { + var amount = parseInt(data); + if (amount < 0) { + '\u20AC ' + data.toFixed(2) + '' + } + if (amount > 0) { + '\u20AC ' + data.toFixed(2) + '' + } + return '\u20AC ' + data.toFixed(2) + '' + } + }, + { + name: 'id', + data: 'id', + title: '', + render: function (data) { + return ''; + } + } + ] + }; + $('#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); }); } - - -}); \ No newline at end of file +//$(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); +// }); +//} +// +// +// +//}); \ No newline at end of file