@extends('layouts.layout')
@section('title', 'Crear Cotización')
@section('content')
{{-- FORMULARIO PRINCIPAL --}}
{{-- TABLA DE ITEMS --}}
@php
$columns = [
[
'id_field' => 'id',
'label'=>'Articulo',
'field'=> 'articulo',
'searchable' => true,
'width' => 'w-[28rem]',
'map' => [
'id' => 'id',
'nombre' => 'articulo',
'precio1' => 'precio1',
'idIva' => 'idIva',
'iva' => 'iva',
'idPres' => 'idPres',
],
'render_under' => [ // 👈 NUEVO
[
'label' => 'Presentación',
'field' => 'idPres',
'type' => 'select',
'options' => $presentaciones,
'disabled' => true, // <-- Esto lo bloquea
],
[
'label' => 'Impuesto',
'field' => 'iva',
'type' => 'select',
'options' => $tarifas,
'disabled' => true, // <-- Esto lo bloquea
],
]
],
[
'label'=>'Precio',
'field'=>'precio1',
'type' => 'number',
'format_prefix'=>'$',
'width' => 'w-38',
],
[
'label'=>'Cantidad',
'field'=>'cantidad',
'type' => 'number',
'width' => 'w-[8rem]',
],
[
'label'=>'Desc',
'field'=>'descuCom',
'type' => 'number',
'format_prefix'=>'%',
'width' => 'w-[8rem]',
],
[
'label'=>'Total',
'field'=>'subtotal_neto',
'formula'=> '(precio1 * cantidad)
- ((precio1 * cantidad) * (descuCom / 100))
+ (((precio1 * cantidad) - ((precio1 * cantidad) * (descuCom / 100))) * (iva / 100))',
'format_prefix'=>'$',
'width' => 'w-38',
],
];
@endphp
{{-- O con Alpine.js --}}
0">
{{-- BOTÓN ATRÁS --}}
@endsection