@php $i = 0; @endphp @foreach ($planComptes as $plan) @php $pages = key_exists($plan->id_compte, $grandLivres) ? $grandLivres[$plan->id_compte] : []; @endphp @if(count($pages) > 0) @php $nb_page = count($pages); $report = 0; $cumul_debit = 0; $cumul_credit = 0; $solde = 0; @endphp @foreach ($pages as $k=>$ecritures) @include('compta.pdf.entete')
GRAND LIVRE @if(empty($caisse->id_caisse)) CONSOLIDE @endif
{{$plan->id_compte}} {{mb_strtoupper($plan->libelle_compte,'UTF-8')}} @php if(key_exists($plan->id_compte, $reportArray)){ $report = $reportArray[$plan->id_compte]; } @endphp @if($report>0) REPORT DE SOLDE AU {{(new DateTime($debutPeriode))->format(config('myahs.date_format')) }} : {{\App\Lib\Format::number($report)}} @endif
@if($solde > 0) @endif @foreach($ecritures as $ecriture) @php $i++; $cumul_debit += $ecriture->debit; $cumul_credit += $ecriture->credit; $solde = $report + (($cumul_debit - $cumul_credit) * $multiple); @endphp @endforeach() {{-- @if($k == $nb_page - 1) @endif --}}
Date Journal Libellé Débit Crédit Solde
REPORT PAGE PRECEDENTE {{ App\Lib\Format::number($solde) }}
{{ $i }} {{ (new DateTime($ecriture->date_oper))->format(config('myahs.date_format')) }} {{ $ecriture->id_journal }} {{ $ecriture->libelle }} {{ App\Lib\Format::number($ecriture->debit) }} {{ App\Lib\Format::number($ecriture->credit) }} {{ App\Lib\Format::number($solde) }}
SOUS-TOTAL {{ App\Lib\Format::number($cumul_capital_page) }} {{ App\Lib\Format::number($cumul_interet_page) }} {{ App\Lib\Format::number($cumul_capital_page+$cumul_interet_page) }}
TOTAL {{ App\Lib\Format::number($cumul_capital) }} {{ App\Lib\Format::number($cumul_interet) }} {{ App\Lib\Format::number($cumul_capital+$cumul_interet) }}
@if($k < ($nb_page-1))
@endif @endforeach
@endif @endforeach