{{-- Facturas y gastos de una orden (importación: po.facturacion; exportación: ex-po.ex-po-facturacion). Botón por fila y su diálogo de Alpine (antes, modal Bootstrap); su estado sobrevive a las actualizaciones de Livewire. Los datos se cargan al abrir (specs/Rendimiento.MD, R2). $conBl: exportación del grupo 28, con número y fecha de BL y "Related Parties". --}} @php $conBl = $conBl ?? false; $numero = fn ($v) => '$' . number_format((float) $v, 2); $total_facturacion = $total_fob = $total_seguro = $total_fletes = $total_otros_gastos = $total_gastos = 0; foreach ($facturas as $f) { $total_facturacion += $f->valor_factura; $total_fob += $f->valor_fob; $total_seguro += $f->valor_seguro; $total_fletes += $f->valor_fletes; $total_otros_gastos += $f->otros_gastos; } foreach ($gastos as $g) { $total_gastos += $g->valor_gasto; } @endphp
Orden de compra
Incoterms
{{ $des_incoterms ?: '—' }}
Cargando facturas y gastos…
@else @if ($errors->any())Se presentaron los siguientes errores:
Sin facturas registradas para esta orden de compra.
@else| Factura | Valor | Fecha | @if ($conBl)Número de BL | Fecha de BL | Related parties | @endifFOB | Seguro | Fletes | Otros gastos | Acciones |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $factura->nro_factura }} | {{ $numero($factura->valor_factura) }} | {{ $factura->fecha_factura }} | @if ($conBl){{ $factura->numero_bl }} | {{ $factura->fecha_bl }} | @if (!is_null($factura->triangulacion)) {{ $factura->triangulacion == 0 ? 'Compañía relacionada con ' . session('dominio') : 'Compañía de terceros' }} @endif | @endif{{ $numero($factura->valor_fob) }} | {{ $numero($factura->valor_seguro) }} | {{ $numero($factura->valor_fletes) }} | {{ $numero($factura->otros_gastos) }} |
|
| Totales | {{ $numero($total_facturacion) }} | {{ $numero($total_fob) }} | {{ $numero($total_seguro) }} | {{ $numero($total_fletes) }} | {{ $numero($total_otros_gastos) }} | |||||
Sin gastos registrados para esta orden de compra.
@else| Concepto | Valor | Fecha | Acciones |
|---|---|---|---|
| {{ $gasto->concepto->concepto }} | {{ $numero($gasto->valor_gasto) }} | {{ $gasto->fecha_gasto }} |
|
| Total | {{ $numero($total_gastos) }} | ||