CLIENTE O ADQUIRIENTE: {{trim($data->Cliente['NombreComercial'])}}
IDENTIFICACION
{{trim($data->Cliente['Documento'])}}
TIPO DOCUMENTO
{{trim($data->Cliente['NombreTipoDocumento'])}}
CIUDAD
{{trim($data->Cliente['Ciudad']['Nombre'])}}, {{trim($data->Cliente['Departamento']['Nombre'])}}
TELEFONO
{{trim($data->Cliente['Telefono'])}}
DIRECCION
{{trim($data->Cliente['Direccion'])}}
EMAIL
{{trim($data->Cliente['Correo'])}}
@php $tipo = "FACTURA ELECTRONICA DE VENTA"; if($TypeDocument == "91") $tipo = "NOTA CREDITO ELECTRONICA"; if($TypeDocument == "92") $tipo = "NOTA DEBITO ELECTRONICA"; @endphp
{{$tipo}}
{{trim($data->Factura)}}
FECHA
{{$data->Fecha}}
VENCIMIENTO
{{$data->FechaVencimiento}}
FORMA DE PAGO
{{$data->FormaDePago == "1" ? "Contado" : "Credito"}}
@isset($data->Referencia["Descripcion_Reclamo"])
CONCEPTO DE NOTA: {{$data->Referencia["Descripcion_Reclamo"]}}
@endisset
OBSERVACION: {{$data->Observacion}}

@foreach ($data->Articulos as $key => $item) @php $item = (object) $item; //? Recargos y Descuentos $all_recargos_descuentos = isset($item->DescuentoYRecargos) ? collect($item->DescuentoYRecargos) : collect([]); //? Recargos $recargos = $all_recargos_descuentos->where("Recargo","false")->first(); $recargos_porcentaje = isset($recargos['Porcentaje']) ? $recargos['Porcentaje'] : 0; $recargos_valor = isset($recargos['Total']) ? $recargos['Total'] : 0; //? Descuentos $descuento = $all_recargos_descuentos->where("Recargo","true")->first(); $descuento_porcentaje = isset($descuento['Porcentaje']) ? $descuento['Porcentaje'] : 0; $descuento_valor = isset($descuento['Total']) ? $descuento['Total'] : 0; //? Impuestos $impuestos = isset($item->Impuestos) ? collect($item->Impuestos)->first() : collect([]); $all_impuestos = isset($impuestos['porcentajes']) ? collect($impuestos['porcentajes'])->first() : collect([]); $impuestos_porcentaje = isset($all_impuestos['porcentaje']) ? $all_impuestos['porcentaje'] : 0; $impuestos_valor = isset($all_impuestos['Total']) ? $all_impuestos['Total'] : 0; //? unitarios $iva_unitario = doubleval($impuestos_valor) / doubleval($item->Cantidad); $descuento_unitario = doubleval($descuento_valor) / doubleval($item->Cantidad); $recargo_unitario = doubleval($recargos_valor) / doubleval($item->Cantidad); @endphp @endforeach
# ARTICULO / SERVICIO CANT VR. UNIT RECARGO DESCUENTO IMPUESTO VR TOTAL
% VR. UNIT % VR. UNIT % VR. UNIT
{{$key+1}} {{$item->Nombre}} {{number_format($item->Cantidad, 0, '.', ',')}} {{number_format($item->PrecioUnitario, 2, '.', ',')}} {{$recargos_porcentaje}} {{number_format($recargo_unitario, 2, '.', ',')}} {{$descuento_porcentaje}} {{number_format($descuento_unitario, 2, '.', ',')}} {{$impuestos_porcentaje}} {{number_format($iva_unitario, 2, '.', ',')}} {{number_format($item->Total+$recargos_valor-$descuento_valor+$impuestos_valor, 2, '.', ',')}}
SUBTOTAL {{number_format($data->Totales['Bruto'], 2, '.', ',')}}
IMPUESTOS {{number_format($data->Totales['Impuestos'], 2, '.', ',')}}
RECARGOS {{number_format($data->Totales['Cargos'], 2, '.', ',')}}
DESCUENTOS {{number_format($data->Totales['Descuentos'], 2, '.', ',')}}
TOTAL A PAGAR {{number_format($data->Totales['APagar'], 2, '.', ',')}}