-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se agrega parseador para retencion de comprobante
- Loading branch information
Showing
9 changed files
with
276 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php require_once 'XmlParser.php' ?> | ||
<?php | ||
|
||
class ComprobanteRetencionParser extends XmlParser{ | ||
public function __construct(DOMDocument $dom) | ||
{ | ||
parent::__construct($dom); | ||
} | ||
|
||
public function getInfoCompRetencion(){ | ||
$infoComprobanteContent = [ | ||
'fechaEmision', 'contribuyenteEspecial', | ||
'obligadoContabilidad', 'tipoIdentificacionSujetoRetenido', | ||
'razonSocialSujetoRetenido', 'identificacionSujetoRetenido', | ||
'periodoFiscal' | ||
]; | ||
$infoComprobante = $this->getNode($this->dom, 'infoCompRetencion', 0); | ||
$infoComprobanteData = []; | ||
foreach ($infoComprobanteContent as $content) { | ||
$infoComprobanteData[$content] = $this->getNodeData($infoComprobante, $content, 0); | ||
} | ||
return $infoComprobanteData; | ||
} | ||
|
||
public function getImpuestos(){ | ||
$impuestos = $this->getNode($this->dom, 'impuestos', 0); | ||
$impuesto = $this->getNodes($this->dom, 'impuesto'); | ||
$impuestoHeaders = [ | ||
'codigo', 'codigoRetencion', 'baseImponible', 'porcentajeRetener', | ||
'valorRetenido', 'codDocSustento', 'numDocSustento', 'fechaEmisionDocSustento' | ||
]; | ||
$impuestosContent = []; | ||
foreach ($impuesto as $index => $imp) { | ||
$rowImpuesto = []; | ||
foreach ($impuestoHeaders as $header) { | ||
$rowImpuesto[$header] = $this->getNodeData($imp, $header, 0); | ||
} | ||
$impuestosContent[$index] = $rowImpuesto; | ||
} | ||
return $impuestosContent; | ||
} | ||
|
||
public function getInfoAdicional(){ | ||
$infoAdicional = $this->getNode($this->dom, 'infoAdicional', 0); | ||
$campoAdicional = $this->getNodes($this->dom, 'campoAdicional'); | ||
$detallesContent = []; | ||
foreach ($campoAdicional as $index => $campo) { | ||
$detallesContent[$index] = [ | ||
'name' => $campo->getAttribute('nombre'), | ||
'value' => $campo->nodeValue | ||
|
||
]; | ||
} | ||
return $detallesContent; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.