2015-02-23 13:25:48 -06:00
@ extends ( 'layouts.default' )
@ section ( 'content' )
2015-02-23 14:19:16 -06:00
{ !! Breadcrumbs :: renderIfExists ( Route :: getCurrentRoute () -> getName (), $date ) !! }
2015-02-23 13:25:48 -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-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( $account -> startBalance ) !! } </ td >
< td > { !! Amount :: format ( $account -> endBalance ) !! } </ td >
< td > { !! Amount :: format ( $account -> startBalance - $account -> endBalance , false ) !! } </ td >
2015-02-23 13:25:48 -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 >
< 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-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( $budget [ 'amount' ]) !! } </ td >
2015-02-23 13:25:48 -06:00
< ? php $spent = 0 ; ?>
@ foreach ( $accounts as $account )
@ if ( isset ( $account -> budgetInformation [ $id ]))
< td >
@ if ( $id == 0 )
2015-02-23 14:19:16 -06:00
< a href = " # " > { !! Amount :: format ( $account -> budgetInformation [ $id ][ 'amount' ]) !! } </ a >
2015-02-23 13:25:48 -06:00
@ else
2015-02-23 14:19:16 -06:00
{ !! Amount :: format ( $account -> budgetInformation [ $id ][ 'amount' ]) !! }
2015-02-23 13:25:48 -06:00
@ endif
</ td >
< ? php
$spent += floatval ( $account -> budgetInformation [ $id ][ 'amount' ]);
$accountSums [ $account -> id ] += floatval ( $account -> budgetInformation [ $id ][ 'amount' ]);
?>
@ else
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( 0 ) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endif
@ endforeach
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( $budget [ 'amount' ] + $budget [ 'spent' ]) !! } </ td >
< td > { !! Amount :: format ( $budget [ 'amount' ] + $spent ) !! } </ td >
2015-02-23 13:25:48 -06:00
</ tr >
@ endforeach
< tr >
< 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 >
@ foreach ( $accounts as $account )
@ if ( isset ( $account -> budgetInformation [ 0 ]))
< td >
2015-02-23 14:19:16 -06:00
< a href = " # " > { !! Amount :: format ( $account -> budgetInformation [ 0 ][ 'amount' ]) !! } </ a >
2015-02-23 13:25:48 -06:00
</ td >
@ else
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( 0 ) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endif
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Balanced by transfers </ td >
@ foreach ( $accounts as $account )
< td >
2015-02-23 14:19:16 -06:00
< a href = " # " > { !! Amount :: format ( $account -> balancedAmount ) !! } </ a >
2015-02-23 13:25:48 -06:00
</ td >
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
<!--
< tr >
< td colspan = " 2 " > Balancing transfers </ td >
@ foreach ( $accounts as $account )
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( 0 ) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Income </ td >
@ foreach ( $accounts as $account )
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( 0 ) !! } </ td >
2015-02-23 13:25:48 -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 ]))
< td >
2015-02-23 14:19:16 -06:00
< a href = " # " > { !! Amount :: format ( $account -> budgetInformation [ 0 ][ 'amount' ] + $account -> balancedAmount ) !! } </ a >
2015-02-23 13:25:48 -06:00
</ td >
@ else
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( 0 ) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endif
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " >< em > Sum </ em ></ td >
@ foreach ( $accounts as $account )
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( $accountSums [ $account -> id ]) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
< tr >
< td colspan = " 2 " > Expected balance </ td >
@ foreach ( $accounts as $account )
2015-02-23 14:19:16 -06:00
< td > { !! Amount :: format ( $account -> startBalance + $accountSums [ $account -> id ]) !! } </ td >
2015-02-23 13:25:48 -06:00
@ endforeach
< td colspan = " 2 " >& nbsp ; </ td >
</ tr >
</ table >
</ div >
</ div >
<!-- modal to show various budget information -->
< div class = " modal fade " id = " budgetModal " >
</ div >
@ stop
@ section ( 'scripts' )
2015-02-23 14:19:16 -06:00
< script type = " text/javascript " src = " js/reports.js " ></ script >
2015-02-23 13:25:48 -06:00
@ stop