@extends('layouts.app') @section('content')
Grand livre
{{-- --}}
@php $mvtDebut = !empty($sumGrandLivre->debit)?$sumGrandLivre->debit:0; $mvtCredit = !empty($sumGrandLivre->credit)?$sumGrandLivre->credit:0; $mtt_report = 0; if(!empty($report->compte_id)){ $mtt_report = $report->debit - $report->credit; } $soldeMvt = $mtt_report + $mvtDebut - $mvtCredit; if($plan_compte->classe == 'result' && substr($plan_compte->id_compte,0,1) == '7'){ $mtt_report = -1*$mtt_report; $soldeMvt = -1*$soldeMvt; } if($plan_compte->classe == 'passif'){ $mtt_report = -1*$mtt_report; $soldeMvt = -1*$soldeMvt; } @endphp
N° compte Libellé Mvt débit Mvt crédit Solde
{{$plan_compte->id_compte}} {{$plan_compte->libelle_compte}} {{App\Lib\Format::number($mvtDebut)}} {{App\Lib\Format::number($mvtCredit)}} {{App\Lib\Format::number($soldeMvt)}}
@csrf
# Date Code Psce Réf journal Libellé Débit Crédit Solde
@php $cumul_debit = 0; $cumul_credit = 0; $solde = 0; $i=0; @endphp @if($mtt_report != 0) @endif @foreach ($ecritures as $ecriture) @php $cumul_debit += $ecriture->debit; $cumul_credit += $ecriture->credit; $variation = $cumul_debit - $cumul_credit; if($plan_compte->classe == 'result' && substr($plan_compte->id_compte,0,1) == '7'){ $variation = -1*$variation; } if($plan_compte->classe == 'passif'){ $variation = -1*$variation; } $solde = $variation + $mtt_report; $i++; @endphp @endforeach
REPORT DE SOLDE {{App\Lib\Format::number($mtt_report)}}
{{$i}} {{(new DateTime($ecriture->date_oper))->format(config('myahs')['date_format'])}} {{$ecriture->code_analytique}} {{$ecriture->caisse_id}} {{$ecriture->id_journal}} {{mb_strtoupper($ecriture->libelle,'UTF-8')}} {{App\Lib\Format::number($ecriture->debit)}} {{App\Lib\Format::number($ecriture->credit)}} @if($solde >= 0) {{App\Lib\Format::number($solde)}} @else ({{App\Lib\Format::number($solde)}}) @endif
{{--
TOTAL {{App\Lib\Format::number($sum_debit)}} {{App\Lib\Format::number($sum_credit)}}
--}}
@endsection