@extends('template.template') @section('content') @php use App\Models\Venda; use App\Models\User; use Carbon\Carbon; $usuarioCadastrado = auth()->user(); if($usuarioCadastrado->is_admin){ $vendas = Venda::orderBy('date', 'desc')->where('installment', 1)->get(); }else{ $vendas = Venda::orderBy('date', 'desc')->where('user_id', $usuarioCadastrado->id)->where('installment', 1)->get(); } @endphp
Pagamentos parcelados
@foreach ($vendas as $venda) @endforeach
# Vendedor Nota fiscal Cliente Valor total Data da venda Forma de pagamento Condição Parcelas pagas
{{$venda->id}} {{User::find($venda->user_id)->name}} {{$venda->invoice}} {{$venda->client_name}} {{ 'R$ ' . number_format($venda->product_value + $venda->frame_value, 2, ',', '.') }} {{ Carbon::parse($venda->date)->format('d/m/Y') }} {{$venda->payment_method}} {{$venda->condition}} @if (auth()->user()->is_admin)
@else {{$venda->installments_paid ?? 'Nenhuma paga'}} @endif
@if ($venda->settled) Quitado | (desfazer) @else Quitar @endif
@endsection