<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <form @submit.prevent="buscarPrecioVenta($event)" id="form_proven_busqueda">
                    <div class="form-row">
                        <div class="col-sm-3">
                            <div class="form-group form-floating-label">
                                <input id="pvfecha_desde" type="date" class="form-control input-border-bottom" v-model="fecha_desde">
                                <label for="pvfecha_desde" class="placeholder">Fecha desde</label>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group input-group form-floating-label">
                                <input id="pvfecha_hasta" type="date" class="form-control input-border-bottom" v-model="fecha_hasta">
                                <label for="pvfecha_hasta" class="placeholder">Fecha hasta</label>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group input-group form-floating-label">
                                <select id="pvdivisasp" class="form-control input-border-bottom" v-model="divisa">
                                    <option value="0">Todas</option>
                                    <?php foreach ($divisas as $row) : ?>
                                        <option value="<?= $row['div_id'] ?>" <?= ($row['div_predeterminado'] == 1) ? 'selected' : '' ?>><?= $row['div_descripcion'] ?></option>
                                    <?php endforeach; ?>
                                </select>
                                <label for="pvdivisas" class="placeholder">Divisa</label>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group input-group form-floating-label">
                                <select id="pvdivisas" class="form-control input-border-bottom" v-model="filtro">
                                    <option value="1">> Mayor</option>
                                    <option value="2">
                                        < Menor</option>
                                </select>
                                <label for="pvdivisas" class="placeholder">Filtrar por precio venta</label>
                                <div class="input-group-append">
                                    <button class="btn btn-border" type="submit"> <span class="fa fa-search"></span> </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <div class=" alert alert-warning" role="alert" v-for="row in errorForm">
                                {{ row }}
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="col-12">
        <div class="card">
            <div class="card-body" :class="cargando_tabla">
                <div class="table-responsive">
                    <table class="display nowrap table table-striped table-hover dataTable table-head-bg-primary table-bordered-bd-primary" id="tab_precio_ven">
                        <thead>
                            <tr>
                                <th class="text-center">Documento</th>
                                <th style="width: 25%;" class="text-left">Producto</th>
                                <th class="text-center">Divisa</th>
                                <th class="text-center">Cantidad</th>
                                <th class="text-right">PCosto</th>
                                <th class="text-right">PVenta</th>
                                <th class="text-right">PFact/Nota</th>
                                <th class="text-right">PDescuento</th>
                                <th class="text-right">Descuento</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="row in productosPrecVenta">
                                <td class="text-center"><a :href="row.url" target="_blank">{{ row.tipo }}{{ row.id }}</a></td>
                                <td class="text-left">{{ row.pro_descripcion }}</td>
                                <td class="text-center">{{ row.div_nombre }}</td>
                                <td class="text-center">{{ row.cantidad }}</td>
                                <td class="text-right">{{ moneda(row.pro_costo, row.div_locale, row.div_simbolo) }}</td>
                                <td class="text-right">{{ moneda(row.precio_venta, row.div_locale, row.div_simbolo) }}</td>
                                <td class="text-right">{{ moneda(row.precio_factura, row.div_locale, row.div_simbolo) }}</td>
                                <td class="text-right">{{ moneda(row.precio_desc, row.div_locale, row.div_simbolo) }}</td>
                                <td class="text-right">{{ decimal(row.descuento, row.div_locale) }} %</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>