Skip to content

Commit

Permalink
Se ajustan campos y errores en base a la revision de Jean para el pul…
Browse files Browse the repository at this point in the history
…l request
  • Loading branch information
sayerpro committed Apr 8, 2024
1 parent 4d2a93d commit 1af9b38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions api/contrib/check/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function libxml_display_errors()
}

$tipoDoc = params_get('tipoDocumento');
$tipos = array("FE", "ND", "NC", "TE", "CCE", "CPCE", "RCE","FEC");
$tipos = array("FE", "ND", "NC", "TE", "CCE", "CPCE", "RCE","FEC, FEE");

grace_debug($tipoDoc);
if (in_array($tipoDoc, $tipos))
Expand All @@ -69,7 +69,7 @@ function libxml_display_errors()
{
case 'FE': //Factura Electronica
{
// Enable user error handling
// Enable user error handling
libxml_use_internal_errors(true);

$xml = new DOMDocument();
Expand Down Expand Up @@ -103,6 +103,9 @@ function libxml_display_errors()
case 'FEC': // Factura Electronica de Compra
$tipoDocumento = "08";
break;
case 'FEE': // Factura Electronica de Exportación
$tipoDocumento = "09";
break;
default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions api/contrib/genXML/genXML.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* * ************************************************** */
/* Constantes de validacion */
/* * ************************************************** */
const TIPODOCREFVALUES = array('01','02','03','04','05','06','07','08','99');
const TIPODOCREFVALUES = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '99');
const CODIDOREFVALUES = array('01','02','04','05','99');
const CODIGOACTIVIDADSIZE = 6;
const EMISORNOMBREMAXSIZE = 100;
Expand Down Expand Up @@ -3031,7 +3031,7 @@ function genXMLFee()
grace_debug(params_get("otrosCargos"));

if ( isset($medioPago) && $medioPago != "")
grace_debug(params_get("medios_pago"));
grace_debug(params_get("medio_pago"));

// Validate string sizes
$codigoActividad = str_pad($codigoActividad, 6, "0", STR_PAD_LEFT);
Expand Down
5 changes: 5 additions & 0 deletions api/contrib/genXML/xmlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ function genXML()
$headerDoc='<FacturaElectronicaCompra xmlns="https://cdn.comprobanteselectronicos.go.cr/xml-schemas/v4.3/facturaElectronicaCompra" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ';
$footerDoc='</FacturaElectronicaCompra>';
}
elseif ($tipoDocumento == 'FEE')
{
$headerDoc='<FacturaElectronicaExportacion xmlns="https://cdn.comprobanteselectronicos.go.cr/xml-schemas/v4.3/facturaElectronicaExportacion" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ';
$footerDoc='</FacturaElectronicaExportacion>';
}

$finalXML= $headerDoc . $xmltext . $footerDoc;
return $finalXML;
Expand Down

0 comments on commit 1af9b38

Please sign in to comment.