@extends('layouts.client') @php $page_title = 'Mon espace'; @endphp @section('meta-title','Mes bons d’achat') @section('meta-keywords','') @section('meta-description','') @section('content')

{!! lang('Retrouvez l’ensemble de vos bons d’achat et codes de réduction. Pour utiliser un bon d’achat, il vous suffit de renseigner le code de réduction dans l’espace prévu au moment du paiement.') !!}

{!! lang('Nous vous rappelons que la plateforme permet l’utilisation d’un seul code d’achat par commande.') !!}

@foreach( auth()->user()->cartes->where('type','bon') as $carte ) @endforeach @foreach( auth()->user()->cartes->where('type','bonus') as $carte ) @endforeach @foreach ($affs as $aff) @endforeach @foreach( auth()->user()->cartes->where('type','carte') as $carte ) @endforeach
{!! lang('Nature du bon') !!} {!! lang('Code') !!} {!! lang("Date d'émission") !!} {!! lang('Date limite de validité') !!} {!! lang("Type d'achat") !!} {!! lang('Statut') !!} {!! lang('Solde TTC') !!}
{!! lang('Bons de réduction') !!} {{ auth()->user()->cartes->where('type','bon')->sum('montant_restant') }} €
{{ $carte->offreur->nom ?? '' }} {{ $carte->offreur->prenom ?? '' }} {{ $carte->code }} {{ \Carbon\Carbon::parse( $carte->created_at )->format('d-m-Y') }} {{ $carte->expire_date ? \Carbon\Carbon::parse( $carte->expire_date )->format('d-m-Y'): 'Illimité' }} @if($carte->achat_mobilier)
{{ lang('Produits ') }}
@endif @if($carte->achat_essentiel)
{{ lang('Essentiel ') }}
@endif @if($carte->achat_incontournable)
{{ lang('Incontournable ') }}
@endif @if($carte->achat_fantastique)
{{ lang('Fantastique ') }}
@endif
{{ $carte->statut }} {{ $carte->montant_restant }} €
{!! lang('Bonus de parrainage') !!}
{{ $carte->offreur->nom ?? '' }} {{ $carte->offreur->prenom ?? '' }} {{ $carte->code }} {{ \Carbon\Carbon::parse( $carte->created_at )->format('d-m-Y') }} {{ $carte->expire_date ? \Carbon\Carbon::parse( $carte->expire_date )->format('d-m-Y'): 'Illimité' }} @if($carte->achat_mobilier)
{{ lang('Produits ') }}
@endif @if($carte->achat_essentiel)
{{ lang('Essentiel ') }}
@endif @if($carte->achat_incontournable)
{{ lang('Incontournable ') }}
@endif @if($carte->achat_fantastique)
{{ lang('Fantastique ') }}
@endif
{{ $carte->statut }} @php $date = new Carbon(\App\Models\User::where('code_parrainage', $carte->code)->first()->created_at?? null); $date_changement_parrainage = Carbon::createFromFormat('Y/m/d H:i:s', '2022/04/22 00:00:01'); @endphp @if($carte->montant_restant != 0 && $date->gte($date_changement_parrainage))
15 €
@endif {{ $carte->montant_restant }} €
{!! lang('Affiliation') !!}
{{ $aff->owner }} {{ $aff->code }} {{ \Carbon\Carbon::parse($aff->created_at)->format('d-m-Y') }} {{ $aff->expire_date ? \Carbon\Carbon::parse($aff->expire_date)->format('d-m-Y') : 'Illimité' }} @if ($aff->code_incontournable)
{{ lang('Incontournable ') }}
@endif @if ($aff->code_fantastique)
{{ lang('Fantastique ') }}
@endif
@if ($aff->status == 0) Invalide @elseif ($aff->expire_date && (new \Carbon\Carbon($aff->expire_date))->isPast()) Expiré @else @php $previous_achat = \App\Models\Achat::where('affiliation_code', $aff->code) ->where('user_id', auth()->id()) ->whereStatus('Payé') ->first(); @endphp @if ($previous_achat) Utilisé @else Valide @endif @endif @if ($aff->code_incontournable)
{{ $aff->code_incontournable }} €
@endif @if ($aff->code_fantastique)
{{ $aff->code_fantastique }} €
@endif
{!! lang('Cartes cadeaux') !!} {{ auth()->user()->cartes->where('type','carte')->sum('montant_restant') }} €
{{ $carte->offreur->nom ?? '' }} {{ $carte->offreur->prenom ?? '' }} {{ $carte->code }} {{ \Carbon\Carbon::parse( $carte->created_at )->format('d-m-Y') }} {{ $carte->expire_date ? \Carbon\Carbon::parse( $carte->expire_date )->format('d-m-Y'): 'Illimité' }} @if($carte->achat_mobilier)
{{ lang('Produits ') }}
@endif @if($carte->achat_essentiel)
{{ lang('Essentiel ') }}
@endif @if($carte->achat_incontournable)
{{ lang('Incontournable ') }}
@endif @if($carte->achat_fantastique)
{{ lang('Fantastique ') }}
@endif
{{ $carte->statut }} {{ $carte->montant_restant }} €
{{ csrf_field() }}
{{ csrf_field() }}
@endsection