@php $final_balance = 0; $cash_income = 0; $cash_egress = 0; $cash_final_balance = 0; @endphp Reporte POS

Reporte general de ventas POS

Empresa: {{$company->name}}

Fecha reporte: {{date('Y-m-d')}}

Ruc: {{$company->number}}

@if($cash_documents->count())
@php $all_documents = []; foreach ($cash_documents as $key => $value) { if($value->sale_note){ $all_documents[] = $value; }else if($value->document){ $all_documents[] = $value; }else if($value->expense_payment){ if($value->expense_payment->expense->state_type_id == '05'){ $all_documents[] = $value; } }else if($value->purchase){ $all_documents[] = $value; } } @endphp @foreach($all_documents as $key => $value) @php $type_transaction = null; $document_type_description = null; $number = null; $date_of_issue = null; $customer_name = null; $customer_number = null; $currency_type_id = null; $total = null; if($value->sale_note){ $type_transaction = 'Venta'; $document_type_description = 'NOTA DE VENTA'; $number = $value->sale_note->identifier; $date_of_issue = $value->sale_note->date_of_issue->format('Y-m-d'); $customer_name = $value->sale_note->customer->name; $customer_number = $value->sale_note->customer->number; $total = $value->sale_note->total; if(!in_array($value->sale_note->state_type_id, ['01','03','05','07','13'])){ $total = 0; } $currency_type_id = $value->sale_note->currency_type_id; } else if($value->document){ $type_transaction = 'Venta'; $document_type_description = $value->document->document_type->description; $number = $value->document->number_full; $date_of_issue = $value->document->date_of_issue->format('Y-m-d'); $customer_name = $value->document->customer->name; $customer_number = $value->document->customer->number; $total = $value->document->total; if(!in_array($value->document->state_type_id, ['01','03','05','07','13'])){ $total = 0; } $currency_type_id = $value->document->currency_type_id; } else if($value->expense_payment){ $type_transaction = 'Gasto'; $document_type_description = $value->expense_payment->expense->expense_type->description; $number = $value->expense_payment->expense->number; $date_of_issue = $value->expense_payment->expense->date_of_issue->format('Y-m-d'); $customer_name = $value->expense_payment->expense->supplier->name; $customer_number = $value->expense_payment->expense->supplier->number; $total = -$value->expense_payment->payment; $currency_type_id = $value->expense_payment->expense->currency_type_id; } else if($value->purchase){ $type_transaction = 'Compra'; $document_type_description = $value->purchase->document_type->description; $number = $value->purchase->number_full; $date_of_issue = $value->purchase->date_of_issue->format('Y-m-d'); $customer_name = $value->purchase->supplier->name; $customer_number = $value->purchase->supplier->number; $total = -$value->purchase->total; $currency_type_id = $value->purchase->currency_type_id; if(!in_array($value->purchase->state_type_id, ['01','03','05','07','13'])){ $total = 0; } } @endphp @endforeach
# Tipo transacción Tipo documento Documento Fecha emisión Cliente/Proveedor N° Documento Moneda Total
{{ $loop->iteration }} {{ $type_transaction }} {{ $document_type_description }} {{ $number }} {{ $date_of_issue}} {{ $customer_name }} {{$customer_number }} {{ $currency_type_id }} {{ number_format($total,2, ".", "") }}
@else

No se encontraron registros.

@endif