|
@ -58,7 +58,7 @@ function crear_detalles_pedido(nro,ido){ |
|
|
} |
|
|
} |
|
|
/*ARMO PANTALLA*/ |
|
|
/*ARMO PANTALLA*/ |
|
|
//var detallesList = '<div class="col-12 salir"> ';
|
|
|
//var detallesList = '<div class="col-12 salir"> ';
|
|
|
var detallesList ='<tr class="salir table-responsive"><td colspan="4" class="p-0 pb-4"><table class="table table-sm"><thead><tr><th scope="col">COD ART</th><th scope="col">Descripción</th><th scope="col">Cant</th><th scope="col">UxB</th><th scope="col">Precio</th><th scope="col">Total Item</th><th scope="col">Renta</th><th scope="col">P.Lista</th></tr></thead>'; |
|
|
|
|
|
|
|
|
var detallesList ='<div class="col-12 salir"> <table class="table table-sm col-sm-12 col-md-12 col-mb-12 col-lg-12 text-center "><thead class="thead-dark"><tr><th scope="col">cod art</th><th scope="col">Descripcion</th><th scope="col">Cant</th><th scope="col">UxB</th><th scope="col">Precio</th><th scope="col">Total Item</th><th scope="col">Renta</th><th scope="col">P.Lista</th></th></thead>'; |
|
|
for (var i = 0; i < response.document.pedido.detped.length ; i++) |
|
|
for (var i = 0; i < response.document.pedido.detped.length ; i++) |
|
|
{ |
|
|
{ |
|
|
detallesList +='<tbody><tr><th scope="row"><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_art+'</small></th><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_des+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_cant+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_udad+'</small></td><td><small style="color: #6c757d;">$'+response.document.pedido.detped[i].dep_prec+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].totitem+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].rentaitem+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_plista+'</small></td></tr>'; |
|
|
detallesList +='<tbody><tr><th scope="row"><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_art+'</small></th><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_des+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_cant+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_udad+'</small></td><td><small style="color: #6c757d;">$'+response.document.pedido.detped[i].dep_prec+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].totitem+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].rentaitem+'</small></td><td><small style="color: #6c757d;">'+response.document.pedido.detped[i].dep_plista+'</small></td></tr>'; |
|
@ -74,10 +74,13 @@ function crear_detalles_pedido(nro,ido){ |
|
|
detallesList += '</div><hr>';*/ |
|
|
detallesList += '</div><hr>';*/ |
|
|
} |
|
|
} |
|
|
detallesList+='</tbody></table >'; |
|
|
detallesList+='</tbody></table >'; |
|
|
detallesList += '<button type="button" id='+response.document.pedido.cap_ped+' class="btn btn-outline-success btn-block col-sm-2 font-weight-bold my-4 alta">Confirmar pedido</button></td></tr>'; |
|
|
|
|
|
|
|
|
detallesList += '<button type="button" id='+response.document.pedido.cap_ped+' class="btn btn-primary btn-lg btn-block alta">Confirmar Pedido</button></div>'; |
|
|
|
|
|
|
|
|
ido.parent().parent().after(detallesList); |
|
|
ido.parent().parent().after(detallesList); |
|
|
|
|
|
|
|
|
|
|
|
$('#tplista').text("total precio lista :"+response.document.pedido.tplista); |
|
|
|
|
|
$('#trenta').text(" Total renta obtenida :"+response.document.pedido.trenta); |
|
|
|
|
|
$('#difpre').text("Diferencia de total precio lista :"+response.document.pedido.difpre); |
|
|
$( ".alta" ).click(function() { |
|
|
$( ".alta" ).click(function() { |
|
|
//var suc = document.getElementById("sucursal").value;
|
|
|
//var suc = document.getElementById("sucursal").value;
|
|
|
var ped = $(this).attr("id"); |
|
|
var ped = $(this).attr("id"); |
|
@ -116,10 +119,9 @@ function llenar_lista_pedido() |
|
|
data: parametros, |
|
|
data: parametros, |
|
|
dataType: 'json', |
|
|
dataType: 'json', |
|
|
success: function(response){ |
|
|
success: function(response){ |
|
|
|
|
|
|
|
|
for (var i = 0; i < response.CLIENTE.length ; i++){ |
|
|
for (var i = 0; i < response.CLIENTE.length ; i++){ |
|
|
var math=parseInt(response.CLIENTE[i].total)/100; |
|
|
var math=parseInt(response.CLIENTE[i].total)/100; |
|
|
$('.lista-pedido').append("<tr class='consulta' id="+response.CLIENTE[i].pedido+"><th class='border-right py-4' scope='row'>"+response.CLIENTE[i].pedido+"</th><td class='border-right py-4'>"+response.CLIENTE[i].cliente+" "+response.CLIENTE[i].nomcli+"</td><td class='border-right py-4'>$"+parseInt(response.CLIENTE[i].total)/100+"</td><td class='py-4 text-center'><div id=hide_"+response.CLIENTE[i].pedido+" class='oculto'><span class='fa-stack fa-lg'><i class='fa fa-circle fa-stack-2x'></i><i class='fa fa-plus fa-stack-1x fa-inverse'></i></span></div></td></tr>"); |
|
|
|
|
|
|
|
|
$('.lista-pedido').append("<li class='col-sm-12 col-md-12 col-mb-12 col-lg-12 text-center list-group-item list-group-item-secondary consulta' style='border: 3px solid ;' id="+response.CLIENTE[i].pedido+" ><div> Pedido nª : <p style='display: inline;' id='ped_"+response.CLIENTE[i].pedido+"'>"+response.CLIENTE[i].pedido+"</p> CLIENTE : <p style='display: inline;'id='numcli_"+response.CLIENTE[i].pedido+"'>"+response.CLIENTE[i].cliente+" "+response.CLIENTE[i].nomcli+"</p > Total:$ <p style='display: inline;' id='total_"+response.CLIENTE[i].pedido+"'>"+parseInt(response.CLIENTE[i].total)/100+"</p></div><br><div id=hide_"+response.CLIENTE[i].pedido+" class='oculto'><u>ver mas</u></div></li><br>"); |
|
|
} |
|
|
} |
|
|
$(".oculto").click(function() { |
|
|
$(".oculto").click(function() { |
|
|
|
|
|
|
|
@ -138,6 +140,8 @@ function llenar_lista_pedido() |
|
|
|
|
|
|
|
|
$(".consulta").click(function() { |
|
|
$(".consulta").click(function() { |
|
|
var oID = $(this).attr("id"); |
|
|
var oID = $(this).attr("id"); |
|
|
|
|
|
$(".consulta").removeClass("border-success"); |
|
|
|
|
|
$( '#'+oID+'' ).addClass( "border-success" ); |
|
|
|
|
|
|
|
|
v_ped="ped_"+oID; |
|
|
v_ped="ped_"+oID; |
|
|
v_numcli="numcli_"+oID; |
|
|
v_numcli="numcli_"+oID; |
|
@ -149,9 +153,10 @@ function llenar_lista_pedido() |
|
|
var total = $('#'+v_total+'').text(); |
|
|
var total = $('#'+v_total+'').text(); |
|
|
$('#pedido').text("#"+ped); |
|
|
$('#pedido').text("#"+ped); |
|
|
$('#cliente').text("Cliente: "+n_cli); |
|
|
$('#cliente').text("Cliente: "+n_cli); |
|
|
$('#total').text("Total: $"+total); |
|
|
|
|
|
console.log(ped); |
|
|
|
|
|
console.log(v_nomcli); |
|
|
|
|
|
|
|
|
$('#total').text("Total $ :"+total); |
|
|
|
|
|
$('#tplista').text("total precio lista :"+tplista); |
|
|
|
|
|
$('#trenta').text(" Total renta obtenida :"+trenta); |
|
|
|
|
|
$('#difpre').text("Diferencia de total precio lista :"+difpre); |
|
|
// "PVE_" + "Suc" + <"+suc+"> + "_" + <Tipo Comp> + <Operacion> + "_" + <Nro.Comprobante> + ".pdf"
|
|
|
// "PVE_" + "Suc" + <"+suc+"> + "_" + <Tipo Comp> + <Operacion> + "_" + <Nro.Comprobante> + ".pdf"
|
|
|
//var _href = $('#descarga').attr("href");
|
|
|
//var _href = $('#descarga').attr("href");
|
|
|
$('#descarga').attr("href",'../pdf/PVE_Suc'+suc+'_PE40_'+ped+'.pdf'); |
|
|
$('#descarga').attr("href",'../pdf/PVE_Suc'+suc+'_PE40_'+ped+'.pdf'); |
|
@ -169,7 +174,7 @@ function llenar_lista_pedido() |
|
|
$(document).ready(function() { |
|
|
$(document).ready(function() { |
|
|
$("#myNavy").removeClass("invisible"); |
|
|
$("#myNavy").removeClass("invisible"); |
|
|
$("#myNavy").hide(); |
|
|
$("#myNavy").hide(); |
|
|
//llenar_lista_pedido();
|
|
|
|
|
|
|
|
|
llenar_lista_pedido(); |
|
|
$("#sucursal").change(function() { |
|
|
$("#sucursal").change(function() { |
|
|
llenar_lista_pedido(); |
|
|
llenar_lista_pedido(); |
|
|
|
|
|
|
|
|