4.0-187 This package pulls together the Linux kernel nvidia modules for version 5.4.0-187 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-generic* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-187-lowlatency Description-md5: 306e06d4658f2c934bd9f5ef6c9f3bec Description-en: Linux kernel nvidia modules for version 5.4.0-187 This package pulls together the Linux kernel nvidia modules for version 5.4.0-187 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-lowlatency* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-189-generic Description-md5: 5c709843a56c37fd4f3359f7bf9e9adf Description-en: Linux kernel nvidia modules for version 5.4.0-189 This package pulls together the Linux kernel nvidia modules for version 5.4.0-189 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-generic* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-189-lowlatency Description-md5: 45d9c0df9d611db524476a5f10a06e00 Description-en: Linux kernel nvidia modules for version 5.4.0-189 This package pulls together the Linux kernel nvidia modules for version 5.4.0-189 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-lowlatency* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-190-generic Description-md5: ab3102482cc98260af79e2c0799106e0 Description-en: Linux kernel nvidia modules for version 5.4.0-190 This package pulls together the Linux kernel nvidia modules for version 5.4.0-190 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-generic* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-190-lowlatency Description-md5: e11cbc23e894a587744e8d04e58dddf4 Description-en: Linux kernel nvidia modules for version 5.4.0-190 This package pulls together the Linux kernel nvidia modules for version 5.4.0-190 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-lowlatency* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-192-generic Description-md5: 6d079de1e835c39150543d2b73034cc9 Description-en: Linux kernel nvidia modules for version 5.4.0-192 This package pulls together the Linux kernel nvidia modules for version 5.4.0-192 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-generic* meta-packages, which will ensure that upgrades work correctly, and that supporting packages are also installed. Package: linux-modules-nvidia-470-server-5.4.0-192-lowlatency Description-md5: daafb545b8032bd86ebb1ae3ac7b43a7 Description-en: Linux kernel nvidia modules for version 5.4.0-192 This package pulls together the Linux kernel nvidia modules for version 5.4.0-192 with the appropriate signatures. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-nvidia-470-server-lowlatency* meta-packages, whcreateElement("cfdi:Comprobante"); $root = $xml->appendChild($root); $cadena_original='||'; $noatt= array(); #== 10.2 Se crea e inserta el primer nodo donde se declaran los namespaces ====== cargaAtt($root, array("xsi:schemaLocation"=>"http://www.sat.gob.mx/cfd/4 http://www.sat.gob.mx/sitio_internet/cfd/4/cfdv40.xsd", "xmlns:cfdi"=>"http://www.sat.gob.mx/cfd/4", "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance" ) ); #== 10.3 Rutina de integración de nodos ========================================= if($TipPDFGen == 1) { cargaAtt($root, array( "Version"=>"4.0", "Serie"=>$datos_Generales_CFDI["fact_serie"], "Folio"=>$datos_Generales_CFDI["invoiceNumber"], "Fecha"=>date("Y-m-d")."T".date("H:i:s"), "FormaPago"=>utf8_decode($datos_Generales_CFDI["formaDePago"]), "NoCertificado"=>$datos_Generales_CFDI["Certificado_SAT"], "CondicionesDePago"=>$datos_Generales_CFDI["condicionesDePago"], "SubTotal"=>$subTotal, "Descuento"=>number_format($datos_Generales_CFDI["descuento"],2,'.',''), "Moneda"=>$datos_Generales_CFDI["moneda"], "TipoCambio"=>$datos_Generales_CFDI["TipoCambio"], "Total"=>$total, "TipoDeComprobante"=>$datos_Generales_CFDI["fact_tipcompr"], "Exportacion"=>$datos_Generales_CFDI["fact_exportacion"], "MetodoPago"=>utf8_decode($datos_Generales_CFDI["metodoDePago"]), "LugarExpedicion"=>utf8_decode($datos_Generales_CFDI["LugarExpedicion"]) ) ); } else { cargaAtt($root, array( "Version"=>"4.0", "Serie"=>$datos_Generales_CFDI["fact_serie"], "Folio"=>$datos_Generales_CFDI["fact_folio"], "Fecha"=>date("Y-m-d")."T".date("H:i:s"), "FormaPago"=>utf8_decode($datos_Generales_CFDI["formaDePago"]), "NoCertificado"=>$datos_Generales_CFDI["Certificado_SAT"], "CondicionesDePago"=>$datos_Generales_CFDI["condicionesDePago"], "SubTotal"=>$subTotal, "Descuento"=>number_format($datos_Generales_CFDI["descuento"],2,'.',''), "Moneda"=>$datos_Generales_CFDI["moneda"], "TipoCambio"=>$datos_Generales_CFDI["TipoCambio"], "Total"=>$total, "TipoDeComprobante"=>$datos_Generales_CFDI["fact_tipcompr"], "Exportacion"=>$datos_Generales_CFDI["fact_exportacion"], "MetodoPago"=>$datos_Generales_CFDI["metodoDePago"], "LugarExpedicion"=>$datos_Generales_CFDI["LugarExpedicion"] ) ); } // Esta sección se tendrá que revisar if($datos_Documentos_relacionados <> "") { $cfdiRelacionados = $xml->createElement("cfdi:CfdiRelacionados"); $cfdiRelacionados = $root->appendChild($cfdiRelacionados); cargaAtt($cfdiRelacionados, array("TipoRelacion"=>utf8_decode($datos_Generales_CFDI["TipoRelacion"]))); for ($i=0; $i < count($datos_Documentos_relacionados); $i++) { $cfdiRelacionado = $xml->createElement("cfdi:CfdiRelacionado"); $cfdiRelacionado = $cfdiRelacionados->appendChild($cfdiRelacionado); cargaAtt($cfdiRelacionado, array("UUID"=>utf8_decode($datos_Documentos_relacionados[$i]["UUID"]))); } } $emisor = $xml->createElement("cfdi:Emisor"); $emisor = $root->appendChild($emisor); cargaAtt($emisor, array("Rfc"=>utf8_decode($datos_Emisor["emisor_rfc"]), "Nombre"=>utf8_decode($datos_Emisor["emisor_rs"]), "RegimenFiscal"=>utf8_decode($datos_Emisor["emisor_regfis"]) ) ); $RFC_Recep = utf8_decode($datos_Receptor["RFC_Recep"]); if (strlen($RFC_Recep) == 12) { $RFC_Recep = " ".$RFC_Recep; } else { $RFC_Recep = $RFC_Recep; } $receptor = $xml->createElement("cfdi:Receptor"); $receptor = $root->appendChild($receptor); cargaAtt($receptor, array("Rfc"=>$RFC_Recep, "Nombre"=>$datos_Documentos_relacionados["receptor_rs"], "DomicilioFiscalReceptor"=>utf8_decode($datos_Receptor["receptor_cp"]), "RegimenFiscalReceptor"=>utf8_decode($datos_Receptor["receptor_regfis"]), "UsoCFDI"=>utf8_decode($datos_Generales_CFDI["usoCFDI"]) ) ); $conceptos = $xml->createElement("cfdi:Conceptos"); $conceptos = $root->appendChild($conceptos); $isrImpuesto = "001"; $ivaImpuesto = "002"; $lIvaTraslad = false; $lIsrRetenid = false; #== 10.4 Ciclo "for", recopilación de datos de artículos e integración de sus respectivos nodos == $ivaTasaOCuota = 0.160000; $isrTasaOCuota = 0.060000; for ($i=0; $icreateElement("cfdi:Concepto"); $concepto = $conceptos->appendChild($concepto); $sOrdCom = ""; foreach ( $detallesCliente[$i] as $nombre => $hexa ) { if($nombre == "NoIdentificacion") { $sOrdCom = $hexa; } } if($sOrdCom != "") { cargaAtt($concepto, array( "ClaveProdServ"=>utf8_decode($detallesCliente[$i]["claveProd"]), "NoIdentificacion"=>utf8_decode($detallesCliente[$i]["NoIdentificacion"]), "Cantidad"=>$detallesCliente[$i]["cantidad"], "ClaveUnidad"=>utf8_decode($detallesCliente[$i]["unidad"]), "Unidad"=>trim(utf8_decode($detallesCliente[$i]["descUnidad"])), "Descripcion"=>trim(utf8_decode($detallesCliente[$i]["descripcion"])), "ValorUnitario"=>number_format($detallesCliente[$i]["valorUnitario"],2,'.',''), "Importe"=>number_format($detallesCliente[$i]["importe"],2,'.',''), "Descuento"=>number_format($detallesCliente[$i]["descuento"],2,'.',''), "ObjetoImp"=>utf8_decode($detallesCliente[$i]["ObjetoImp"]) ) ); } else { cargaAtt($concepto, array( "ClaveProdServ"=>utf8_decode($detallesCliente[$i]["claveProd"]), "Cantidad"=>$detallesCliente[$i]["cantidad"], "ClaveUnidad"=>utf8_decode($detallesCliente[$i]["unidad"]), "Unidad"=>trim(utf8_decode($detallesCliente[$i]["descUnidad"])), "Descripcion"=>trim(utf8_decode($detallesCliente[$i]["descripcion"])), "ValorUnitario"=>number_format($detallesCliente[$i]["valorUnitario"],2,'.',''), "Importe"=>number_format($detallesCliente[$i]["importe"],2,'.',''), "Descuento"=>number_format($detallesCliente[$i]["descuento"],2,'.',''), "ObjetoImp"=>utf8_decode($detallesCliente[$i]["ObjetoImp"]) ) ); } //if ($abdDatArt[$i]["ivaImporte"] > 0 || $abdDatArt[$i]["isrImporte"] > 0) if($detallesCliente[$i]["ivaImpuesto"] == "002" || $detallesCliente[$i]["isrImpuesto"] == "001") { $impuestos = $xml->createElement("cfdi:Impuestos"); $impuestos = $concepto->appendChild($impuestos); //if ($abdDatArt[$i]["ivaImporte"] > 0) if($detallesCliente[$i]["ivaImpuesto"] == "002") { $lIvaTraslad = true; $Traslados = $xml->createElement("cfdi:Traslados"); $Traslados = $impuestos->appendChild($Traslados); $Traslado = $xml->createElement("cfdi:Traslado"); $Traslado = $Traslados->appendChild($Traslado); $ivaImpuesto = $detallesCliente[$i]["ivaImpuesto"]; cargaAtt($Traslado, array( "Base"=>number_format($detallesCliente[$i]["ivaBase"],2,'.',''), "Impuesto"=>$detallesCliente[$i]["ivaImpuesto"], "TipoFactor"=>$detallesCliente[$i]["ivaTipoFactor"], "TasaOCuota"=>number_format($detallesCliente[$i]["ivaTasaOCuota"],6,'.',''), "Importe"=>number_format($detallesCliente[$i]["ivaImporte"],2,'.','') ) ); $ivaTasaOCuota = $detallesCliente[$i]["ivaTasaOCuota"]; } //if ($abdDatArt[$i]["isrImporte"] > 0) if($detallesCliente[$i]["isrImpuesto"] == "001") { $lIsrRetenid = true; $Retenciones = $xml->createElement("cfdi:Retenciones"); $Retenciones = $impuestos->appendChild($Retenciones); $Retencion = $xml->createElement("cfdi:Retencion"); $Retencion = $Retenciones->appendChild($Retencion); $isrImpuesto = $detallesCliente[$i]["isrImpuesto"]; cargaAtt($Retencion, array( "Base"=>number_format($detallesCliente[$i]["isrBase"],2,'.',''), "Impuesto"=>$detallesCliente[$i]["isrImpuesto"], "TipoFactor"=>$detallesCliente[$i]["isrTipoFactor"], "TasaOCuota"=>number_format($detallesCliente[$i]["isrTasaOCuota"],6,'.',''), "Importe"=>number_format($detallesCliente[$i]["isrImporte"],2,'.','') ) ); $isrTasaOCuota = $detallesCliente[$i]["isrTasaOCuota"]; } } } //if ($totalImpuestosTrasladados > 0 || $totalImpuestosRetenidos > 0) if ($lIvaTraslad == true || $lIsrRetenid == true) { $Impuestos = $xml->createElement("cfdi:Impuestos"); $Impuestos = $root->appendChild($Impuestos); //if ($totalImpuestosRetenidos > 0) if ($lIsrRetenid == true) { $Retenciones = $xml->createElement("cfdi:Retenciones"); $Retenciones = $Impuestos->appendChild($Retenciones); $Retencion = $xml->createElement("cfdi:Retencion"); $Retencion = $Retenciones->appendChild($Retencion); cargaAtt($Retencion, array( "Impuesto"=>$isrImpuesto, "Importe"=>number_format($totalImpuestosRetenidos,2,'.','') ) ); cargaAtt($Impuestos, array( "TotalImpuestosRetenidos"=>number_format($totalImpuestosRetenidos,2,'.','') ) ); } //if ($totalImpuestosTrasladados > 0) if ($lIvaTraslad == true) { $Traslados = $xml->createElement("cfdi:Traslados"); $Traslados = $Impuestos->appendChild($Traslados); $Traslado = $xml->createElement("cfdi:Traslado"); $Traslado = $Traslados->appendChild($Traslado); cargaAtt($Traslado, array( "Base"=>number_format($subTotTraslados,2,'.',''), "Impuesto"=>$ivaImpuesto, "TipoFactor"=>"Tasa", "TasaOCuota"=>number_format($ivaTasaOCuota,6,'.',''), "Importe"=>number_format($totalImpuestosTrasladados,2,'.','') ) ); cargaAtt($Impuestos, array( "TotalImpuestosTrasladados"=>number_format($totalImpuestosTrasladados,2,'.','') ) ); } } $complemento = $xml->createElement("cfdi:Complemento"); $complemento = $root->appendChild($complemento); #== 10.7 Termina de conformarse la "Cadena original" con doble || $cadena_original .= "|"; #== 10.8 Proceso para obtener el sello digital del archivo .pem.key ========= $keyid = openssl_get_privatekey(file_get_contents("archs_pem/".$datos_Generales_CFDI["Archivo_KEY"])); openssl_sign($cadena_original, $crypttext, $keyid, OPENSSL_ALGO_SHA256); openssl_free_key($keyid); #== 10.9 Se convierte la cadena digital a Base 64 =========================== $sello = base64_encode($crypttext); #== 10.10 Proceso para extraer el certificado del sello digital ================== $file = "archs_pem/".$datos_Generales_CFDI["Archivo_CER"]; // Ruta al archivo $datos = file($file); $certificado = ""; $carga=false; for ($i=0; $isetAttribute("Sello", $sello); $root->setAttribute("Certificado", $certificado); # Certificado en formato base64 #== Fin de la integración de nodos ========================================= #=== 10.12 Se guarda el archivo .XML antes de ser timbrado ======================= $cfdi = $xml->saveXML(); $xml->formatOutput = true; $xml->save("archs_pem/"."PreCFDI-33_".$datos_Generales_CFDI["fact_serie"].$datos_Generales_CFDI["fact_folio"].".xml"); unset($xml); #=== 10.13 Se dan permisos de escritura al archivo .xml. ========================= chmod("archs_pem/"."PreCFDI-33_".$datos_Generales_CFDI["fact_serie"].$datos_Generales_CFDI["fact_folio"].".xml", 0777); return $cfdi; } catch (Exception $e) { echo 'Error: ' . $e->getMessage(); } } function cargaAtt(&$nodo, $attr){ global $xml, $cadena_original; $quitar = array('sello'=>1,'noCertificado'=>1,'certificado'=>1); foreach ($attr as $key => $val){ $val = preg_replace('/\s\s+/', ' ', $val); $val = trim($val); if (strlen($val)>0){ $val = utf8_encode(str_replace("|","/",$val)); $nodo->setAttribute($key,$val); if (!isset($quitar[$key])) if (substr($key,0,3) != "xml" && substr($key,0,4) != "xsi:") $cadena_original .= $val . "|"; } } } function cargaAttNodo(&$nodo, $attr){ global $xmldoc; foreach ($attr as $key => $val){ $val = preg_replace('/\s\s+/', ' ', $val); $val = trim($val); if (strlen($val)>0){ $val = utf8_encode(str_replace("|","/",$val)); $nodo->setAttribute($key,$val); } } } ?>