Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
Finishing the cash component new UI (adding informations, exact forma…
Browse files Browse the repository at this point in the history
…ts, ...)
  • Loading branch information
Saluki committed Jun 6, 2015
1 parent 10df042 commit bf323ba
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CashController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function dashboard($requestedSnapshot=null)
}
}

$snapshotDetails = $this->detailsRepository->fromSnapshot($snapshot->cs_id);
$snapshotDetails = $this->detailsRepository->fromSnapshot($snapshot->cs_id);
$allSnapshots = $this->repository->all();

$cashArray = [ floatval($snapshot->amount) ];
Expand Down
2 changes: 1 addition & 1 deletion app/Models/SnapshotDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SnapshotDetails extends Model {
public function scopeGroup($query, $groupID) {

$query->join('cash_snapshots', 'cash_snapshots.cs_id', '=', 'snapshot_details.cs_id')
->where('group_id', $groupID);
->where('cash_snapshots.group_id', $groupID);
}

}
1 change: 1 addition & 0 deletions app/Repositories/SnapshotDetailsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function fromSnapshot($id)

try {
return $this->model->group( Session::get('groupID') )
->leftJoin('users', 'snapshot_details.user_id', '=', 'users.user_id')
->where('snapshot_details.cs_id', '=', $id)
->get();
}
Expand Down
42 changes: 30 additions & 12 deletions resources/views/cash/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@

<div class="row">
<div class="col-md-5">
<h2>{{ $snapshot->snapshot_title }} <span class="text-primary">#{{ $snapshot->cs_id }}</span></h2>
<h2>
{{ $snapshot->snapshot_title }} <span class="text-primary">#{{ $snapshot->cs_id }}</span>
</h2>
</div>
<div class="col-md-7" style="padding-top:20px;">

Expand All @@ -58,11 +60,19 @@
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
@foreach($allSnapshots as $s)
<li role="presentation" @if($s->cs_id === $snapshot->cs_id) class="disabled" @endif>
<a role="menuitem" tabindex="-1" href="{{ url('app/cash/'.$s->cs_id) }}">
{{ $s->snapshot_title }}&nbsp;&nbsp;<span class="text-primary">#{{ $s->cs_id }}</span>
</a>
</li>
@if($s->cs_id === $snapshot->cs_id)
<li role="presentation" class="disabled">
<a role="menuitem" tabindex="-1" href="#">
{{ $s->snapshot_title }}&nbsp;&nbsp;<span class="text-primary">#{{ $s->cs_id }}</span>
</a>
</li>
@else
<li role="presentation">
<a role="menuitem" tabindex="-1" href="{{ url('app/cash/'.$s->cs_id) }}">
{{ $s->snapshot_title }}&nbsp;&nbsp;<span class="text-primary">#{{ $s->cs_id }}</span>
</a>
</li>
@endif
@endforeach
</ul>
</div>
Expand All @@ -88,20 +98,20 @@
<div class="stat-title">Last Cash Operation</div>
<div class="stat-number">
@if( $lastOperation>0 )
+{{ $lastOperation }}
+{{ number_format($lastOperation,2) }}
@else
{{ $lastOperation }}
{{ number_format($lastOperation,2) }}
@endif
</div>
</div>
<div class="stat-tile">
<div class="stat-title">Cash In Drawer</div>
<div class="stat-number">{{ end($amounts) }}€</div>
<div class="stat-number">{{ number_format(end($amounts),2) }}€</div>
</div>

<div class="stat-tile">
<div class="stat-title">Cash By Sales</div>
<div class="stat-number">+{{ $cashBySales }}€</div>
<div class="stat-number">+{{ number_format($cashBySales,2) }}€</div>
</div>

</div>
Expand All @@ -116,7 +126,15 @@
<div class="panel-body">

@if( count($details)==0 )
<h4 class="text-muted" style="text-align: center;">This snapshot has no cash operations or sales.</h4>

<div id="init-container">
<div class="fa fa-archive"></div>

<div class="intro-text">
This snapshot has no cash operations or sales.
</div>
</div>

@else
<div class="row" style="margin:10px;text-align: center;">
<div class="col-md-6">
Expand Down Expand Up @@ -156,7 +174,7 @@
@endif">{{ $detail->type }}</div></td>
<td>{{ $detail->sum }}€</td>
<td>{{ date('j F Y G:i', strtotime($detail->time)) }}</td>
<td>#{{ $detail->user_id }}</td>
<td>{{ $detail->firstname }} {{ $detail->lastname }}</td>
<td>{{ str_limit($detail->comment,20) }}</td>
</tr>
@endforeach
Expand Down

0 comments on commit bf323ba

Please sign in to comment.