Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.facturardetalles').on( 'click', function () {
- var pedido_id = document.getElementById("facturaid").value;
- var cliente = document.getElementById("nombre").value;
- $.post( 'backend/ajax/punto_venta_generar_pdf.php', { pedido_id:pedido_id,cliente:cliente })
- .done(function( data ) {
- $('#facaca').html('');
- $('#facaca').prepend(data);
- setTimeout(function() {
- var fecha = $(".fecha").val();
- var total = $(".totals").val();
- var doc = new jsPDF();
- doc.centertext("LIBRERIA MARLENE - CAXARAVILLE 573 - GONZALEZ CATAN",{align: "center"},1,20);
- doc.centertext("FECHA GENERADO: " + fecha,{align: "center"},1,30);
- doc.centertext("TOTAL: $" + total,{align: "center"},1,40);
- doc.autoTable({
- startY: doc.pageCount > 1? doc.autoTableEndPosY() + 20 : 50,
- columnStyles: {
- 0: {cellWidth: '100'}
- },
- theme: 'grid',
- html: '#facturaciones'
- });
- var nombre = "Factura - " + cliente + " - " + fecha;
- doc.save(nombre + '.pdf');
- $('#finalizar_form')[0].reset();
- $('#finalizar_modal').modal('hide');
- window.location.href = "index.php?view=punto_venta";
- }, 500);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement