foca-modal-factura.html 4.58 KB
<div class="modal-header py-1">
    <div class="row w-100">
        <div class="col-lg-6">
            <h5 class="modal-title">Búsqueda de Comprobantes</h5>
        </div>
    </div>
</div>
<div class="modal-body" id="modal-body">   
    <table ng-show="primerBusqueda" class="table table-striped table-sm">
        <thead>
            <tr>
                <th>Comprobante</th>
                <th>Vencimiento</th>
                <th class="text-right">Importe</th>
                <th class="text-right">Saldo</th>
                <th class="text-right"></th>
                <th class="text-right"></th>
                <th class="text-right"></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-show="currentPageFacturas.length == 0 && primerBusqueda">
                <td colspan="5">
                    No se encontraron resultados.
                </td>
            </tr>
            <tr class="selectable"
                ng-repeat="(key, factura) in currentPageFacturas">
                <td ng-click="factura.checked = !factura.checked">{{factura.numeroFactura}} {{factura.FECHA_COMPROBANTE | date : 'dd/MM/yyyy' : 'GMT'}}</td>
                <td ng-click="factura.checked = !factura.checked">{{(factura.TCO == 'FT') ? factura.NCU + ' - ' : ''}}{{factura.FEV | date : 'dd/MM/yyyy' : 'GMT'}}</td>
                <td class="text-right"
                    ng-click="factura.checked = !factura.checked">
                    {{ (factura.IPA_SHOW / parametrosFactura.cotizacion)  | number:2 }}
                    <span ng-class="{'invisible': factura.IPA >= 0}">-</span>
                </td>
                <td class="text-right"
                    ng-click="factura.checked = !factura.checked">
                    {{ factura.saldo_show | number:2 }}
                    <span ng-class="{'invisible': factura.saldo >= 0}">-</span>
                </td>
                <td class="text-right">
                    <input
                        ng-class="{
                        'btn-secondary': selectedFactura != key,
                        'btn-primary': selectedFactura == key}"
                        ng-keydown="itemFactura($event.keyCode)"
                        foca-focus="selectedFactura == {{key}}"
                        type="checkbox"
                        ng-model="factura.checked"
                    />
                </td>
                <td>
                    <button 
                        class="btn p-1"
                        ng-click="verFactura(factura)"
                        title="Ver comprobante"
                    >
                        <i class="fa fa-eye" aria-hidden="true"></i>
                    </button>
                </td>
                <td>
                    <button
                        class="btn p-1"
                        ng-click="enviarMail(factura)"
                        title="Enviar comprobante por mail"
                    >
                        <i class="fa fa-envelope-o" aria-hidden="true"></i>
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<div class="modal-footer py-1">
    <nav ng-show="currentPageFacturas.length > 0 && primerBusqueda" class="mr-auto">
        <ul class="pagination pagination-sm justify-content mb-0">
            <li class="page-item" ng-class="{'disabled': currentPage == 1}">
                <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)">
                    <span aria-hidden="true">&laquo;</span>
                    <span class="sr-only">Anterior</span>
                </a>
            </li>
            <li
                class="page-item"
                ng-repeat="pagina in paginas"
                ng-class="{'active': pagina == currentPage}"
            >
                <a
                    class="page-link"
                    href="javascript:void();"
                    ng-click="selectPage(pagina)"
                    ng-bind="pagina"
                ></a>
            </li>
            <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
                <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)">
                    <span aria-hidden="true">&raquo;</span>
                    <span class="sr-only">Siguiente</span>
                </a>
            </li>
        </ul>
    </nav>
    <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button>
    <button
        class="btn btn-sm btn-primary"
        type="button"
        ng-click="aceptar()"
        ng-disabled="tieneAlMenosUno()"
    >Aceptar</button>
</div>