nota-pedido.html 14.5 KB
<div class="crear-nota-pedido">
    <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0">
        <div class="row">
            <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2">
                <div class="row p-1 panel-informativo">
                    <div class="col-12">
                        <div class="row">
                            <div class="col-12 col-sm-4 nota-pedido">
                                <h5>NOTA DE PEDIDO</h5>
                            </div>
                            <div class="col-6 col-sm-4 numero-pedido">Nº {{puntoVenta}}-{{comprobante}}</div>
                            <div class="col-6 col-sm-4 text-right crear-nota-pedido-fecha">
                                Fecha:
                                <span
                                    ng-show="!datepickerAbierto"
                                    ng-bind="now | date:'dd/MM/yyyy HH:mm'"
                                    ng-click="datepickerAbierto = true"
                                >
                                </span>
                                <input
                                    ng-show="datepickerAbierto"
                                    type="date"
                                    ng-model="now"
                                    ng-change="datepickerAbierto = false"
                                    ng-blur="datepickerAbierto = false"
                                    class="form-control form-control-sm col-8 float-right"
                                    foca-focus="datepickerAbierto"
                                    hasta-hoy
                                />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera">
                                <span class="label" ng-bind="cab.label"></span>
                                <span class="valor" ng-bind="cab.valor"></span>
                            </div>
                            <a 
                                class="btn col-12 btn-secondary d-sm-none" 
                                ng-show="cabecera.length > 0"
                                ng-click="showCabecera = !showCabecera"
                            >
                                <i
                                    class="fa fa-chevron-down"
                                    ng-hide="showCabecera"
                                    aria-hidden="true"
                                >
                                </i>
                                <i
                                    class="fa fa-chevron-up"
                                    ng-show="showCabecera"
                                    aria-hidden="true">
                                </i>
                            </a>
                        </div>
                    </div>
                </div>
                <div class="row p-1 botonera-secundaria">
                    <div class="col-12">
                        <div class="row">
                            <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera">
                                <button
                                    type="button"
                                    class="btn btn-default btn-block btn-xs text-left py-2"
                                    ng-click="boton.accion()"
                                    ng-class="{'d-none d-sm-block': boton.texto == ''}"
                                >
                                    <i
                                        class="fa fa-arrow-circle-right"
                                        ng-show="boton.texto != ''"
                                    ></i>
                                    &nbsp;
                                    {{boton.texto}}
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="row">
        <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2">
            <!-- PC -->
            <div class="row grilla-articulo align-items-end">
                <table class="table tabla-articulo table-striped table-sm table-dark mb-0">
                    <thead>
                        <tr class="d-flex">
                            <th class="">#</th>
                            <th class="col">Código</th>
                            <th class="col-4">Descripción</th>
                            <th class="col text-right">Cantidad</th>
                            <th class="col text-right">Precio Unitario</th>
                            <th class="col text-right">SubTotal</th>
                            <th class="text-right">
                                <button
                                    class="btn btn-outline-secondary selectable"
                                    ng-click="show = !show; masMenos()"
                                >
                                    <i
                                        class="fa fa-chevron-down"
                                        ng-show="show"
                                        aria-hidden="true"
                                    >
                                    </i>
                                    <i
                                        class="fa fa-chevron-up"
                                        ng-hide="show"
                                        aria-hidden="true">
                                    </i>
                                </button>
                            </th>
                        </tr>
                    </thead>
                    <tbody class="tabla-articulo-body">
                        <tr
                            ng-repeat="(key, articulo) in articulosTabla"
                            ng-show="show || key == (articulosTabla.length - 1)"
                            class="d-flex"
                        >
                            <td ng-bind="key + 1"></td>
                            <td 
                                class="col" 
                                ng-bind="articulo.sector + '-' + articulo.codigo"
                            ></td>
                            <td 
                                class="col-4" 
                                ng-bind="articulo.descripcion"
                            ></td>
                            <td class="col text-right">
                                <input
                                    ng-show="articulo.editCantidad"
                                    ng-model="articulo.cantidad"
                                    class="form-control"
                                    type="number"
                                    min="1"
                                    foca-focus="articulo.editCantidad"
                                    ng-keypress="editarArticulo($event.keyCode, articulo)"
                                    ng-focus="selectFocus($event)"
                                >
                                <i
                                    class="selectable"
                                    ng-click="cambioEdit(articulo, 'cantidad')"
                                    ng-hide="articulo.editCantidad"
                                    ng-bind="articulo.cantidad">
                                </i>
                            </td>
                            <td class="col text-right">
                                <input
                                    ng-show="articulo.editPrecio"
                                    ng-model="articulo.precio"
                                    class="form-control"
                                    type="number"
                                    min="1"
                                    step="0.01"
                                    foca-focus="articulo.editPrecio"
                                    ng-keypress="editarArticulo($event.keyCode, articulo)"
                                    ng-focus="selectFocus($event)"
                                >
                                <i
                                    class="selectable"
                                    ng-click="cambioEdit(articulo, 'precio')"
                                    ng-hide="articulo.editPrecio"
                                    ng-bind="articulo.precio">
                                </i>
                            </td>
                            <td
                                class="col text-right"
                                ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'">
                            </td>
                            <td class="text-center">
                                <button
                                    class="btn btn-outline-secondary"
                                    ng-click="quitarArticulo(key)"
                                >
                                    <i class="fa fa-trash"></i>
                                </button>
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr ng-show="!cargando" class="d-flex">
                            <td 
                                class="align-middle" 
                                ng-bind="articulosTabla.length + 1"
                            ></td>
                            <td class="col">
                                <input
                                    class="form-control"
                                    ng-model="articuloACargar.sectorCodigo"
                                    readonly
                                >
                            </td>
                            <td class="col-4 tabla-articulo-descripcion">
                                <input
                                    class="form-control"
                                    ng-model="articuloACargar.descripcion"
                                    readonly
                                >
                            </td>
                            <td class="col text-right">
                                <input
                                    class="form-control"
                                    type="number"
                                    min="1"
                                    ng-model="articuloACargar.cantidad"
                                    foca-focus="!cargando"
                                    esc-key="resetFilter()"
                                    ng-keypress="agregarATabla($event.keyCode)"
                                >
                            </td>
                            <td class="col text-right">
                                <input
                                    class="form-control"
                                    ng-value="articuloACargar.precio | currency: '$'"
                                    ng-show="idLista != -1"
                                    readonly
                                >
                                <input
                                    class="form-control"
                                    type="number"
                                    step="0.01"
                                    ng-model="articuloACargar.precio"
                                    esc-key="resetFilter()"
                                    ng-keypress="agregarATabla($event.keyCode)"
                                    ng-show="idLista == -1"
                                >
                            </td>
                            <td class="col text-right">
                                <input
                                    class="form-control"
                                    ng-value="getSubTotal() | currency: '$'"
                                    readonly
                                ></td>
                            <td class="text-center align-middle">
                                <button
                                    class="btn btn-outline-secondary"
                                    ng-click="agregarATabla(13)"
                                >
                                    <i class="fa fa-save"></i>
                                </button>
                            </td>
                        </tr>
                        <tr ng-show="cargando" class="d-flex">
                            <td colspan="7" class="col-12">
                                <input
                                    placeholder="Seleccione Articulo"
                                    class="form-control form-control-sm"
                                    readonly
                                    ng-click="seleccionarArticulo()"
                                />
                            </td>
                        </tr>
                        <tr class="d-flex">
                            <td colspan="4">
                                <strong>Cantidad Items:</strong>
                                <a ng-bind="articulosTabla.length"></a>
                            </td>
                            <td class="text-right ml-auto table-celda-total"><h3>Total:</h3></td>
                            <td class="table-celda-total text-right" colspan="1">
                                <h3>{{getTotal() | currency: '$'}}</h3>
                            </td>
                            <td class="text-right">
                                <button
                                    type="button"
                                    class="btn btn-default btn-sm"
                                >
                                    Totales
                                </button>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
        <div class="col-auto my-2 col-lg-2 botonera-lateral">
            <div class="row align-items-end">
                <div class="col-12">
                    <button
                        ng-click="crearNotaPedido()"
                        type="submit"
                        title="Crear nota pedido"
                        class="btn btn-default btn-block mb-2">
                        Guardar
                    </button>
                    <button
                        ng-click="salir()"
                        type="button"
                        title="Salir"
                        class="btn btn-default btn-block">
                        Salir
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>