Viewing file: recibo_pdf_view.php (22.94 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<style>
#content { margin: 0 auto;
width: auto; height: auto;
}
#izquierda{ width:400px; height:40px; float: left; }
#derecha{ width:400px; height:40px; float: right; }
#th{ border-left: 1px solid #3c8dbc; }
.red { color: red; }
.black { color: black; } .select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; height: 20px; padding: 4px 6px; margin-bottom: 10px; font-size: 24px; line-height: 20px; color: #555555; vertical-align: middle; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
.modal { top: 10%; left: 50%; width: 850px; margin-left: -380px; background-color: #ffffff; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.3); *border: 1px solid #999; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; outline: none; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } .modal.fade.in { top: 5%; }
img { max-width: 100%; display: block; }
#content { margin: 0 auto; width: auto; height: auto;
}
#izquierda{ width:50%; float: left; }
#derecha{ width:50%; float: right; }
#izquierda2{ width:70%; float: left; }
#derecha2{ width:30%; float: right; }
.content { min-height: 20px; padding: 15px; margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; max-height: 60px; }
.cuadrado{ witdth:auto; height:auto; background-color: #999999; border: solid 1px #000000; color: white; } .image { width: 100%; height: 100%; }
.image img { -webkit-transition: all 1s ease; /* Safari and Chrome */ -moz-transition: all 1s ease; /* Firefox */ -o-transition: all 1s ease; /* IE 9 */ -ms-transition: all 1s ease; /* Opera */ transition: all 1s ease; }
.image:hover img { -webkit-transform:scale(1.25); /* Safari and Chrome */ -moz-transform:scale(1.25); /* Firefox */ -ms-transform:scale(1.25); /* IE 9 */ -o-transform:scale(1.25); /* Opera */ transform:scale(1.25); }
.form-inline label { display: -ms-flexbox; display: inline; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; margin-bottom: 0; } [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) { display: inline !important ; } </style>
<div class="content-wrapper" style="min-height: 946px;"> <div ng-app="MenuOperaciones" style="margin-left:20px;"> <section class="content-header"> <div class="row"> <div id="content"> <div id="izquierda" align="left"> <input type="text" autofocus ng-model="search" ng-change="filter()" style="width: 600px;height :40px;" placeholder="BUSCAR RECIBOS" class="form-control" /> </div> </div> <div id="derecha" align="right"> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">+ NUEVO RECIBO</button> </div> </div> </section> <!-- Main content --> <section class="content">
<form ng-submit="confirm()" name="pedidos" id="pedidos" action="<?php echo base_url();?>recibo/verRecibos/" method="POST" ng-controller="MyCtrl">
<div class="row"> <div class="col-md-12" ng-show="filteredItems > 0"> <table class="table table-striped table-bordered"> <thead> <th>RECIBO <a ng-click="sort_by('id_recibo');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>PEDIDO ASOCIADO <a ng-click="sort_by('numero_pedido');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>FECHA <a ng-click="sort_by('fecha');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>VENDEDOR <a ng-click="sort_by('COTIZADOR');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>CLIENTE (RAZON SOCIAL) <a ng-click="sort_by('razon_social');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>PAGADOR <a ng-click="sort_by('pagador');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>TOTAL <a ng-click="sort_by('total');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>ACCION </th> </thead> <tbody> <tr ng-repeat="data in filtered = (list | filter:search) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"> <td ><b>{{data.id_recibo}}</b></td> <td ><b>{{data.numero_pedido}}</b></td> <td><b>{{data.fecha}}</b></td> <td><b>{{data.vendedor}}</b></td> <td><b>{{data.razon_social}}</b></td> <td><b>{{data.pagador}}</b></td> <td><b>{{data.total}}</b></td> <td> <div class="input-group"> <button type="submit" class="btn btn-warning btn-md" title="IMPRIMIR EN PDF" ng-click='ponerDatos(data.id_recibo,data.id_cliente,3)' aria-label="Left Align"> <span class="glyphicon glyphicon-print"></span> </button> <button type="submit" class="btn btn-danger btn-md" title="ELIMINAR PEDIDO" ng-click="ponerDatos(data.id_recibo,data.id_cliente,2)" aria-label="Left Align"> <span class="glyphicon glyphicon-trash"></span> </button>
</div> </td> </tr> </tbody> </table> </div> <div class="col-md-10" ng-show="filteredItems == 0"> <div class="col-md-10"> <h4>NO HAY RECIBOS DISPONIBLES</h4> </div> </div> <div class="col-md-10" ng-show="filteredItems > 0"> <div class="col-md-4"> <h5>Obtenidos {{ filtered.length }} De {{ totalItems}} RECIBOS </h5> </div> <div class="col-md-8" pagination="" page="currentPage" max-size="10" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"></div>
</div> <input type="hidden" name="accion" id="accion" ng-init="tipoOp = '0'" ng-model="model.accion" value="{{accion}}"> </input> <input type="hidden" name="numeroCliente" id="numeroCliente" ng-init="tipoOp = '0'" ng-model="model.numeroCliente" value="{{numeroCliente}}"> </input> <input type="hidden" name="numeroRecibo" id="numeroRecibo" ng-init="tipoOp = '0'" ng-model="model.numeroRecibo" value="{{numeroRecibo}}"> </input> </form> </div> </section><!-- /.content --> <!-- /.content-wrapper -->
<!-- Modal GENERACION DE RECIBOS --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > <div class="modal-dialog modal-lg"> <div style="margin-left:5px;" ng-controller="MyCtrl2" > <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">CREACION DE RECIBO</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <div class="modal-body" style="height:auto;"> <div class="inline"> <div class="row"> <div class="content" > <div id="izquierda" align="left"> <div class="span4"> <label><b style="font-family: Arial; font-size: 18pt;height: auto;">Nota de Pedido</b></label> </div> </div> <div id="derecha" align="right" style="height: 60px;"> <input style="font-family: Arial; font-size: 16pt;height: 40px;" placeholder="NUMERO PEDIDO" type="text" name="nroPedido2" class="med" id="nroPedido2" ng-model="nroPedido2" /> <button type="button" class="btn btn-primary btn-lg" title="ACTUALIZAR RECIBOS" ng-click="traerDatos()" aria-label="Left Align"> <span class="glyphicon glyphicon-refresh"></span> </button> <div class="span4"> <strong style="font-family: Arial; font-size: 12pt;height: 40px;">PAGADO: </strong> <select style="font-family: Arial; font-size: 16pt;height: 40px;" name="comboPagado" id="comboPagado" ng-change="registrarAccion()" ng-model="comboPagado" > <option><?php echo($checkPago[0]->pagado); ?></option> <?php $respuestaCombo4=$this->consultas_model->getCheck(); foreach($respuestaCombo4 as $file):?> <option><?= $file->pagado ?></option> <?php endforeach;?> </select> </div> </div> </div> </div> <label><b style="font-family: Arial; font-size: 18pt;height: 30px;">MONTO DEL PEDIDO</b></label><br><br> <div class="row"> <label><b style="font-family: Arial; font-size: 18pt;height: 30px;">SUBTOTAL: $</b></label> <input type="text" style="font-family: Arial; font-size:20pt;height: 40px;width :160px;" name="subForm" id="subForm" ng-model="subForm" value="subForm" readonly> <label><b style="font-family: Arial; font-size: 18pt;height: 30px;">TOTAL: $</b></label> <input type="text" style="font-family: Arial; font-size:20pt;height: 40px;width :160px;" name="totalForm" id="totalForm" ng-model="totalForm" value="totalForm" readonly>
<br><br><br>
<label><b style="font-family: Arial; font-size: 18pt;height: 30px;">CLIENTE: </b></label>
<input type="text" style="font-family: Arial; font-size:20pt;height: 40px;width :500px;" name="clienteForm" id="clienteForm" ng-model="clienteForm" value="clienteForm" readonly> </div> </div> <br> <div> <label><b>PAGADOR:</b></label> <input type="text" style="font-family: Arial; font-size: 12pt;height: 40px;width: 250px;" placeholder="PAGADOR" id="pagador" name="pagador" ng-model="pagador" value="" /> <label><b>OBSERVACION:</b></label> <input type="text" style="font-family: Arial; font-size: 12pt;height: 40px;width: 250px;" placeholder="OBSERVACION" id="observacion" name="observacion" ng-model="observacion" value="" /> </div> <div class="col-mod-12 form-inline"> <div> <label><b>TIPO PAGO:</b></label> <select style="font-family: Arial; font-size: 12pt;width: 160px;"name="comboTipoPago" id="comboTipoPago" ng-model="combo" class="form-control"> <option></option> <?php $respuestaCombo=$this->consultas_model->getTiposPagos(); foreach($respuestaCombo as $file):?> <option><?= $file ?></option> <?php endforeach;?> </select> <label><b>IMPORTE:</b></label> <input type="number" style="font-family: Arial; font-size: 12pt;height: 40px;width: 130px;" placeholder="MONTO" id="valor" ng-model="valor" name="valor" value="" /> </div> <br><br> <div> <label><b>NRO CHEQUE:</b></label> <input type="text" style="font-family: Arial; font-size: 12pt;height: 40px;width: 130px;" placeholder="NRO CHEQUE" id="numeroCheque" ng-model="numeroCheque" name="numeroCheque" value="" /> <label><b>BANCO:</b></label> <input type="text" style="font-family: Arial; font-size: 12pt;height: 40px;width: 150px;" placeholder="BANCO" id="banco" name="banco" ng-model="banco" value="" />
<label><b>FECHA COBRO:</b></label> <input style="font-family: Arial; font-size: 12pt;height: 40px;width: 120px;" name="datapicker1" id="datepicker1" ng-model="datepicker1" placeholder="FECHA COBRO" value=""> <button class="btn btn-primary btn-lg" title="AGREGAR ITEM" ng-click="putData(combo,valor,numeroCheque,banco,datepicker1)" aria-label="Left Align"> <span class="glyphicon glyphicon-plus"></span> </button> </div> </div> <br><br> <div class="row" > <div class="col-md-12" ng-show="filteredItems >= 0"> <table class="table table-striped table-bordered"> <thead> <th>TIPO PAGO <a ng-click="sort_by('tipoPago');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>MONTO <a ng-click="sort_by('monto');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>NUMERO CHEQUE <a ng-click="sort_by('numeroCheque');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>BANCO <a ng-click="sort_by('banco');"><i class="glyphicon glyphicon-sort"></i></a></th> <th>FECHA COBRO <a ng-click="sort_by('fechaCobro');"><i class="glyphicon glyphicon-sort"></i></a></th>
<th>ACCION </th> </thead> <tbody> <tr ng-repeat="data2 in listItems"> <td ><b>{{data2.tipoPago}}</b></td> <td><b>{{data2.valor}}</b></td> <td><b>{{data2.nro_cheque}}</b></td> <td><b>{{data2.banco}}</b></td> <td><b>{{data2.fechaCobro}}</b></td> <td> <div class="input-group"> <button type="submit" class="btn btn-danger btn-md" title="ELIMINAR ITEM" ng-click="sacarItems(data2)" aria-label="Left Align"> <span class="glyphicon glyphicon-trash"></span> </button> </div> </td> </tr> </tbody> </table> </div> </div>
</div> <div class="modal-footer"> <div class="inline"> <form ng-submit="confirm()" name="pedidos2" id="pedidos2" action="<?php echo base_url();?>recibo/procesarRecibo/" method="POST" > <button type="button" class="btn btn-default btn-lg " data-dismiss="modal">CERRAR</button> <input type="hidden" name="nroPedido" id="nroPedido" ng-model="nroPedido" value="{{nroPedido}}"> </input> <input type="hidden" name="arrayDatos" id="arrayDatos" ng-model="arrayDatos" value="{{listItems}}"> </input> <input type="hidden" name="observacion2" id="observacion2" ng-model="observacion2" value="{{observacion}}"> </input> <input type="hidden" name="pagador2" id="pagador2" ng-model="pagador2" value="{{pagador}}"> </input> <input type="hidden" name="id_cliente" id="id_cliente" ng-model="id_cliente" value="{{id_cliente}}"> </input> <input type="submit" class="btn btn-success btn-lg" id="registrar2" value="GENERAR RECIBO" ng-click="pasarDatos()" /> </form> </div> </div> </div> </div> </div> </div> <script type="text/javascript"> $( "#datepicker1" ).datepicker({ dateFormat: "yy-m-dd", // Primer dia de la semana El lunes firstDay: 1, // Dias Largo en castellano // Cuando seleccionamos la fecha esta se pone en el campo Input onSelect: function(dateText) {
} });
var app = angular.module('MenuOperaciones', ['ui.bootstrap']);
app.filter('startFrom', function() { return function(input, start) { if(input) { start = +start; //parse to int return input.slice(start); } return []; } }); app.controller('MyCtrl', function ($scope, $http, $location) { $scope.accion=''; $scope.numeroCliente=''; $scope.numeroPedido=''; $scope.list=[]; $scope.reloadPage = function(){window.location.reload();} $http.get("<?php echo site_url("recibo/getRecibosAjax");?>").success(function(data){ $scope.list = data; $scope.currentPage = 1; //current page $scope.entryLimit = 10; //max no of items to display in a page $scope.filteredItems = $scope.list.length; //Initially for no filter $scope.totalItems = $scope.list.length; }); $scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; $scope.sort_by = function(predicate) { $scope.predicate = predicate; $scope.reverse = !$scope.reverse; };
$scope.ponerDatos= function (id,numeroCliente,accion){ $scope.accion=accion; $scope.numeroCliente=numeroCliente; $scope.numeroRecibo=id; }; $scope.confirm = function() { if (confirm('Estas seguro de esta accion?')){ event.returnValue=true; } else{ event.returnValue=false; } }; });
app.controller('MyCtrl2', function ($scope, $http, $location) { $scope.accion=''; $scope.observacion=''; $scope.pagador=''; $scope.numeroRecibo=''; $scope.nroPedido=''; $scope.listItems=[]; $scope.comboPagado=''; $scope.currentPage = 1; //current page $scope.entryLimit = 10; //max no of items to display in a page
$scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; $scope.sort_by = function(predicate) { $scope.predicate = predicate; $scope.reverse = !$scope.reverse; }; $scope.traerDatos = function(value){ numeroPedido=document.getElementById("nroPedido2").value; if(numeroPedido){ $scope.nroPedido=numeroPedido; $.ajax({ type: 'POST', url: '<?php echo site_url("recibo/traerDatosRecibo");?>', data: {numeroPedido:numeroPedido}, success:function(data){ respuesta=data.split(';'); subTotal=parseFloat(respuesta[0]); total=parseFloat(respuesta[1]); cliente=respuesta[2]; $('#subForm').val(subTotal); $('#totalForm').val(total); $('#clienteForm').val(cliente); $('#nroPedido').val(numeroPedido); }, error: function () { alert("ERROR AL SELECCIONAR PEDIDO"); } });
} else{ alert("Ingrese un numero de pedido valido"); } }
$scope.sacarItems= function(item){
var index = $scope.listItems.indexOf(item); $scope.listItems.splice(index, 1); };
$scope.registrarAccion= function(){ numeroPedido=document.getElementById("nroPedido2").value; checkPago=document.getElementById("comboPagado").value; if(numeroPedido){ if(checkPago){ $scope.nroPedido=numeroPedido; $.ajax({ type: 'POST', url: '<?php echo site_url("recibo/registrarCambioPagos");?>', data: {numeroPedido:numeroPedido,checkPago:checkPago}, success:function(data){ alert("Registracion de cambio de pago"); }, error: function () { alert("ERROR AL SELECCIONAR PEDIDO"); } }); }else{alert("Ingrese un valor de pago");}
}else{ alert("Ingrese una Nota de Pedido"); }
} $scope.putData= function (a,b,c,d,e){ error="0";
var datetime = $("#datepicker1").val(); if(b){}else{b="";} if(c){}else{c="";} if(d){}else{d="";} if(datetime){}else{datetime="";}
//validacion items //valido si es efectivo if(a ==="EFECTIVO"){ if(b != ""){ } else{ error="1"; alert("debe completar el monto"); } } if(a ==="TRANSFERENCIA"){ if(b != ""){ } else{ error="1"; alert("debe completar el monto"); } }
if(a ==="MERCADOPAGO"){ if(b != ""){ } else{ error="1"; alert("debe completar el monto"); } }
if(a ==="OTROS"){ if(b != ""){ } else{ error="1"; alert("debe completar el monto"); } }
//valido si es cheque if(a==="CHEQUE"){ if(b != ""){ if(c != ""){ if(d!= ""){ if(datetime!= ""){ }else{ error="1"; alert("debe completar FECHA COBRO"); } }else{ error="1"; alert("debe completar el BANCO"); } }else{ error="1"; alert("debe completar el numero de cheque"); } } else{ error="1"; alert("debe completar el monto"); } } if(error === "0"){ $scope.listItems.push({ 'tipoPago':a, 'valor':b, 'nro_cheque':c, 'banco':d, 'fechaCobro':datetime }); //vacio los campos $scope.numeroCheque=""; $scope.combo=""; $scope.valor=""; $scope.banco=""; $("#datepicker1").val(""); } };
$scope.confirm = function() { if ($scope.listItems.length > 0){ $scope.comboPagado=''; $scope.numeroRecibo=''; event.returnValue=true; $('#myModal').modal('hide'); $('body').removeClass('modal-open');//eliminamos la clase del body para poder hacer scroll $('.modal-backdrop').remove(); } else{ alert("FORMULARIO VACIO"); event.returnValue=false; } }; });
$(this).ready( function() { $("#buscando").autocomplete({ minLength: 1, source:'<?php echo site_url("pedido/autocompletar");?>', }); }); </script>
|