@extends('layouts.main.main') @section('content')

Merci de patienter pendant la génération du bon de commande...

Chargement...
Prévisualiser Imprimer @if($order->status == 0) @if($order->signed_by) @else @endif @endif @if($order->status > 0 && $order->orderlines->count() > 0) PDF @endif @if($order->status < 2) @if($order->orderlines->count() > 0) @endif @elseif($order->status == 2 && !$order->replacedby()->count() > 0 && $order->orderlines->count() > 0) @endif
@if($order->replaces_id) @endif @if($order->status == 2 && $order->replacedby()->count() > 0) @elseif($order->status == 2) @endif
@if($order->status > 0 && $order->orderlines->count() > 0)
Bon de commande

BDC {{ $order->project->projectref }}/{{ $order->number }}{{ ($order->version > 1) ? '-'.$order->version : '' }} du {{ date('d/m/Y', strtotime($order->created_at)) }}

Fournisseur

{{ $order->supplier->name }} 

@can('facture fournisseur') HT facture : @if(!$order->invoice_ht_amount) ? @else {{ number_format($order->invoice_ht_amount, 2,'.',' ') }} €  @endif ({{ ($order->invoice_received) ? 'Facture reçue' : 'Facture non-reçue' }}) @endcan

Projet

{{ $order->project->projectref }} 

Client : {{ $order->project->customer->name }}
@else
Bon de commande

BDC {{ $order->project->projectref }}/{{ $order->number }}{{ ($order->version > 1) ? '-'.$order->version : '' }} du {{ date('d/m/Y', strtotime($order->created_at)) }}

Livraison : le {{ \Carbon\Carbon::parse($order->delivery_date)->format('d/m/Y à H:i') }}
Reprise : le {{ date('d/m/Y à H:i', strtotime($order->recovery_date)) }}
Adresse de livraison :
{{ $order->project->place->name }}
@if($order->project->place->delivery_address) {!! nl2br($order->project->place->delivery_address) !!}
@endif @if($order->project->place->delivery_zip_code || $order->project->place->delivery_city) {{ trim($order->project->place->delivery_zip_code.' '.$order->project->place->delivery_city) }}
@endif @if($order->project->place->delivery_country_id) {{ $order->project->place->deliveryCountry->name_fr }} @endif

Signature du bon de commande
@if($order->signed_by) @if($order->signed_by == auth()->user()->id) Vous avez déjà signé ce bon. @else Ce bon a été signé par {{ $order->signatory->full_name }}. @endif @else @can('signer un bon de commande') @if(auth()->user()->signature) @else Pour pouvoir signer ce bon de commande, vous devez ajouter un scan de votre signature dans votre profil. @endif @else Les bons de commandes peuvent être signés uniquement par des personnes habilitées. @endcan @endif

Fournisseur

{{ $order->supplier->name }} 

@if($order->supplier->address) {!! nl2br($order->supplier->address) !!}
@endif @if($order->supplier->zip_code || $order->supplier->city) {{ trim($order->supplier->zip_code.' '.$order->supplier->city) }}
@endif @if($order->supplier->country_id) {{ $order->supplier->country->name_fr }} @endif @if($order->supplier->phone)
Tél : {{ $order->supplier->phone }} @endif
Conditions de règlement :
{{ $order->payment_terms }} {!! ($order->payment_terms != $order->supplier->payment_terms) ? '' : '' !!}

@if($order->estimate_reference) Devis : {{ $order->estimate_reference }}
@else Référence du devis non précisée.
@endif @can('facture fournisseur') HT facture : @if(!$order->invoice_ht_amount) ? @else {{ number_format($order->invoice_ht_amount, 2,'.',' ') }} €  @endif ({{ ($order->invoice_received) ? 'Facture reçue' : 'Facture non-reçue' }}) @endcan

Projet

{{ $order->project->projectref }} 

Client : {{ $order->project->customer->name }}

Prod
@if($order->project->teamProd->count() > 0) @foreach($order->project->teamProd as $prod) {{ $prod->manageable->full_name }}{{ ($prod->manageable->phone) ? ' - ' . $prod->manageable->phone : '' }}
@endforeach @else Personne n'est affecté à la prod de ce projet.
@endif @php $stewards = $order->stewards(); $regisseurs = []; foreach ($stewards['stewards']['delivery'] as $key => $value) { $regisseurs[$key] = $value; } foreach ($stewards['stewards']['recovery'] as $key => $value) { $regisseurs[$key] = $value; } @endphp @if($stewards['partial']) Régisseur{{ (count($stewards['stewards']['delivery']) > 1) ? 's' : '' }} livraison
@if(count($stewards['stewards']['delivery']) > 0) @foreach ($stewards['stewards']['delivery'] as $delivery_steward) {{ $delivery_steward['intermittent']->full_name }}{{ ($delivery_steward['intermittent']->phone) ? ' - ' . $delivery_steward['intermittent']->phone : '' }}
@endforeach @else Aucun régisseur n'est présent au moment de la livraison.
@endif Régisseur{{ (count($stewards['stewards']['recovery']) > 1) ? 's' : '' }} reprise
@if(count($stewards['stewards']['recovery']) > 0) @foreach ($stewards['stewards']['recovery'] as $recovery_steward) {{ $recovery_steward['intermittent']->full_name }}{{ ($recovery_steward['intermittent']->phone) ? ' - ' . $recovery_steward['intermittent']->phone : '' }}
@endforeach @else Aucun régisseur n'est présent au moment de la reprise.
@endif @else Régisseur{{ (count($regisseurs) > 1) ? 's' : '' }}
@if(count($stewards['stewards']['delivery']) > 0) @foreach ($stewards['stewards']['delivery'] as $delivery_steward) {{ $delivery_steward['intermittent']->full_name }}{{ ($delivery_steward['intermittent']->phone) ? ' - ' . $delivery_steward['intermittent']->phone : '' }}
@endforeach @else Aucun régisseur n'est présent au moment de la livraison et de la reprise.
@endif @endif

@if($order->orderlines->count() > 0) @foreach ($order->orderlines as $order_line) @include('orders.order-line', $order_line) @endforeach @endif
Descriptif Quantité PU HT Remise HT €/% Montant remise Total remisé HT TVA  
@if($order->status == 0) @endif Sous-total HT 0.00 @if($order->status == 0) @endif
  Remise totale HT 0.00  
  Montant total HT 0.00  
  TVA 0.00 Acompte total ({{ ($order->supplier->advance_percentage) ? $order->supplier->advance_percentage : '0.00'}} %) 0.00
  Total TTC 0.00 Solde TTC 0.00

Notes @if($order->status == 0) @endif
{!! nl2br($order->notes) !!}
@endif @endsection