1 2 $(".btnEditarOtrosDespachos").click(function(){ 3 4 var idOtrosDespachos = $(this).attr("idOtrosDespachos"); 5 6 window.location = "index.php?ruta=editarOtrosDespachos&idOtrosDespachos="+idOtrosDespachos; 7 8 9}) 10 11 12 $(".btnVerOtrosDespachos").click(function(){ 13 14 var idOtrosDespachos = $(this).attr("idOtrosDespachos"); 15 16 window.location = "index.php?ruta=verOtrosDespachos&idOtrosDespachos="+idOtrosDespachos; 17 18 19}) 20 21 22 $(document).on('click', 'button.btnImprimirOtrosDespacho', function(){ 23 var idOtrosDespachos = $(this).attr("idOtrosDespachos"); 24 window.open("extensiones/tcpdf/pdf/imprimirComprovanteDespachoCentro.php?idOtrosDespachos="+idOtrosDespachos, "_blank"); 25}); 26 27 28 29 30 31 $(function () { 32 $(".tablaProdDesO").DataTable({ 33 "ajax": "ajax/despacho.ajax.php", 34 "deferRender": true, 35 "retrieve": true, 36 "processing": true, 37 38 "language":{ 39 "sProcessing": "Procesando...", 40 "sLengthMenu": "Mostrar _MENU_ registros", 41 "sZeroRecords": "No se encontraron resultados", 42 "sEmptyTable": "Ningún dato disponible en esta tabla", 43 "sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_", 44 "sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0", 45 "sInfoFiltered": "(filtrado de un total de _MAX_ registros)", 46 "sInfoPostFix": "", 47 "sSearch": "Buscar:", 48 "sUrl": "", 49 "sInfoThousands": ",", 50 "sLoadingRecords": "Cargando...", 51 "oPaginate": { 52 "sFirst": "Primero", 53 "sLast": "Ãltimo", 54 "sNext": "Siguiente", 55 "sPrevious": "Anterior" 56 }, 57 "oAria": { 58 "sSortAscending": ": Activar para ordenar la columna de manera ascendente", 59 "sSortDescending": ": Activar para ordenar la columna de manera descendente" 60 } 61 }, 62 }); 63 }); 64 65 66 /*============================================= 67AGREGANDO PRODUCTOS A LA VENTA DESDE LA TABLA 68=============================================*/ 69 70$(".tablaProdDesO").on("click", "button.agregarProducto", function(){ 71 72 var idProductoCa = $(this).attr("idProductoCa"); 73 //console.log("idProductoCa",idProductoCa); 74 $(this).removeClass("btn-warning agregarProducto"); 75 76 $(this).addClass("btn-default"); 77 var datos = new FormData(); 78 datos.append("idProductoCa", idProductoCa); 79 80 $.ajax({ 81 82 url:"ajax/catalogo.ajax.php", 83 method: "POST", 84 data: datos, 85 cache: false, 86 contentType: false, 87 processData: false, 88 dataType:"json", 89 success:function(respuesta){ 90 var descripcion = respuesta["descripcion"]; 91 var lineaProducto = respuesta["nombreUnidad"]; 92 // console.log("respuesta", respuesta["id"]); 93 94 var datosidPro = new FormData(); 95 datosidPro.append("idProducto", respuesta["id"]); 96 97 $.ajax({ 98 url:"ajax/InventarioProductos.ajax.php", 99 method: "POST", 100 data: datosidPro, 101 cache: false, 102 contentType: false, 103 processData: false, 104 dataType:"json", 105 success:function(respuesta){ 106 107 console.log("existencia", respuesta["stock"]); 108 var stock= respuesta["stock"]; 109 var sinstock="Sin existencias"; 110 111 112 $(".nuevoProducto").append( 113 '<div class="row">'+ 114 '<div class="col-6">'+ 115 '<div class="input-group">'+ 116 117 '<span class="input-group-text"> <button type="button" class="btn btn-danger btn-xs quitarProductoD" idProductoCa="'+idProductoCa+'"><i class="fa fa-times"> </i></button> </span>'+ 118 119 '<input type="text" class="form-control nuevaDesripcionProducto" idProductoCa="'+idProductoCa+'" id="nuevaDesripcionProducto" value="'+descripcion+'" name="nuevaDesripcionProducto[]" readonly>'+ 120 121 '</div>'+ 122 '</div>'+ 123 124 '<div class="col-2 ingresoPrecio">'+ 125 '<div class="input-group">'+ 126 '<input type="text" style="text-align:right;" class="form-control nuevoPrecioProducto" id="nuevoPrecioProducto" value="'+lineaProducto+'" name="nuevoPrecioProducto" min="1" placeholder="0.00" required readonly>'+ 127 128 '</div>'+ 129 '</div>'+ 130 131 '<div class="col-2">'+ 132 '<input type="text" style="text-align:right;" class="form-control nuevaCantidadProductoB" id="nuevaCantidadProductoB" name="nuevaCantidadProductoB" min="1" placeholder="0" required>'+ 133 '</div>'+ 134 '<div class="col-2">'+ 135 '<input type="text" style="text-align:right;" class="form-control " value="'+stock+'" id="" name="" min="1" placeholder="0" required readonly>'+ 136 '</div>'+ 137 '</div>' 138 ) 139 //listarProductosOd() 140 } 141 }) 142 } 143 }) 144}); 145var idQuitarProducto = []; 146localStorage.removeItem("quitarProductoD");
147$(".formularioVenta").on("click", "button.quitarProductoD", function(){ 148 $(this).parent().parent().parent().parent().remove(); 149 var idProductoCa = $(this).attr("idProductoCa"); 150 /*============================================= 151 ALMACENAR EN EL LOCALSTORAGE EL ID DEL PRODUCTO A QUITAR 152 =============================================*/ 153 if(localStorage.getItem("quitarProductoD") == null){ 154 idQuitarProducto = []; 155 }else{ 156 idQuitarProducto.concat(localStorage.getItem("quitarProductoD")) 157 } 158 idQuitarProducto.push({"idProductoCa":idProductoCa}); 159 localStorage.setItem("quitarProductoD", JSON.stringify(idQuitarProducto)); 160 $("button.recuperarBoton[idProductoCa='"+idProductoCa+"']").removeClass('btn-default'); 161 $("button.recuperarBoton[idProductoCa='"+idProductoCa+"']").addClass('btn-warning agregarProducto'); 162 //listarProductosOd() 163}) 164/*============================================= 165MODIFICAR LA CANTIDAD 166=============================================*/ 167$(".formularioVenta").on("change", "input.nuevaCantidadProductoB", function(){ 168 //listarProductosOd() 169}) 170/*function listarProductosOd(){ 171 var listaProductos = []; 172 var descripcion = $(".nuevaDesripcionProducto"); 173 var cantidad = $(".nuevaCantidadProductoB"); 174 for(var i = 0; i < descripcion.length; i++){ 175 listaProductos.push({ "id" : $(descripcion[i]).attr("idProductoCa"), 176 "descripcion" : $(descripcion[i]).val(), 177 "cantidad" : $(cantidad[i]).val()}) 178 } 179 $("#listarProductos").val(JSON.stringify(listaProductos)); 180}*/ 181function listarProductoswD(){ 182 var listaProductos = []; 183 var descripcion = $(".nuevaDesripcionProducto"); 184 var cantidad = $(".nuevaCantidadProductoB"); 185 var precio = $(".nuevoPrecioProducto"); 186 var totalPro = $(".nuevoTotalPorProductoD"); 187 for(var i = 0; i < descripcion.length; i++){ 188 listaProductos.push({ "id" : $(descripcion[i]).attr("idProductoCa"), 189 "descripcion" : $(descripcion[i]).val(), 190 "precio" : $(precio[i]).val(), 191 "cantidad" : $(cantidad[i]).val(), 192 "totalPorPro" : $(totalPro[i]).val()}) 193 } 194 $("#listarProductos").val(JSON.stringify(listaProductos)); 195} 196function sumarTotalPreciosD(){ 197 var precioItem = $(".nuevoTotalPorProductoD"); 198 var sumaTotalPrecio = parseFloat(0.00); 199 if (precioItem.length >=1 ) { 200 var arraySumaPrecio = []; 201 for(var i = 0; i < precioItem.length; i++){ 202 arraySumaPrecio.push(Number($(precioItem[i]).val())); 203 } 204 function sumaArrayPrecios(total, numero){ 205 return total + numero; 206 } 207 var sumaTotalPrecio = arraySumaPrecio.reduce(sumaArrayPrecios).toFixed(2); 208 } 209 $("#nuevoTotalProductoD").val(sumaTotalPrecio); 210} 211 $(".optionSeleccionarMB").click(function(){ 212var tipoDoc = $(this).attr("tipoDoc"); 213var idTipoDoc = $(this).val(); 214 $("#tipoDocuemtos").val(tipoDoc); 215if (idTipoDoc == 6) { 216$('#MostrarDestino').show(); 217}else { 218$('#MostrarDestino').hide(); 219} 220if (idTipoDoc == 7) { 221$('#MostrarEnvio').show(); 222$('#MostrarEnvioBoton').show(); 223}else { 224$('#MostrarEnvio').hide(); 225$('#MostrarEnvioBoton').hide(); 226 $(".mostrarIngresoBodega").html(""); 227 listarProductoswD(); 228sumarTotalPreciosD(); 229$('#IngresoBodegas').html("Ingreso a Bodega"); 230} 231}) 232 $("#radioDanger1ROD").change(function(){ 233var idtodo = $(this).val(); 234if (idtodo == 0) { 235}else { 236$('#OcultarResponsableDes').show(); 237 //$("#idDoc").val(idtodo); 238} 239}) 240 $("#radioDanger2ROD").change(function(){ 241var idtodo = $(this).val(); 242if (idtodo == 0) { 243$('#OcultarResponsableDes').hide(); 244// $("#idDoc").val(idtodo); 245}else { 246} 247}) 248$("#bodegaSelOrigen").change(function(){ 249$(".listPendienteIngreso").html(""); 250 var idBodegaOrigen = $(this).val(); 251 var idMovimiento = $("#TiposDespachosN").val(); 252 if (idMovimiento == 7) { 253 var datos = new FormData(); 254 datos.append("idBodegaOrigen",idBodegaOrigen); 255 $.ajax({ 256 url:"ajax/PendinteBodegaIngreso.ajax.php", 257 method:"POST", 258 data: datos, 259 cache: false, 260 contentType: false, 261 processData: false, 262 dataType:"json", 263 success: function(respuesta){ 264 265 console.log(respuesta) 266 267 $(".listPendienteIngreso").append( 268 ' <option value="" disabled selected>Ingreso a Bodega</option>' 269 270 ) 271 272 for (var i = 0; i < respuesta.length; i++) { 273 274 console.log(respuesta[i]["nombreSede"]) 275 console.log(respuesta[i]["id"]) 276 277 $(".listPendienteIngreso").append( 278 '<option class="optionSeleccionarBoIngre" idBodega="'+respuesta[i]["id"]+'" value="'+respuesta[i]["id"]+'">'+respuesta[i]["observaciones"]+' / '+respuesta[i]["codigoBo"]+'</option>' 279 ) 280 } 281 } 282 }) 283 }else { 284 } 285}) 286$(".btnGenPeBodega").on("click", function(){ 287var idBodegaPendiente = $("#IngresoBodegas").val(); 288 $(".mostrarIngresoBodega").html(""); 289var idPersonalc = $("#IngresoBodegas").val(); 290var datos = new FormData(); 291datos.append("idPersonalc", idPersonalc); 292$.ajax({ 293url:"ajax/faltasPersonalFijo.ajax.php", 294method:"POST", 295data: datos, 296cache: false, 297contentType: false, 298processData: false, 299dataType:"json", 300success: function(respuesta){ 301 for (var i = 0; i < respuesta.length; i++) { 302 var totalPro = 0; 303 var stock = 0; 304 totalPro = ((respuesta[i]["precioventa"] * respuesta[i]["cantidad"]).toFixed(2)) ; 305 $(".mostrarIngresoBodega").append( 306 '<div class="row">'+ 307 '<div class="col-4">'+ 308 '<div class="input-group">'+ 309 '<span class="input-group-text"> <button type="button" class="btn btn-danger btn-xs quitarProductoD" idProductoCa="'+respuesta[i]["idProd"]+'"><i class="fa fa-times"> </i></button>
309 </span>'+ 310 '<input type="text" class="form-control nuevaDesripcionProducto" idProductoCa="'+respuesta[i]["idProd"]+'" id="nuevaDesripcionProducto" value="'+respuesta[i]["nombre"]+'" name="nuevaDesripcionProducto[]" readonly>'+ 311 '</div>'+ 312 '</div>'+ 313 '<div class="col-2 ingresoPrecio">'+ 314 '<div class="input-group">'+ 315 '<input type="text" class="form-control nuevoPrecioProducto" id="nuevoPrecioProducto" value="'+respuesta[i]["precioventa"]+'" name="nuevoPrecioProducto" min="1" placeholder="0.00" required readonly>'+ 316 317 '</div>'+ 318 '</div>'+ 319 '<div class="col-2">'+ 320 '<input type="text" class="form-control nuevaCantidadProductoB" id="nuevaCantidadProductoB" value="'+respuesta[i]["cantidad"]+'" name="nuevaCantidadProductoB" min="1" placeholder="0" required>'+ 321 '</div>'+ 322 '<div class="col-2 totalProducto">'+ 323 '<div class="input-group">'+ 324 '<input type="text" class="form-control nuevoTotalPorProductoD" id="nuevoTotalPorProductoD" name="nuevoTotalPorProductoD" value="'+totalPro+'" min="1" placeholder="0.00" required readonly>'+ 325 '</div>'+ 326 '</div>'+ 327 '<div class="col-2">'+ 328 '<input type="text" class="form-control " value="" id="" name="" min="1" placeholder="0" required readonly>'+ 329 '</div>'+ 330 '</div>' 331 ) 332listarProductoswD(); 333sumarTotalPreciosD(); 334 } 335 } 336 }); 337})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.