����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.138.101.1 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/www/html/app6/core/app/view/ |
Upload File : |
<?php //inicio de if principal if ( isset($_POST["id_sales"]) || isset($_GET["id"]) ): //VALIDAMOS COMO SE RECIBE EL ID DE LA VENTA if(isset($_GET["id"])) { $sale_id= $_GET["id"]; }else{ $sale_id= $_POST["id_sales"]; } //obtenemos el sell_id desde sale_id $sell = SellData::getByc($sale_id); $sell_id = $sell->id; //verificamos si es a credito la compra if (isset($_GET["credito"])): $sell = SellData::getByIdF($sell_id); if($sell->person_id!=""){ $client = $sell->getPerson(); $ar_cliente = array( "id" => $client->id, "no" => $client->no, "name" => $client->name, "lastname" => $client->lastname, "localidad" => $client->localidad, ); $_SESSION['ar_cliente'] = $ar_cliente; } print "<script>window.location='index.php?view=makepayment&id=$client->id&credito=".$_GET["credito"]."&sell=".$sell_id."';</script>" endif; ?> <?php //empieza todo el ticket $cambiarprecio_val = ConfigurationData::getByPreffix("cambiarprecio_val")->val; ?> <form class="form-horizontal" method="post" enctype="multipart/form-data" id="factura" action="#" role="form"> <section class="content"> <?php //id de la venta?> <input type="hidden" name="sell_id" value="<?php echo $sell_id; ?>"> <?php //Menu derecho?> <div class="btn-group pull-right"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-download"></i> Ticket <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="report/onesell-word.php?id=<?php echo $sell_id;?>">Word 2007 (.docx)</a></li> <li><a onclick="thePDF()" id="makepdf" class=""><i class="fa fa-download"></i> Descargar PDF</a> <li><a href="report/factura_ticket-xlsx.php?sale_id=<?php echo $sale_id;?>&id=<?php echo $sell_id;?>">Generar Fatura</a></li> </ul> </div> <?php //empieza la impresion del ticket?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> function imprimir() { if (window.print) { window.print(); } else { alert("La función de impresion no esta soportada por su navegador."); } } </script> </head> <body onload="imprimir();"> <?php //si existe venta va a imprimir ticket if(isset($sell_id) && $sell_id!=""):?> <?php //datos del encabezado $sell = SellData::getById($sell_id); //t_sale $sale = SellData::getByIdSale($sale_id); $operations = OperationData::getAllProductsBySellId($sale_id); $total = 0; $settingsRFC = ConfigurationData::getByIdRFC(); $settings2 = ConfigurationData::getById1(); $settingsEmisor = ConfigurationData::getByIdEmisor(); $settingsCalle = ConfigurationData::getByIdCalle(); $settingsInt = ConfigurationData::getByIdInt(); $settingsExt = ConfigurationData::getByIdExt(); $settingsColonia = ConfigurationData::getByIdColonia(); $settingsCity = ConfigurationData::getByIdCity(); $settingsCP = ConfigurationData::getByIdCp(); ?> <?php //encabezado de ticket?> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td align="center"><img src="storage/products/logo.png" width="75" height="75"></td> </tr> <tr> <td colspan="2" align="center"><?php echo $settings2->val;?></td> </tr> <tr> <td colspan="2" align="center"><?php echo $settingsCalle->val; echo " "; echo $settingsInt->val; echo " "; echo $settingsExt->val; echo " "; echo $settingsColonia->val;?> </td> </tr> </table> </div> </div> </div> <?php foreach($sell as $sell2){ ?> <?php } ?> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <?php $time = time(); ?> <tr> <th colspan="1" >RFC:</th> <th colspan="4" ><input align="center" class="form-control" name="rfc" value="AAAI800508K2A" placeholder="Ingrese RFC para Factura Rapida"></input></th> </tr> <tr> <td><b> Fecha Captura: </b></td> <td colspan="2" align="left" id="created_at"><?php echo $sell2->created_at ; ?></td> <td colspan="2" align="right" id="cajero">Cajero: </td> <td colspan="2" align="center" id="cajero"><?php echo $sale->id_user ; ?> </td> </tr> <tr> <td><b> Fecha Venta: </b></td> <td colspan="2" align="left" id="date_sale"><?php echo $sale->sale_date ; ?></td> <td colspan="2" align="right" id="ticket">Ticket: </td> <td colspan="2" align="left" id="ticket"><b><?php echo $sell2->id ; ?></b> </td> </tr> </table> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td style="width:10px;">Cant</td> <th>Descripcion</th> </tr> <tr> <?php /**/ $prod = array(); //$_SESSION['arreglo'] = array(); foreach($operations as $operation){ $product = $operation->getProduct(); $prod[] = array( "cantidad" => $operation->qty, "name" => $product->item_name, "unidad" => "NA", "id" => $product->id_item, "valorunitario" => $product->price, "importe" => $product->price * $operation->qty, "claveunidad" => $product->unit, ); ?> <td><b><?php echo $operation->qty ; ?></b></td> <td colspan="2" align="left"><?php echo $product->item_name ;?></td> <td align="left">$ <?php echo number_format($operation->price,2,".",",");$total+=$operation->qty*$operation->price;?></td> </tr> <?php } $_SESSION['prod'] = $prod; ?> </table> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td>Subtotal total :</td> <td align="right"><u><b>$ <?php echo number_format($total,2,'.',','); ?></b></u></td> </tr> <tr> <td>Importe Recibido(-):</td> <td align="right">$ <?php echo number_format($sell2->cash,2,'.',','); ?></td> </tr> <?php if($sell2->p_id != 4): ?> <tr> <td>Descuento(+):</td> <td align="right">$ <?php echo number_format($sell2->discount,2,'.',','); ?></td> </tr> <?php endif; ?> <tr> <td>Gran total :</td> <td align="right"><u><b>$ <?php echo number_format($sell2->total,2,'.',','); ?></b></u></td> </tr> <?php $cambio=$sell2->cash-$sell2->total; ?> <?php if($sell2->p_id != 4): ?> <tr> <td>Cambio: </td> <td align="right">$ <?php echo number_format($cambio,2,'.',','); ?></td> </tr> <?php endif; ?> </table> </div> </div> </div> <?php if($sell2->person_id!=""): $credit=PaymentData::sumByClientId($sell2->person_id)->total; ?> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td><h4>Pago Realizado:</h4></td> <td><h4>$ <?php echo number_format($sell2->cash,2,'.',','); ?></h4></td> </tr> <tr> <td><h4>Monto a (CREDITO):</h4></td> <td><h4>$ <?php echo number_format($sell2->discount,2,'.',','); ?></h4></td> </tr> </table> </div> </div> </div> <?php endif;?> <?php endif;?> </body> </html> </section> </form> <?php //si no encuentra sale_id en post else: ?> <?php echo "numero de venta no encontrado!!!"; ?> <?php //fin de if principal endif; ?> <script type="text/javascript"> function thePDF() { var columns = [ // {title: "Reten", dataKey: "reten"}, {title: "Codigo", dataKey: "code"}, {title: "Cantidad", dataKey: "q"}, {title: "Nombre del Producto", dataKey: "product"}, {title: "Precio unitario", dataKey: "pu"}, {title: "Total", dataKey: "total"}, // ... ]; var columns2 = [ // {title: "Reten", dataKey: "reten"}, {title: "", dataKey: "clave"}, {title: "", dataKey: "valor"}, // ... ]; var rows = [ <?php foreach($operations as $operation): $product = $operation->getProduct(); ?> { "code": "<?php echo $product->id; ?>", "q": "<?php echo $operation->q; ?>", "product": "<?php echo $product->name; ?>", "pu": "$ <?php echo number_format($operation->price_out,2,".",","); ?>", "total": "$ <?php echo number_format($operation->q*$operation->price_out,2,".",","); ?>", }, <?php endforeach; ?> ]; var rows2 = [ <?php if($sell->person_id!=""): $person = $sell->getPerson(); ?> { "clave": "Cliente", "valor": "<?php echo $person->name." ".$person->lastname; ?>", }, <?php endif; ?> { "clave": "Atendido por", "valor": "<?php echo $user->name." ".$user->lastname; ?>", }, ]; var rows3 = [ { "clave": "Descuento", "valor": "$ <?php echo number_format($sell->discount,2,'.',',');; ?>", }, { "clave": "Subtotal", "valor": "$ <?php echo number_format($sell->total,2,'.',',');; ?>", }, { "clave": "Total", "valor": "$ <?php echo number_format($sell->total-$sell->discount,2,'.',',');; ?>", }, ]; // Only pt supported (not mm or in) var doc = new jsPDF('p', 'pt'); doc.setFontSize(26); doc.text("NOTA DE VENTA", 40, 65); doc.setFontSize(14); doc.text("Fecha: <?php echo $sell->created_at; ?>", 40, 80); // doc.text("Operador:", 40, 150); // doc.text("Header", 40, 30); // doc.text("Header", 40, 30); doc.autoTable(columns2, rows2, { theme: 'grid', overflow:'linebreak', styles: { fillColor: [100, 100, 100] }, columnStyles: { id: {fillColor: 255} }, margin: {top: 100}, afterPageContent: function(data) { // doc.text("Header", 40, 30); } }); doc.autoTable(columns, rows, { theme: 'grid', overflow:'linebreak', styles: { fillColor: [100, 100, 100] }, columnStyles: { id: {fillColor: 255} }, margin: {top: doc.autoTableEndPosY()+15}, afterPageContent: function(data) { // doc.text("Header", 40, 30); } }); doc.autoTable(columns2, rows2, { theme: 'grid', overflow:'linebreak', styles: { fillColor: [100, 100, 100] }, columnStyles: { id: {fillColor: 255} }, margin: {top: doc.autoTableEndPosY()+15}, afterPageContent: function(data) { doc.text("Header", 40, 30); } }); //doc.setFontsize //img = new Image(); //img.src = "liberacion2.jpg"; //doc.addImage(img, 'JPEG', 40, 10, 610, 100, 'monkey'); // Cache the image using the alias 'monkey' doc.setFontSize(20); doc.setFontSize(12); doc.text("Generado por el Sistema de inventario", 40, doc.autoTableEndPosY()+25); doc.save('sell-<?php echo date("d-m-Y h:i:s",time()); ?>.pdf'); //doc.output("datauri"); } </script> <script> $(document).ready(function(){ // $("#makepdf").trigger("click"); }); </script>