@extends('layout')
@section('title','Journal de caisse ')
@section('description','Journal de caisse')
@section('content')
			<br/>
          <div class="section-body">
		  <div class="row">
              <div class="col-12">
			  @if (session('status'))
            <div class="alert alert-warning" style="font-size: 15px; background-color: #328039; color: white">
                <i class="fa fa-check"></i> &nbsp; {{ session('status') }}
            </div>
        @endif

        @if (session('error'))
            <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white">
                <i class="ti-na"></i> {{ session('error') }}
            </div>
        @endif
        @if ($errors->any())
            <div class="alert alert-danger" style="font-size: 15px; background-color: #fb5757; color: white" >
                <ul>
                    @foreach ($errors->all() as $error)
                        <li> <i class="ti-na"></i> {{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
			  </div>
		  </div>
			<div class="row">
              <div class="col-12">
                <div class="card">
				@php
				$dpf =  number_format($depensefou, 0, ' ', ' ');
				$ttv =  number_format($totalvente, 0, ' ', ' ');
				$ttr =  number_format($totrec, 0, ' ', ' ');
				$dpf =  number_format($depensefou, 0, ' ', ' ');
				@endphp
                  <div class="card-header">
                    <h4>Recettes</h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th style="text-align:center;">Libellé</th>
							<th style="text-align:center;">Montant</th>
                          </tr>
                        </thead>
                        <tbody>
						<tr>
							<td style="text-align:center;">Total ventes</td>
							<td style="text-align:center;">{{$ttv}}</td>
						</tr>
						
						<tr hidden>
							<td>Total recette</td>
							<td>{{$ttr}}</td>
						</tr>
						</tbody>
						</table>
                    </div>
                  </div>
                </div>
				<div class="card">
                  <div class="card-header">
                    <h4 style="text-align:right">Dépenses</h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th style="text-align:center;">Libellé</th>
							<th style="text-align:center;">Montant</th>
                          </tr>
                        </thead>
                        <tbody>
						<tr>
							<td style="text-align:center;">Montant total des approvisionnements</td>
							<td style="text-align:center;">{{$dpf}}</td>
						</tr>
						<tr hidden>
							<td >Décaissement & autres dépenses</td>
							<td>{{$autredepense}}</td>
						</tr>
						<tr hidden>
							<td style="text-align:center;">Total dépenses</td>
							<td style="text-align:center;">{{$totdep}}</td>
						</tr>
						</tbody>
						</table>
                    </div>
                  </div>
                </div>
				<div class="card">
                  <div class="card-header">
                    <h4 style="text-align:right">Bénéfice</h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th style="text-align:center;">Bénéfice</th>
							<th style="text-align:center;">{{$benefice}}</th>
                          </tr>
                        </thead>
						</table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
		
@endsection