@php
$company = $company ?? \App\Models\Company::first();
$establishment = $establishment ?? null;
$records = $records ?? collect();
$date = $date ?? now()->format('Y-m-d');
$total_day = $total_day ?? 0;
$currency_symbol = $currency_symbol ?? '$';
$paperHeight = $paper_height ?? 1200;
@endphp
Ticket Ventas del Dia
@include('print.partials.ticket_header', [
'company' => $company ?? null,
'establishment' => $establishment ?? null,
'title' => 'TX DEL DIA',
'code' => 'FECHA: ' . \Carbon\Carbon::parse($date)->format('d-m-Y'),
'header_font_size' => '14pt',
'title_font_size' => '14pt',
'code_font_size' => '14pt',
])
DETALLE DEL DIA
@forelse($records as $row)
@php
$patient = $row->patient->name ?? ($row->customer->name ?? '-');
$number = trim(($row->series ?? $row->prefix ?? '').'-'.($row->number ?? $row->id));
$itemText = collect($row->items ?? [])->map(function ($item) {
$qty = rtrim(rtrim(number_format((float)($item->quantity ?? 0), 2, '.', ''), '0'), '.');
$desc = trim(strip_tags($item->item->description ?? 'Sin descripcion'));
return "{$qty} x {$desc}";
})->implode(' | ');
if ($itemText === '') {
$itemText = 'Sin detalle';
}
@endphp
{{ $number }}
PACIENTE: {{ $patient }}
TRATAMIENTO: {{ $itemText }}
TOTAL: {{ $currency_symbol }} {{ number_format((float) $row->total, 2) }}
@empty
No hay ventas registradas para la fecha seleccionada.
@endforelse
TOTAL DEL DIA: {{ $currency_symbol }} {{ number_format((float) $total_day, 2) }}