Establecer precios y costos

Cambiar familia Cambiar marca Restaurar todos Guardar cambios
{{-- Filtros --}}
Guardar cambios
Mostrando: {{ $productos->count() }} elementos
@php $headerValues = [ '', 'Descripción', 'Clave', 'Código barras', 'Stock mínimo', 'Costo compra', 'Precio venta', 'Existencia', 'Ventas', 'Familia', 'Marca', 'Activo', '', ]; @endphp @php // Mapas id->nombre para reflejar cambios en tiempo real desde edits.* $familiaMap = collect($familias ?? [])->mapWithKeys(function ($f) { $id = is_array($f) ? ($f['id'] ?? null) : ($f->id ?? null); if ($id === null) return []; $nombre = is_array($f) ? ($f['nombre'] ?? ($f['descripcion'] ?? ($f['NOMBRE'] ?? ('Familia ' . $id)))) : ($f->nombre ?? ($f->descripcion ?? ($f->NOMBRE ?? ('Familia ' . $id)))); return [$id => $nombre]; })->all(); $marcaMap = collect($marcas ?? [])->mapWithKeys(function ($m) { $id = is_array($m) ? ($m['id'] ?? null) : ($m->id ?? null); if ($id === null) return []; $nombre = is_array($m) ? ($m['nombre'] ?? ($m['descripcion'] ?? ($m['NOMBRE'] ?? ('Marca ' . $id)))) : ($m->nombre ?? ($m->descripcion ?? ($m->NOMBRE ?? ('Marca ' . $id)))); return [$id => $nombre]; })->all(); @endphp
@slot('headerAction') @endslot @slot('body') @forelse($productos ?? [] as $p) @php $pid = $p->id; @endphp {{ $p->descripcion ?? ($p->DESCRIPCION ?? '—') }} {{ number_format($p->existencia ?? 0, 3) }} {{ number_format($p->ventas ?? 0, 3) }} {{ $familiaMap[$edits[$pid]['familia_aplicada'] ?? ($p->idfamilia ?? null)] ?? ($p->familia_nombre ?? ($p->familia ?? '—')) }} {{ $marcaMap[$edits[$pid]['marca_aplicada'] ?? ($p->idmarca ?? null)] ?? ($p->marca_nombre ?? ($p->marca ?? 'SINMARCA')) }} activo) /> @if ($edits[$pid]['_dirty'] ?? false) @endif @empty Sin resultados @endforelse @endslot {{-- Panels de totales (venta / compra) --}}

Importes totales a precio venta (público)

Stock mínimo Existencia Ventas
Importe total: {{ number_format($totals['venta']['stockmin_total'] ?? 0, 2) }} {{ number_format($totals['venta']['existencia_total'] ?? 0, 2) }} {{ number_format($totals['venta']['ventas_total'] ?? 0, 2) }}
Stock mínimo - Existencia: {{ number_format(($totals['venta']['stockmin_total'] ?? 0) - ($totals['venta']['existencia_total'] ?? 0), 2) }}
Utilidad:
{{ number_format(($totals['venta']['existencia_total'] ?? 0) + ($totals['venta']['ventas_total'] ?? 0) - (($totals['compra']['existencia_total'] ?? 0) + ($totals['compra']['ventas_total'] ?? 0)), 2) }}
Pérdida ((Existencia + Venta) - Stock mínimo ):
{{ number_format($totals['perdida_compra'] ?? 0, 2) }}

Importes totales a precio compra

Stock mínimo Existencia Ventas
Importe total: {{ number_format($totals['compra']['stockmin_total'] ?? 0, 2) }} {{ number_format($totals['compra']['existencia_total'] ?? 0, 2) }} {{ number_format($totals['compra']['ventas_total'] ?? 0, 2) }}
Stock mínimo - Existencia: {{ number_format(($totals['compra']['stockmin_total'] ?? 0) - ($totals['compra']['existencia_total'] ?? 0), 2) }}
{{ $productos->links() }} @if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif {{-- Modal cambiar familia --}} @if ($mostrarModalFamilia)

Cambiar familia a seleccionados

Cancelar Aplicar
@endif {{-- Modal cambiar marca --}} @if ($mostrarModalMarca)

Cambiar marca a seleccionados

Cancelar Aplicar
@endif