-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Carta Porte v20 Catalogs, thanks @G4g0
- Loading branch information
Showing
86 changed files
with
6,112 additions
and
78 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
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
Large diffs are not rendered by default.
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
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
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
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,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DateDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class AutorizacionesNaviero extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = [ | ||
'Número de autorización', | ||
'Inicio de vigencia', | ||
'Fin de vigencia', | ||
]; | ||
$headers = $csv->readLine(); | ||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_autorizaciones_naviero', new DataFields([ | ||
new TextDataField('id'), | ||
new DateDataField('vigencia_desde'), | ||
new DateDataField('vigencia_hasta'), | ||
])); | ||
} | ||
} |
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,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DateDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class ClavesUnidades extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = [ | ||
'Clave unidad', | ||
'Nombre', | ||
'Descripción', | ||
'Nota', | ||
'Fecha de inicio de vigencia', | ||
'Fecha de fin de vigencia', | ||
'Símbolo', | ||
'Bandera', | ||
]; | ||
$headers = $csv->readLine(); | ||
|
||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_claves_unidades', new DataFields([ | ||
new TextDataField('id'), | ||
new TextDataField('texto'), | ||
new TextDataField('descripcion'), | ||
new TextDataField('nota'), | ||
new DateDataField('vigencia_desde'), | ||
new DateDataField('vigencia_hasta'), | ||
new TextDataField('simbolo'), | ||
new TextDataField('bandera'), | ||
])); | ||
} | ||
} |
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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DateDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class CodigosTransporteAereo extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = [ | ||
'Clave identificación', | ||
'Nacionalidad', | ||
'Nombre de la aerolínea', | ||
'Designador OACI', | ||
'Fecha de inicio de vigencia', | ||
'Fecha de fin de vigencia', | ||
]; | ||
$headers = $csv->readLine(); | ||
|
||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_codigos_transporte_aereo', new DataFields([ | ||
new TextDataField('id'), | ||
new TextDataField('nacionalidad'), | ||
new TextDataField('texto'), | ||
new TextDataField('designador_oaci'), | ||
new DateDataField('vigencia_desde'), | ||
new DateDataField('vigencia_hasta'), | ||
])); | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\PaddingDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class Colonias extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = ['c_Colonia', 'c_CodigoPostal', 'Nombre del asentamiento']; | ||
$headers = $csv->readLine(); | ||
|
||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_colonias', new DataFields([ | ||
new PaddingDataField('colonia', '0', 4), | ||
new PaddingDataField('codigo_postal', '0', 5), | ||
new TextDataField('texto'), | ||
]), ['colonia', 'codigo_postal']); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/Importers/Ccp20/Injectors/ConfiguracionesAutotransporte.php
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,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DateDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\IntegerDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class ConfiguracionesAutotransporte extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = [ | ||
'Clave nomenclatura', | ||
'Descripción', | ||
'Número de ejes', | ||
'Número de llantas', | ||
'Remolque', | ||
'Fecha de inicio de vigencia', | ||
'Fecha de fin de vigencia', | ||
]; | ||
$headers = $csv->readLine(); | ||
|
||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_configuraciones_autotransporte', new DataFields([ | ||
new TextDataField('id'), | ||
new TextDataField('texto'), | ||
new IntegerDataField('numero_de_ejes'), | ||
new IntegerDataField('numero_de_llantas'), | ||
new TextDataField('remolque'), // 1 | 1,0 | 0 | ||
new DateDataField('vigencia_desde'), | ||
new DateDataField('vigencia_hasta'), | ||
])); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/Importers/Ccp20/Injectors/ConfiguracionesMaritimas.php
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,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpCfdi\SatCatalogosPopulate\Importers\Ccp20\Injectors; | ||
|
||
use PhpCfdi\SatCatalogosPopulate\AbstractCsvInjector; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataFields; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DataTable; | ||
use PhpCfdi\SatCatalogosPopulate\Database\DateDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Database\TextDataField; | ||
use PhpCfdi\SatCatalogosPopulate\Utils\CsvFile; | ||
use RuntimeException; | ||
|
||
class ConfiguracionesMaritimas extends AbstractCsvInjector | ||
{ | ||
public function checkHeaders(CsvFile $csv): void | ||
{ | ||
$csv->move(3); | ||
$expected = [ | ||
'Clave configuración marítima', | ||
'Descripción', | ||
'Fecha de inicio de vigencia', | ||
'Fecha de fin de vigencia', | ||
]; | ||
$headers = $csv->readLine(); | ||
|
||
if ($expected !== $headers) { | ||
throw new RuntimeException("The headers did not match on file {$this->sourceFile()}"); | ||
} | ||
|
||
$csv->next(); | ||
} | ||
|
||
public function dataTable(): DataTable | ||
{ | ||
return new DataTable('ccp_20_configuraciones_maritimas', new DataFields([ | ||
new TextDataField('id'), | ||
new TextDataField('texto'), | ||
new DateDataField('vigencia_desde'), | ||
new DateDataField('vigencia_hasta'), | ||
])); | ||
} | ||
} |
Oops, something went wrong.