@php $bg = [ 'invoice' => '#06b6d4', // Bleu cyan pour la facture 'quote' => '#a8a29e', // Gris doux pour le devis 'credit' => '#fca5a5', // Rouge pastel pour l'avoir ]; @endphp
@if(!is_null($detail['document_logo'])) @php $imagePath = public_path('images/sites/logo/'. $detail['document_logo']); $imageData = base64_encode(file_get_contents($imagePath)); $imageSrc = 'data:image/png;base64,' . $imageData; // Ajustez le type MIME si nécessaire @endphp
@endif

{{ $document['label'] }}

{!! nl2br($detail['document_header']) !!}

CLIENT:

{!! $detail['customer'] !!}

{!! nl2br($detail['customer_address']) !!}

@if((float)$detail['rap'] != 0) @endif
Date: {{ date('d-m-Y', strtotime($detail['accounting_document_date'])) }}
Numéro {{strtolower($document['label'])}}: {{ $detail['reference'] }}
Echéance: {{ date('d-m-Y', strtotime($detail['accounting_document_release_date'])) }}
@foreach ($cols[$document['type']] as $k => $col) @endforeach @php $taxes = []; @endphp {{-- @dd($detail) --}} @foreach ($detail['details'] as $i => $item) @if($item["row_type"] == 'product') @php $totalht = (double)$item['price_ht'] * (double)$item['qty']; $taxrate = (float)$item['tva_rate']; $taxeprice = (float)$totalht * ((float)$taxrate / 100); $totalttc = $totalht + $taxeprice; $taxes[$item['tva_rate']]['rate'][] = $taxrate; $taxes[$item['tva_rate']]['ttc'][] = $totalttc; $taxes[$item['tva_rate']]['price'][] = $taxeprice; $taxes[$item['tva_rate']]['items'][] = $totalht; @endphp @endif @if($item['row_type'] == 'sous-total') @endif @if($item['row_type'] == 'title') @endif @if($item['row_type'] == 'texte') @endif @if($item['row_type'] == 'container') @endif @if($item['row_type'] == 'power') @endif @if($item['row_type'] == 'saut-page') @endif @endforeach
{{$col['title']}}
{!! implode(' - ', array_map(fn($cat) => "{$cat['title']}", $item['category'])) !!} - {{$item['product']}} {{number_format($item['price_ht'], 2, ",", " ")."Ar"}} {{$item['qty']}} {{number_format($totalht, 2, ",", " ")."Ar"}} {{$item['tva_rate']}}% {{number_format($totalttc, 2, ",", " ")."Ar"}} {{$item['product']}} {{number_format($item['price_ht'], 2, ",", " ")."Ar"}}

{!! $item['product'] !!}

{!! nl2br($item['product']) !!}
N° Conteneur: {!! $item['product'] !!} Puissance: {!! $item['product'] !!}

Arrêté la présente à la somme de {!! number_to_letter($detail['total_ttc']) !!} ariary

@if(isset($detail['document_for']) && $detail['document_for'] == 'site') @endif @if($document['type'] != 'quote' && (float)$detail['rap'] != 0) @endif
Montant total HT {{ number_format($detail['total_ht'], 2, ",", ' ') }}Ar
Frais livraison {{ number_format($detail['delivery_price'], 2, ",", ' ') }}Ar
Remise {{ number_format($detail['discount_price'], 2, ",", ' ') }}Ar
TVA * {{ number_format($detail['tva_price'], 2, ",", ' ') }}Ar
Montant total TTC {{ number_format($detail['total_ttc'], 2, ",", ' ') }}Ar
Acompte {{ number_format($detail['payment_total'], 2, ",", ' ') }}Ar
Reste à payer {{ number_format(((float)$detail['rap'] * -1), 2, ",", ' ') }}Ar
@if(count($detail['payments']) > 0)

Paiements éffectués

@foreach ($detail['payments'] as $item) @endforeach
Date Type de règlement Montant
{{ date('d-m-Y', strtotime($item['created_at'])) }} {{ $item['payment_method'] }} {{ number_format($item['amount'], 2, ",", " ") }} Ar
@endif

* Détail taxe

@foreach($taxes as $k => $item) @endforeach
Taux Base HT Montant TVA
{{ number_format($taxes[$k]['rate'][0], 2, ",", " ") }}% {{ number_format(array_sum($taxes[$k]['items']), 2, ",", " ") }}Ar {{ number_format(array_sum($taxes[$k]['price']), 2, ",", " ") }}Ar

Responsable

Client