@extends('layouts.app') @section('title', 'Veículos - Sistema de Gestão') @section('page-title', 'Veículos') @section('content')
Total de Veículos

{{ $stats['total_cars'] }}

Em Estoque

{{ $stats['cars_owned'] }}

Vendidos

{{ $stats['cars_sold'] }}

Investido

R$ {{ number_format($stats['total_invested'], 0, ',', '.') }}

Gerenciar Veículos

Controle seu estoque de veículos

Novo Veículo
Limpar
@if($cars->count() > 0)
@foreach($cars as $car)
@if($car->photos && count($car->photos) > 0) {{ $car->model }} @else
@endif
{{ $car->brand }} {{ $car->model }}
@switch($car->status) @case('owned') Em Estoque @break @case('sold') Vendido @break @case('maintenance') Manutenção @break @endswitch
@if($car->year) Ano: {{ $car->year }}
@endif @if($car->plate) Placa: {{ $car->plate }}
@endif @if($car->color) Cor: {{ $car->color }} @endif
@if($car->purchase_price)
Compra: R$ {{ number_format($car->purchase_price, 2, ',', '.') }}
@endif @if($car->sale_price)
Venda: R$ {{ number_format($car->sale_price, 2, ',', '.') }}
@endif
Despesas: R$ {{ number_format($car->expenses_sum_amount ?? 0, 2, ',', '.') }}
@if($car->status === 'sold' && $car->purchase_price && $car->sale_price) @php $profit = $car->sale_price - $car->purchase_price - ($car->expenses_sum_amount ?? 0); $class = $profit >= 0 ? 'text-success' : 'text-danger'; @endphp
{{ $profit >= 0 ? 'Lucro' : 'Prejuízo' }}: R$ {{ number_format(abs($profit), 2, ',', '.') }}
@endif
@endforeach
{{ $cars->links() }} @else
Nenhum veículo encontrado

Comece cadastrando seu primeiro veículo.

Cadastrar Veículo
@endif @endsection