Skip to content

Commit

Permalink
Merge pull request #65 from TheSpectroMx/master
Browse files Browse the repository at this point in the history
Actualización en el MetadataExtractor
  • Loading branch information
eclipxe13 authored Aug 6, 2022
2 parents 0f94918 + d6c42b2 commit e628dda
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr

No hay cambios no liberados, si existen, deben aparecer aquí.

## Versión 3.2.0

### Agregar *Motivo de cancelación* y *Folio de sustitución*

Se agrega la lectura de *Motivo de cancelación* (`motivoCancelacion`) y *Folio de sustitución* (`folioSustitucion`) a `Metadata`. Así como la extracción de estos datos en `MetadataExtractor`.
Gracias `@TheSpectroMx`.

## Versión 3.1.2

### Filtrado de recursos incorrecto
Expand Down
2 changes: 2 additions & 0 deletions src/Internal/MetadataExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public function defaultFieldsCaptions(): array
'estatusProcesoCancelacion' => 'Estatus de Proceso de Cancelación',
'fechaProcesoCancelacion' => 'Fecha de Proceso de Cancelación',
'rfcACuentaTerceros' => 'RFC a cuenta de terceros',
'motivoCancelacion' => 'Motivo',
'folioSustitucion' => 'Folio de Sustitución',
];
}

Expand Down
2 changes: 2 additions & 0 deletions src/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* @property-read string $estatusProcesoCancelacion Estatus de Proceso de Cancelación
* @property-read string $fechaProcesoCancelacion Fecha de Proceso de Cancelación
* @property-read string $rfcACuentaTerceros RFC a cuenta de terceros
* @property-read string $motivoCancelacion Motivo de cancelación
* @property-read string $folioSustitucion UUID del CFDI con el que es sustituido
*
* @see MetadataExtractor::defaultFieldsCaptions()
* @implements IteratorAggregate<string, string>
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/Internal/MetadataExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ public function testUsingFakeInput(): void
'estatusProcesoCancelacion' => '',
'fechaProcesoCancelacion' => '',
'rfcACuentaTerceros' => 'AAA991231AAA',
'motivoCancelacion' => '',
'folioSustitucion' => '',
'urlXml' => '', // the data is not included on test file
'urlPdf' => '',
'urlCancelRequest' => '',
Expand Down Expand Up @@ -220,6 +222,8 @@ public function testExtractUsingSampleWithOneUuid(): void
'estatusProcesoCancelacion' => '',
'fechaProcesoCancelacion' => '',
'rfcACuentaTerceros' => 'ABC010101AAA',
'motivoCancelacion' => '',
'folioSustitucion' => '',
],
];

Expand Down
8 changes: 8 additions & 0 deletions tests/_files/fake-to-extract-metadata-missing-uuid.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<th><span>Estatus de Proceso de Cancelación</span></th>
<th><span>Fecha de Proceso de Cancelación</span></th>
<th><span>RFC a cuenta de terceros</span></th>
<th><span>Motivo</span></th>
<th><span>Folio de Sustitución</span></th>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -36,6 +38,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -54,6 +58,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -72,6 +78,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
</table>
</body>
Expand Down
4 changes: 4 additions & 0 deletions tests/_files/fake-to-extract-metadata-one-cfdi.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<th><span>Estatus de Proceso de Cancelación</span></th>
<th><span>Fecha de Proceso de Cancelación</span></th>
<th><span>RFC a cuenta de terceros</span></th>
<th><span>Motivo</span></th>
<th><span>Folio de Sustitución</span></th>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -36,6 +38,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;">AAA991231AAA</span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
</table>
</body>
Expand Down
22 changes: 22 additions & 0 deletions tests/_files/fake-to-extract-metadata-ten-cfdi.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<th><span>Estatus de Proceso de Cancelación</span></th>
<th><span>Fecha de Proceso de Cancelación</span></th>
<th><span>RFC a cuenta de terceros</span></th>
<th><span>Motivo</span></th>
<th><span>Folio de Sustitución</span></th>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -36,6 +38,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -54,6 +58,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -72,6 +78,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -90,6 +98,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -108,6 +118,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -126,6 +138,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -144,6 +158,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -161,6 +177,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;">Vigente</span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -179,6 +197,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td style="width:14.2%;">...</td>
Expand All @@ -197,6 +217,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
</table>
</body>
Expand Down
2 changes: 2 additions & 0 deletions tests/_files/fake-to-extract-metadata-zero-cfdi.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<th><span>Estatus de Proceso de Cancelación</span></th>
<th><span>Fecha de Proceso de Cancelación</span></th>
<th><span>RFC a cuenta de terceros</span></th>
<th><span>Motivo</span></th>
<th><span>Folio de Sustitución</span></th>
</tr>
</table>
</body>
Expand Down
8 changes: 8 additions & 0 deletions tests/_files/sample-to-extract-metadata-one-cfdi.html
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@
<th>
<span style="width: 200px;">RFC a cuenta de terceros</span>
</th>
<th>
<span style="width: 200px;">Motivo</span>
</th>
<th>
<span style="width: 200px;">Folio de Sustitución</span>
</th>
</tr>
<tr>
<td><div style="width:150px; display:block;text-align:center;vertical-align:middle; position: relative;"><table>
Expand Down Expand Up @@ -790,6 +796,8 @@
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:200px;"> </span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;">ABC010101AAA</span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
<td style="WORD-BREAK:BREAK-ALL;"><span style="display:inline-block;width:240px;"></span></td>
</tr>
<tr>
<td>
Expand Down

0 comments on commit e628dda

Please sign in to comment.