@extends('layouts.main.main') @section('content')
Télécharger
@php $total_bdc = 0; $total_factures = 0; $total_ndf = 0; $total_frais_comp = 0; $total_intermittents = 0; @endphp @if($project->orders->where('status',1)->count() > 0) @foreach($project->orders->where('status',1) as $order) @php $total_bdc += $order->ht_total()->ht_total; $total_factures += $order->invoice_ht_amount; @endphp @endforeach @else @endif @if($project->expensesReports->count() > 0) @else @endif @if($project->additionalExpensesTable->count() > 0) @foreach ($project->additionalExpensesTable as $additionalexpense) @php $total_frais_comp += $additionalexpense->amount; @endphp @endforeach @else @endif @if($project->intermittents->count() > 0 || $project->singleStewards->count() > 0) @if($project->intermittents->count() > 0) @foreach($project->intermittents as $intermittent) @php $total_intermittents += ($intermittent->pivot->quantity * $intermittent->pivot->daily_cost); @endphp @endforeach @endif @if($project->singleStewards->count() > 0) @foreach($project->singleStewards as $intermittent) @php $total_intermittents += ($intermittent->pivot->quantity * $intermittent->pivot->daily_cost); @endphp @endforeach @endif @else @endif
{{ $project->customer->name }} - {{ $project->projectref }} CA : {{ number_format($project->income, 2, '.',' ') }}      
BONS DE COMMANDE
Fournisseur BdC HT Facture HT Facture reçue Réf BdC
{{ $order->supplier->name }} {{ number_format($order->ht_total()->ht_total, 2,'.',' ') }} {{ ($order->invoice_ht_amount) ? number_format($order->invoice_ht_amount, 2,'.',' ') : '' }} {{ $order->project->projectref }}/{{ $order->number }}{{ ($order->version > 1) ? '-'.$order->version : '' }}
TOTAUX BONS DE COMMANDES {{ number_format($total_bdc, 2,'.',' ') }} {{ number_format($total_factures, 2,'.',' ') }}  
Aucun bon de commande validé sur ce projet
NOTES DE FRAIS
TODO: intégration des notes de frais
Aucune note de frais n'est associée à ce projet
FRAIS COMPLÉMENTAIRES
Fournisseur Montant HT  
{{ $additionalexpense->supplier->name }} {{ number_format($additionalexpense->amount,2,'.',' ') }}  
TOTAL FRAIS COMPLÉMENTAIRES {{ number_format($total_frais_comp, 2,'.',' ') }}  
Aucun frais complémentaire n'est associé à ce projet
TOTAL CHARGES {{ number_format(($total_bdc + $total_ndf + $total_frais_comp), 2,'.',' ') }} {{ number_format(($total_factures), 2,'.',' ') }}  
 
INTERMITTENTS
Intermittent Brut  
{{ $intermittent->full_name }} {{ number_format(($intermittent->pivot->quantity * $intermittent->pivot->daily_cost), 2,'.',' ') }}  
{{ $intermittent->full_name }} {{ number_format(($intermittent->pivot->quantity * $intermittent->pivot->daily_cost), 2,'.',' ') }}  
Aucun intermittent n'est associé à ce projet
TOTAL INTERMITTENTS {{ number_format($total_intermittents, 2,'.',' ') }}  
TOTAL ÉVÉNEMENT {{ number_format(($total_bdc + $total_ndf + $total_frais_comp + $total_intermittents), 2,'.',' ') }} {{ number_format($total_factures, 2,'.',' ') }}  
@endsection