<div class="col-md-3">
    <!-- small box -->
    <div class="small-box bg-green">
        <div class="inner">
            <h3>{{ money($grand_total) }}</h3>

            <p>{{ trans("dashboard.total") }}</p>
        </div>
    </div>
</div>
<div class="col-md-3">
    <!-- small box -->
    <div class="small-box bg-aqua">
        <div class="inner">
            <h3>{{ money($total_priciple) }}</h3>
            <p>{{ trans("dashboard.total_priciple")}}</p>
        </div>
    </div>
</div>
<!-- ./col -->
<div class="col-md-3">
    <!-- small box -->
    <div class="small-box bg-green">
        <div class="inner">
            <h3>{{ money($total_rate) }} {{ $total_late > 0 ? "(+" . $total_late .")" : "" }}</h3>
            <p>{{ trans("dashboard.total_rate") }}</p>
        </div>
    </div>
</div>
<!-- ./col -->
<div class="col-md-3">
    <!-- small box -->
    <div class="small-box bg-yellow">
        <div class="inner">
            <h3>{{ money($todayExpense) }}</h3>

            <p>{{ trans("dashboard.expense_today") }}</p>
        </div>
    </div>
</div>
<!-- ./col -->

<div class="col-md-3 col-sm-6 col-xs-12">
    <div class="info-box">
        <span class="info-box-icon bg-aqua"><i class="fa fa-calendar-check-o"></i></span>

        <div class="info-box-content">
            <a href="{{ route('installments.beforePayment') }}">
                <span class="info-box-text">{{ Trans('installments.before_payment')}}</span>
            </a>
            <span class="info-box-number">
        {{ trans('installments.total_before_payment', ['attribute' => count(Payment::beforePayment())])}}
      </span>
        </div>
        <!-- /.info-box-content -->
    </div>
    <!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-3 col-sm-6 col-xs-12">
    <div class="info-box">
        <span class="info-box-icon bg-yellow"><i class="fa fa-usd"></i></span>

        <div class="info-box-content">
            <span class="info-box-text">{{ Trans('dashboard.total_expense') }}</span>
            <span class="info-box-number">{{money($totalExpense)}}</span>
        </div>
        <!-- /.info-box-content -->
    </div>
    <!-- /.info-box -->
</div>
<!-- /.col -->

<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>

<div class="col-md-3 col-sm-6 col-xs-12">
    <div class="info-box">
        <span class="info-box-icon bg-green"><i class="fa fa-money"></i></span>

        <div class="info-box-content">
            <span class="info-box-text">{{ Trans('dashboard.total_income') }}</span>
            <span class="info-box-number">{{money($saleSoFar)}}</span>
        </div>
        <!-- /.info-box-content -->
    </div>
    <!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-3 col-sm-6 col-xs-12">
    <div class="info-box">
        <span class="info-box-icon bg-red"><i class="fa fa-calendar-times-o"></i></span>

        <div class="info-box-content">
            <a href="{{ route("installments.late")}}">
                <span class="info-box-text">{{ Trans('installments.late_payment') }}</span>
            </a>
            <span class="info-box-number">
                {{ trans('installments.total_before_payment', ['attribute' => count(getLatePayments())]) }}
            </span>
        </div>
        <!-- /.info-box-content -->
    </div>
    <!-- /.info-box -->
</div>