
<?php include "views/templates/header.php";?>


<ol class="breadcrumb mb-4">
    <li class="breadcrumb-item active">CAJAS</li>
</ol>
<button class="btn btn-success mb-2" type="button"  onclick="arqueoCaja();">Abrir Caja<i class="fas fa-plus"></i></button>
<button class="btn btn-danger mb-2" type="button"  onclick="entradallamaraRCA();">Cerrar caja<i class="fas fa-plus"></i></button>
<table class="table table-light" id="t_arqueo" >
    <thead class="thead-dark">
        <tr>
            <th>ID</th>
            <th> Apertura</th>
            <th>Total de ventas</th>
            <th>fecha apertura </th>
            <th>fecha cierre </th>
            <th>Ventas generadas</th>
            <th>total de compras</th>
            <th>monto total</th>
            <th>estado</th>
           






        </tr>
    </thead>
    <tbody>
    
    </tbody>
</table>
<div id="abrir_caja" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="my-modal-title" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary" >
                <h5 class="modal-title text-white" title="title" id="title">APERTURA Y CIERRE</h5>

                <button class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form method="post" id="frmAbrirCaja" onsubmit="abrirArqueo(event);" >
                    <div class="form-group">
                        <input type="hidden" id="id" name="id">
                        <label for="monto_inicial">CAJA</label>
                        <input id="monto_inicial" class="form-control" type="text" name="monto_inicial" placeholder="Monto inicial" >
                    </div>
                    <div id="ocultar_campos">
                        
                    <div class="form-group">
                        <label for="monto_final">TOTAL DE VENTAS</label>
                        <input id="monto_final" class="form-control" type="text" disabled>
                    </div>
                    <div class="form-group">
                        <label for="compras_totales">COMPRAS</label>
                        <input id="compras_totales" class="form-control" type="text" disabled>
                    </div>
                    <div class="form-group">
                        <label for="total_ventas">VENTAS GENERADAS</label>
                        <input id="total_ventas" class="form-control" type="text" disabled>
                    </div>
                    <div class="form-group">
                        <label for="monto_general">TOTAL EN CAJA</label>
                        <input id="monto_general" class="form-control" type="text" disabled>
                    </div>



                    </div>
                
                        <button class="btn btn-primary" type="submit" id="btnaccion" style="width:50%; margin: 5px;">CONFIRMAR</button>
                        <button class="btn btn-danger" type="button" data-dismiss="modal" style="width:50% ; margin: 5px;">CANCELAR</button>
                    
                       
                    
                      
                </form>
            </div>
        </div>
    </div>
</div>



<div id="abrir_cajaSS" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="my-modal-title" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary" >
                <h5 class="modal-title text-white" title="titleSS" id="titleSS">APERTURA Y CIERRE</h5>

                <button class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form method="post" id="frmAbrirCajaSS">
                <div class="form-group">
                    <input type="hidden" id="id_USER" name="id_usuario" value="<?php echo $_SESSION['id_usuario']; ?>">
                    <label for="monto_inicialss">INGRESE SU MONTO DE CIERRE</label>
                    <input id="monto_inicialss" class="form-control" type="text" name="monto_inicialss" placeholder="S/ 0.000">
                </div>

                    <button class="btn btn-primary" type="submit" id="btnaccionss" style="width:50%; margin: 5px;" onclick="cerrarCajaSSS(event)">CERRAR CAJA</button>

                        <button class="btn btn-danger" type="button" data-dismiss="modal" style="width:50% ; margin: 5px;">CANCELAR</button>
                    
                </form>
            </div>
        </div>
    </div>
</div>

<?php include "views/templates/footer.php"; ?>





