@php $mapTaxpayer = [ 1 => 'Ordinario', 2 => 'Formal', 3 => 'Ocasional', 4 => 'Pasivo Especial', ]; $mapConcept = [ 1 => 'Productos', 2 => 'Servicios', ]; $mapType = [ 1 => 'IVA', 2 => 'ISLR', ]; @endphp REGISTRO DE RETENCIONES Fecha de Empresa RIF Tipo N° de N° de Concepto de Tipo de Total Factura/Nota Monto Monto Objeto de Porcentaje de Impuesto Sustraendo (Bs) Impuesto
retenido (Bs)
Total
pagado (Bs)
factura contribuyente factura control retención retención débito o Crédito (Bs) Exento (Bs) retención (Bs) retención (%) causado (Bs) @foreach($retentions as $item) @php $billDate = $item->bill_date ? \Carbon\Carbon::parse($item->bill_date)->format('d-m-Y') : '-'; $empresa = $item->client ? $item->client->name : '-'; $rif = $item->client ? $item->client->document : '-'; $tipoContrib = isset($mapTaxpayer[$item->taxpayer_type]) ? $mapTaxpayer[$item->taxpayer_type] : '-'; $nroFactura = $item->bill_number ?: '-'; $nroControl = $item->number_format ?: '-'; $concepto = isset($mapConcept[$item->concept]) ? $mapConcept[$item->concept] : '-'; $tipo = isset($mapType[$item->type]) ? $mapType[$item->type] : '-'; $rate = floatval($item->conversion ?: 1); $totalFactura = number_format(floatval($item->invoice_total ?: 0) * $rate, 2, ',', '.'); $montoExento = number_format(floatval($item->exempt_amount ?: 0) * $rate, 2, ',', '.'); $base = number_format(floatval($item->taxable_base ?: 0) * $rate, 2, ',', '.'); if ($item->type == 1) { $porcentaje = number_format(floatval($item->iva_withheld_rate ?: 0) * 100, 2, ',', '.'); } else { $porcentaje = number_format(floatval($item->islr_rate ?: 0), 2, ',', '.'); } $impuestoCaus = $item->type == 2 ? number_format(floatval($item->islr_amount ?: 0) * $rate, 2, ',', '.') : number_format(floatval($item->iva_amount ?: 0) * $rate, 2, ',', '.'); $sustraendo = $item->sustraendo ? number_format(floatval($item->sustraendo) * $rate, 2, ',', '.') : ''; if ($item->type == 1) { $impuestoRet = number_format(floatval($item->iva_withheld_amount ?: 0) * $rate, 2, ',', '.'); } else { $impuestoRet = number_format(floatval($item->islr_amount ?: 0) * $rate, 2, ',', '.'); } $showTotal = false; if ($item->concept == 1 && $item->type == 1) $showTotal = true; if (($item->concept == 2 || $item->concept == 3) && $item->type == 2) $showTotal = true; $totalPagado = $showTotal ? number_format(floatval($item->payable_total ?: 0) * $rate, 2, ',', '.') : ''; @endphp {{ $billDate }} {{ $empresa }} {{ $rif }} {{ $tipoContrib }} {{ $nroFactura }} {{ $nroControl }} {{ $concepto }} {{ $tipo }} {{ $totalFactura }} {{ $montoExento }} {{ $base }} {{ $porcentaje }} {{ $impuestoCaus }} {{ $sustraendo }} {{ $impuestoRet }} {{ $totalPagado }} @endforeach