factura.html 16.5 KB
<div class="crear-nota-remito foca-crear row">
    <foca-cabecera-facturador 
        titulo="'Factura'"
        numero="puntoVenta + '-' + comprobante"
        fecha="now"
        class="mb-0 col-lg-12"
        busqueda="seleccionarRemito"
    ></foca-cabecera-facturador>
    <marquee
        bgcolor="#FF9900"
        behavior="scroll"
        direction="left"
        ng-bind="factura.observaciones"
    ></marquee>
    <div class="col-12 col-lg-10 p-2">
        <div class="row border border-light rounded m-0">
            <div class="col-12 col-sm-12">
                <div class="row p-1 botonera-secundaria px-3 py-2">
                    <div class="col-12">
                        <foca-botonera-facturador
                            botones="botonera"
                            max="botonera.length"
                            class="row">
                        </foca-botonera-facturador>
                    </div>
                </div>
                <div ng-show="botoneraProductos.length > 0" class="row botonera-secundaria pb-3 px-3">
                    <div class="col-12">
                        <foca-botonera-productos 
                            botones="botoneraProductos" 
                            max="1" 
                            class="row"
                        >
                        </foca-botonera-productos>
                    </div>
                </div>
                <!-- PC -->
                <div class="row grilla-articulo align-items-end d-none d-sm-flex">
                    <table class="table tabla-articulo table-striped table-sm mb-0 rounded-bottom">
                        <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-light 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 articulosFiltro()"
                                ng-show="show || key == (articulosFiltro().length - 1)"
                                class="d-flex"
                            >
                                <td ng-bind="key + 1"></td>
                                <td 
                                    class="col" 
                                    ng-bind="articulo.SEC + '-' + articulo.ART"
                                ></td>
                                <td
                                    class="col-4" 
                                    ng-bind="articulo.DES"
                                ></td>
                                <td class="col text-right">
                                    <input
                                        ng-show="articulo.editCantidad"
                                        ng-model="tmpCantidad"
                                        class="form-control"
                                        foca-tipo-input
                                        min="1"
                                        foca-focus="articulo.editCantidad"
                                        ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad);"
                                        esc-key="cancelarEditar(articulo)"
                                        ng-focus="selectFocus($event); tmpCantidad = articulo.CAN;"
                                        teclado-virtual
                                    >
                                    <i
                                        class="selectable"
                                        ng-click="cambioEdit(articulo, 'cantidad')"
                                        ng-hide="articulo.editCantidad"
                                        ng-bind="articulo.CAN">
                                    </i>
                                </td>
                                <td class="col text-right">
                                    <i
                                        class="selectable"
                                        ng-bind="articulo.PUN | number: 4">
                                    </i>
                                </td>
                                <td
                                    class="col text-right"
                                    ng-bind="(articulo.PUN * articulo.CAN) | number: 2">
                                </td>
                                <td class="text-center">
                                    <button
                                        class="btn btn-outline-light"
                                        ng-click="quitarDespacho(articulo, key)"
                                    >
                                        <i class="fa fa-trash"></i>
                                    </button>
                                    <button
                                        class="btn btn-outline-light"
                                        ng-click="editarArticulo(13, articulo, tmpCantidad);"
                                        ng-show="articulo.editCantidad || articulo.editPrecio"
                                    >
                                        <i class="fa fa-save"></i>
                                    </button>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr class="d-flex">
                                <td colspan="4" class="no-border-top">
                                    <strong>Items:</strong>
                                    <a ng-bind="articulosFiltro().length"></a>
                                </td>
                                <td class="text-right ml-auto table-celda-total no-border-top">
                                    <h3>Total:</h3>
                                </td>
                                <td class="table-celda-total text-right no-border-top" colspan="1">
                                    <h3>{{getTotal() | currency: factura.cotizacion.moneda.SIMBOLO}}</h3>
                                </td>
                                <td class="text-right no-border-top">
                                    <button
                                        type="button"
                                        class="btn btn-sm"
                                    >
                                        Totales
                                    </button>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
                <!-- MOBILE -->
                <div class="row d-sm-none">
                    <div class="col p-0 m-2 mb-5">                        
                        <table class="table table-sm table-striped tabla-articulo">
                            <thead>
                                <tr class="d-flex">
                                    <th class="">#</th>
                                    <th class="col px-0">
                                        <div class="d-flex">
                                            <div class="col-4 px-1">Código</div>
                                            <div class="col-8 px-1">Descripción</div>
                                        </div>
                                        <div class="d-flex">
                                            <div class="col-3 px-1">Cantidad</div>
                                            <div class="col px-1 text-right">P. Uni.</div>
                                            <div class="col px-1 text-right">Subtotal</div>
                                        </div>
                                    </th>
                                    <th class="text-center tamaño-boton">
                                        &nbsp;
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr 
                                    ng-repeat="(key, articulo) in articulosFiltro()"
                                    ng-show="show || key == articulosFiltro().length - 1"
                                >
                                    <td class="w-100 d-flex p-0">
                                        <div class="p-1 m-auto">
                                            <span ng-bind="key + 1"></span>
                                        </div>
                                        <div class="col px-0">
                                            <div class="d-flex">
                                                <div class="col-4 px-1">
                                                    <span 
                                                        ng-bind="articulo.SEC + '-' + articulo.ART"
                                                    ></span>
                                                </div>
                                                <div class="col-8 px-1">
                                                    <span ng-bind="articulo.DES"></span>
                                                </div>
                                            </div>
                                            <div class="d-flex">
                                                <div class="col-4 px-1">
                                                    <span 
                                                        ng-bind="'x' + articulo.CAN"
                                                        ng-hide="articulo.editCantidad"
                                                    ></span>
                                                    <i 
                                                        class="fa fa-pencil text-white-50"
                                                        aria-hidden="true"
                                                        ng-hide="articulo.editCantidad"
                                                        ng-click="articulo.editCantidad = true"
                                                    ></i>
                                                    <input
                                                        ng-show="articulo.editCantidad"
                                                        ng-model="tmpCantidad"
                                                        class="form-control"
                                                        foca-tipo-input
                                                        min="1"
                                                        step="0.001"
                                                        foca-focus="articulo.editCantidad"
                                                        ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad)"
                                                        ng-focus="selectFocus($event)"
                                                    >
                                                </div>
                                                <div class="col px-1 text-right">
                                                    <span ng-bind="articulo.PUN |
                                                            currency: factura.cotizacion.moneda.SIMBOLO : 4"></span>
                                                    ></span>
                                                </div>
                                                <div class="col px-1 text-right">
                                                    <span 
                                                        ng-bind="(articulo.PUN * articulo.CAN) |
                                                            currency: factura.cotizacion.moneda.SIMBOLO"
                                                    >
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="m-auto p-1">
                                            <button
                                                class="btn btn-outline-light"
                                                ng-click="quitarDespacho(articulo, key)"
                                            >
                                                <i class="fa fa-trash"></i>
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                            <tfoot>
                                <!-- TOOGLE EXPANDIR -->
                                <tr>
                                    <td class="col">
                                        <button
                                            class="btn btn-outline-light selectable w-100"
                                            ng-click="show = !show; masMenos()"
                                            ng-show="articulosFiltro().length > 0"
                                        >
                                            <i
                                                class="fa fa-chevron-down"
                                                ng-hide="show"
                                                aria-hidden="true"
                                            >
                                            </i>
                                            <i
                                                class="fa fa-chevron-up"
                                                ng-show="show"
                                                aria-hidden="true">
                                            </i>
                                        </button>
                                    </td>
                                </tr>
                                <!-- FOOTER -->
                                <tr class="d-flex">
                                    <td class="m-auto no-border-top" colspan="2">
                                        <strong>Cantidad Items:</strong>
                                        <a ng-bind="articulosFiltro().length"></a>
                                    </td>
                                    <td class="text-right ml-auto table-celda-total no-border-top">
                                        <h3>Total:</h3>
                                    </td>
                                    <td class="table-celda-total text-right no-border-top">
                                        <h3>{{getTotal() | currency: factura.cotizacion.moneda.SIMBOLO}}</h3>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-md-none fixed-bottom disable-selection">
        <div class="w-100 bg-dark d-flex px-3 acciones-mobile">
            <span class="ml-3 text-muted" ng-click="salir()">Salir</span>
            <span
                class="mr-3 ml-auto"
                ng-class="saveLoading ? 'text-muted' : ''"
                ng-click="seleccionarFormaDePago()"
                ladda="saveLoading"
                data-style="expand-left"
            >Pago</span>
        </div>
    </div>
</div>