@extends('layouts.admin') @section('title', $pageTitle) @section('page-title') Comptabilité @endsection @section('page-subtitle') Gestion financière et suivi comptable @endsection @section('styles') @endsection @section('content')
| ID | Client | Adresse | Type | Description | Coûts Total | Coûts Klam | Coûts Sentier | Marge | Montant HT | TVA | Montant TTC | Payeur | Facture | Actions | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Aucune adresse travaillée pour cette période. |
|||||||||||||||
| {{ $address['id'] ?? '-' }} | @include('admin.accounting.partials.client-display', [ 'addressId' => $address['address_id'], 'currentClientId' => $address['client_id'], 'currentClientName' => $address['client_name'] ?? null, 'clients' => $clients ]) |
{{ $address['address_name'] }}
|
@php $workType = $address['work_type'] ?? 'travaux'; $workTypeDisplay = $address['work_type_display'] ?? 'Travaux'; // Mapping des icônes et classes de badges.css $typeConfig = [ 'travaux' => ['icon' => 'fa-hammer', 'class' => 'service-badge travaux'], 'interventions' => ['icon' => 'fa-tools', 'class' => 'service-badge interventions'], 'cleaning' => ['icon' => 'fa-broom', 'class' => 'service-badge cleaning'], 'dishwashing' => ['icon' => 'fa-utensils', 'class' => 'service-badge dishwashing'], 'bin' => ['icon' => 'fa-trash', 'class' => 'service-badge bin'], 'ironing' => ['icon' => 'fa-tshirt', 'class' => 'service-badge ironing'], 'other' => ['icon' => 'fa-question', 'class' => 'service-badge other'] ]; $config = $typeConfig[$workType] ?? $typeConfig['other']; @endphp {{ $workTypeDisplay }} | @if(isset($address['is_manual_entry']) && $address['is_manual_entry']) {{ $address['work_description'] ?: 'Aucune description' }} @else @endif | {{ number_format($address['total_costs'], 2, ',', ' ') }}€ | @if(in_array($address['service_type'] ?? 'other', ['travaux', 'interventions'])) {{ number_format($address['costs_klam'] ?? 0, 2, ',', ' ') }}€ @else - @endif | @if(in_array($address['service_type'] ?? 'other', ['travaux', 'interventions'])) {{ number_format($address['costs_sentier'] ?? $address['total_costs'], 2, ',', ' ') }}€ @else - @endif |
%
@php
// Calcul de la marge en euros : Montant HT - Coûts Sentier
// Pour travaux/interventions, utiliser costs_sentier, sinon total_costs
$serviceType = $address['service_type'] ?? 'other';
$baseCosts = ($serviceType === 'travaux' || $serviceType === 'interventions')
? ($address['costs_sentier'] ?? $address['total_costs'])
: $address['total_costs'];
$marginAmount = $address['amount_ht'] - $baseCosts;
// Si le montant HT n'est pas encore calculé, la marge est 0
if ($address['amount_ht'] == 0 && $baseCosts > 0) {
$marginAmount = 0;
}
@endphp
{{ number_format($marginAmount, 2, ',', ' ') }}€
|
{{ number_format($address['amount_ht'], 2, ',', ' ') }}€ |
%
{{ number_format($address['vat_amount'], 2, ',', ' ') }}€
|
{{ number_format($address['amount_ttc'], 2, ',', ' ') }}€ | @include('admin.accounting.partials.payer-selector', [ 'addressId' => $address['address_id'], 'currentPayerId' => $address['payer_client_id'], 'clients' => $clients ]) | @if(isset($address['is_manual_entry']) && $address['is_manual_entry']) @else @endif | ||
Êtes-vous sûr de vouloir supprimer cette entrée comptable ?