2014-12-28 01:54:53 -06:00
@ extends ( 'layouts.default' )
@ section ( 'content' )
2014-12-28 11:03:35 -06:00
{{ Breadcrumbs :: renderIfExists ( Route :: getCurrentRoute () -> getName (), $date ) }}
2014-12-28 01:54:53 -06:00
< div class = " row " >
< div class = " col-lg-6 col-md-6 col-sm-12 " >
< table class = " table table-bordered table-striped " >
< tr >
< th > Account </ th >
< th > Start of month </ th >
< th > Current balance </ th >
< th > Spent </ th >
</ tr >
@ foreach ( $accounts as $account )
< tr >
< td >< a href = " { { route('accounts.show', $account->id )}} " > {{{ $account -> name }}} </ a ></ td >
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( $account -> startBalance )}} </ td >
< td > {{ Amount :: format ( $account -> endBalance )}} </ td >
< td > {{ Amount :: format ( $account -> startBalance - $account -> endBalance , false )}} </ td >
2014-12-28 01:54:53 -06:00
</ tr >
@ endforeach
</ table >
</ div >
</ div >
< div class = " row " >
< div class = " col-lg-12 col-md-12 col-sm-12 " >
< table class = " table table-bordered table-striped " >
< tr >
< th colspan = " 2 " > Budgets </ th >
< ? php
$accountSums = [];
?>
@ foreach ( $accounts as $account )
< th >< a href = " { { route('accounts.show', $account->id )}} " > {{{ $account -> name }}} </ a ></ th >
< ? php
$accountSums [ $account -> id ] = 0 ;
?>
@ endforeach
< th colspan = " 2 " >
Left in budget
</ th >
</ tr >
@ foreach ( $budgets as $id => $budget )
< tr >
2014-12-30 08:17:01 -06:00
< td > {{{ $budget [ 'name' ]}}}
@ if ( $id == 0 )
< i class = " fa fa-fw fa-question-circle " data - toggle = " tooltip " data - placement = " top " title = " The calculation used here is slightly different from the row below. The numbers should match. " ></ i >
@ endif
</ td >
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( $budget [ 'amount' ])}} </ td >
2014-12-28 01:54:53 -06:00
< ? php $spent = 0 ; ?>
@ foreach ( $accounts as $account )
@ if ( isset ( $account -> budgetInformation [ $id ]))
2014-12-30 08:17:01 -06:00
< td >
@ if ( $id == 0 )
2015-01-02 02:06:44 -06:00
< a href = " # " > {{ Amount :: format ( $account -> budgetInformation [ $id ][ 'amount' ])}} </ a >
2014-12-30 08:17:01 -06:00
@ else
2015-01-02 02:06:44 -06:00
{{ Amount :: format ( $account -> budgetInformation [ $id ][ 'amount' ])}}
2014-12-30 08:17:01 -06:00
@ endif
</ td >
2014-12-28 01:54:53 -06:00
< ? php
$spent += floatval ( $account -> budgetInformation [ $id ][ 'amount' ]);
$accountSums [ $account -> id ] += floatval ( $account -> budgetInformation [ $id ][ 'amount' ]);
?>
@ else
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( 0 )}} </ td >
2014-12-28 01:54:53 -06:00
@ endif
@ endforeach
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( $budget [ 'amount' ] + $budget [ 'spent' ])}} </ td >
< td > {{ Amount :: format ( $budget [ 'amount' ] + $spent )}} </ td >
2014-12-28 01:54:53 -06:00
</ tr >
@ endforeach
< tr >
2014-12-30 08:17:01 -06:00
< td colspan = " 2 " > Without budget
< i class = " fa fa-fw fa-question-circle " data - toggle = " tooltip " data - placement = " top " title = " The calculation used here is slightly different from the row above. The numbers should match. " ></ i >
</ td >
2014-12-28 01:54:53 -06:00
@ foreach ( $accounts as $account )
@ if ( isset ( $account -> budgetInformation [ 0 ]))
2014-12-30 08:17:01 -06:00
< td >
2015-01-02 02:06:44 -06:00
< a href = " # " > {{ Amount :: format ( $account -> budgetInformation [ 0 ][ 'amount' ])}} </ a >
2014-12-30 08:17:01 -06:00
</ td >
2014-12-28 01:54:53 -06:00
@ else
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( 0 )}} </ td >
2014-12-28 01:54:53 -06:00
@ endif
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Balanced by transfers </ td >
@ foreach ( $accounts as $account )
2014-12-30 08:17:01 -06:00
< td >
2015-01-02 02:06:44 -06:00
< a href = " # " > {{ Amount :: format ( $account -> balancedAmount )}} </ a >
2014-12-30 08:17:01 -06:00
</ td >
2014-12-28 01:54:53 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
<!--
< tr >
< td colspan = " 2 " > Balancing transfers </ td >
@ foreach ( $accounts as $account )
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( 0 )}} </ td >
2014-12-28 01:54:53 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Income </ td >
@ foreach ( $accounts as $account )
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( 0 )}} </ td >
2014-12-28 01:54:53 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
--->
< tr >
< td colspan = " 2 " > Left unbalanced </ td >
@ foreach ( $accounts as $account )
< ? php
$accountSums [ $account -> id ] += $account -> balancedAmount ;
?>
@ if ( isset ( $account -> budgetInformation [ 0 ]))
2014-12-30 08:17:01 -06:00
< td >
2015-01-02 02:06:44 -06:00
< a href = " # " > {{ Amount :: format ( $account -> budgetInformation [ 0 ][ 'amount' ] + $account -> balancedAmount )}} </ a >
2014-12-30 08:17:01 -06:00
</ td >
2014-12-28 01:54:53 -06:00
@ else
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( 0 )}} </ td >
2014-12-28 01:54:53 -06:00
@ endif
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " >< em > Sum </ em ></ td >
@ foreach ( $accounts as $account )
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( $accountSums [ $account -> id ])}} </ td >
2014-12-28 01:54:53 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Expected balance </ td >
@ foreach ( $accounts as $account )
2015-01-02 02:06:44 -06:00
< td > {{ Amount :: format ( $account -> startBalance + $accountSums [ $account -> id ])}} </ td >
2014-12-28 01:54:53 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
</ table >
</ div >
</ div >
2014-12-30 08:17:01 -06:00
<!-- modal to show various budget information -->
< div class = " modal fade " id = " budgetModal " >
</ div >
@ stop
@ section ( 'scripts' )
{{ HTML :: script ( 'assets/javascript/firefly/reports.js' )}}
2015-01-01 23:16:49 -06:00
@ stop