Blame view

resources/views/reports/income_expense_summary/body.blade.php 2.56 KB
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  <div class="box-body">
      {!! $chart->render() !!}
  
      <hr>
  
      <div class="table table-responsive">
          <table class="table table-bordered table-striped table-hover" id="tbl-payments">
              <thead>
              <tr>
                  <th>{{ trans_choice('general.categories', 1) }}</th>
                  @foreach($dates as $date)
                      <th class="text-right">{{ $date }}</th>
                  @endforeach
              </tr>
              </thead>
              <tbody>
              @if ($compares)
                  @foreach($compares as $type =>  $categories)
                      @foreach($categories as $category_id =>  $category)
                          <tr>
                              @if($type == 'income')
                                  <td>{{ $income_categories[$category_id] }}</td>
                              @else
                                  <td>{{ $expense_categories[$category_id] }}</td>
                              @endif
                              @foreach($category as $item)
                                  @if($type == 'income')
                                      <td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
                                  @else
                                      <td class="text-right">@money(-$item['amount'], $item['currency_code'], true)</td>
                                  @endif
                              @endforeach
                          </tr>
                      @endforeach
                  @endforeach
              @else
                  <tr>
                      <td colspan="13">
                          <h5 class="text-center">{{ trans('general.no_records') }}</h5>
                      </td>
                  </tr>
              @endif
              </tbody>
              <tfoot>
              <tr>
                  <th>{{ trans_choice('general.totals', 1) }}</th>
                  @foreach($totals as $total)
                      <th class="text-right">
                          @if($total['amount'] == 0)
                              <span>@money($total['amount'], $total['currency_code'], true)</span>
                          @elseif($total['amount'] > 0)
                              <span class="text-green">@money($total['amount'], $total['currency_code'], true)</span>
                          @else
                              <span class="text-red">@money($total['amount'], $total['currency_code'], true)</span>
                          @endif
                      </th>
                  @endforeach
              </tr>
              </tfoot>
          </table>
      </div>
  </div>
  
  @push('js')
  {!! Charts::assets() !!}
  @endpush