Display earned/spent/net on reports's show view
MODIFY
public/style.css
public/style.css
@@ -21,6 +21,27 @@ h1 {
margin-bottom: 48px;
}
+.spacing-bottom-small {
+ margin-bottom: 16px;
+}
+
+.row {
+ display: flex;
+}
+
+.row .row__column {
+ flex: 1;
+ padding: 0 24px;
+}
+
+.row .row__column:first-child {
+ padding: 0 24px 0 0;
+}
+
+.row .row__column:last-child {
+ padding: 0 0 0 24px;
+}
+
.box {
background: #FFF;
border: 1px solid #EBEDF0;
@@ -36,6 +57,10 @@ h1 {
border: none;
}
+.box .box__section.box__section--align-center {
+ text-align: center;
+}
+
.box table.box__section {
width: 100%;
}

MODIFY
resources/views/reports/show.blade.php
resources/views/reports/show.blade.php
@section('body')
<h1>Report for @lang('months.' . $month), {{ $year }}</h1>
+ <div class="row spacing-bottom-large">
+ <div class="row__column">
+ <div class="box">
+ <div class="box__section box__section--align-center">
+ <h2 class="spacing-bottom-small">@include('partials.currency') {{ App\Earning::where('user_id', Auth::user()->id)->whereMonth('date', $month)->whereYear('date', $year)->sum('amount') }}</h2>
+ <p>Earned</p>
+ </div>
+ </div>
+ </div>
+ <div class="row__column">
+ <div class="box">
+ <div class="box__section box__section--align-center">
+ <h2 class="spacing-bottom-small">@include('partials.currency') {{ App\Spending::where('user_id', Auth::user()->id)->whereMonth('date', $month)->whereYear('date', $year)->sum('amount') }}</h2>
+ <p>Spent</p>
+ </div>
+ </div>
+ </div>
+ <div class="row__column">
+ <div class="box">
+ <div class="box__section box__section--align-center">
+ <h2 class="spacing-bottom-small">@include('partials.currency') {{ App\Earning::where('user_id', Auth::user()->id)->whereMonth('date', $month)->whereYear('date', $year)->sum('amount') - App\Spending::where('user_id', Auth::user()->id)->whereMonth('date', $month)->whereYear('date', $year)->sum('amount') }}</h2>
+ <p>Net</p>
+ </div>
+ </div>
+ </div>
+ </div>
<div class="box spacing-bottom-large">
<div class="box__section">
<p>Alerts</p>

Display earned/spent/net on reports's show view