Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Se agregan especificaciones #108

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/composer.lock
/node_modules
/package-lock.json

.DS_Store
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"php-namespace": "CfdiUtils\\Elements\\ConsumoDeCombustibles11",
"prefix": "consumodecombustibles11",
"xml-namespace": "http://www.sat.gob.mx/ConsumoDeCombustibles11",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/consumodecombustibles/consumodeCombustibles11.xsd",
"version-attribute": "version",
"version-value": "1.1",
"root-element": "ConsumoDeCombustibles",
"structure": {
"Conceptos": {
"ConceptoConsumoDeCombustibles": {
"multiple": true,
"Determinados": {
"Determinado": {}
}
}
}
}
}
11 changes: 11 additions & 0 deletions development/ElementsMaker/specifications/Donatarias11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"php-namespace": "CfdiUtils\\Elements\\Donatarias11",
"prefix": "donat",
"xml-namespace": "http://www.sat.gob.mx/donat",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/donat/donat11.xsd",
"version-attribute": "version",
"version-value": "1.1",
"root-element": "Donatarias",
"structure": {
}
}
11 changes: 11 additions & 0 deletions development/ElementsMaker/specifications/Iedu10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"php-namespace": "CfdiUtils\\Elements\\Iedu10",
"prefix": "iedu",
"xml-namespace": "http://www.sat.gob.mx/iedu",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/iedu/iedu.xsd",
"version-attribute": "version",
"version-value": "1.0",
"root-element": "InstEducativas",
"structure": {
}
}
11 changes: 11 additions & 0 deletions development/ElementsMaker/specifications/Ine11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"php-namespace": "CfdiUtils\\Elements\\Ine11",
"prefix": "ine",
"xml-namespace": "http://www.sat.gob.mx/ine",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/ine/ine11.xsd",
"version-attribute": "Version",
"version-value": "1.1",
"root-element": "Ine",
"structure": {
}
}
14 changes: 14 additions & 0 deletions development/ElementsMaker/specifications/LeyendasFiscales10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"php-namespace": "CfdiUtils\\Elements\\LeyendasFiscales10",
"prefix": "leyendasFisc",
"xml-namespace": "http://www.sat.gob.mx/leyendasFiscales",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/leyendasFiscales/leyendasFisc.xsd",
"version-attribute": "version",
"version-value": "1.0",
"root-element": "LeyendasFiscales",
"structure": {
"Leyenda": {
"multiple": true
}
}
}
22 changes: 22 additions & 0 deletions development/ElementsMaker/specifications/NotariosPublicos10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"php-namespace": "CfdiUtils\\Elements\\NotariosPublicos10",
"prefix": "notariospublicos",
"xml-namespace": "http://www.sat.gob.mx/notariospublicos",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/notariospublicos/notariospublicos.xsd",
"version-attribute": "Version",
"version-value": "1.0",
"root-element": "NotariosPublicos",
"structure": {
"DescInmuebles": {
"DescInmueble": {}
},
"DatosOperacion": {},
"DatosNotario": {},
"DatosEnajenante": {
"DatosUnEnajenante": {}
},
"DatosAdquiriente": {
"DatosUnAdquiriente": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"php-namespace": "CfdiUtils\\Elements\\ParcialesConstruccion10",
"prefix": "servicioparcial",
"xml-namespace": "http://www.sat.gob.mx/implocal",
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/implocal/implocal.xsd",
"version-attribute": "Version",
"version-value": "1.0",
"root-element": "ParcialesConstruccion",
"structure": {
"Inmueble": {
}
}
}
25 changes: 25 additions & 0 deletions development/maker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Usage example:
# Need composer install on the main project before
# Omit extension .json in the arg
# sh maker.sh Donatarias11
# sh maker.sh ConsumoDeCombustibles11

nameFile=$1
mainPath=$(pwd)
dirPath=$(dirname $mainPath)
if [ -z "$nameFile" ]
then
echo 'Need name of the file as arg'
else
# echo $dirPath
echo "\nStart ElementsMaker $nameFile"
echo rm -rf $dirPath/src/CfdiUtils/Elements/$nameFile
mkdir -p $dirPath/src/CfdiUtils/Elements/$nameFile
php $dirPath/development/bin/elements-maker.php $dirPath/development/ElementsMaker/specifications/$nameFile.json $dirPath/src/CfdiUtils/Elements/$nameFile
echo composer dev:fix-style
# vendor/bin/php-cs-fixer fix --verbose
# bin/phpcbf --colors -sp src/ tests/
echo "End ElementsMaker $nameFile\n"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace CfdiUtils\Elements\ConsumoDeCombustibles11;

use CfdiUtils\Elements\Common\AbstractElement;

class ConceptoConsumoDeCombustibles extends AbstractElement
{
public function getElementName(): string
{
return 'consumodecombustibles11:ConceptoConsumoDeCombustibles';
}

public function getDeterminados(): Determinados
{
return $this->helperGetOrAdd(new Determinados());
}

public function addDeterminados(array $attributes = []): Determinados
{
$subject = $this->getDeterminados();
$subject->addAttributes($attributes);
return $subject;
}
}
28 changes: 28 additions & 0 deletions src/CfdiUtils/Elements/ConsumoDeCombustibles11/Conceptos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace CfdiUtils\Elements\ConsumoDeCombustibles11;

use CfdiUtils\Elements\Common\AbstractElement;

class Conceptos extends AbstractElement
{
public function getElementName(): string
{
return 'consumodecombustibles11:Conceptos';
}

public function addConceptoConsumoDeCombustibles(array $attributes = []): ConceptoConsumoDeCombustibles
{
$subject = new ConceptoConsumoDeCombustibles($attributes);
$this->addChild($subject);
return $subject;
}

public function multiConceptoConsumoDeCombustibles(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addConceptoConsumoDeCombustibles($attributes);
}
return $this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace CfdiUtils\Elements\ConsumoDeCombustibles11;

use CfdiUtils\Elements\Common\AbstractElement;

class ConsumoDeCombustibles extends AbstractElement
{
public function getElementName(): string
{
return 'consumodecombustibles11:ConsumoDeCombustibles';
}

public function getFixedAttributes(): array
{
return [
'xmlns:consumodecombustibles11' => 'http://www.sat.gob.mx/ConsumoDeCombustibles11',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/ConsumoDeCombustibles11'
. ' http://www.sat.gob.mx/sitio_internet/cfd/consumodecombustibles/consumodeCombustibles11.xsd',
'version' => '1.1',
];
}

public function getConceptos(): Conceptos
{
return $this->helperGetOrAdd(new Conceptos());
}

public function addConceptos(array $attributes = []): Conceptos
{
$subject = $this->getConceptos();
$subject->addAttributes($attributes);
return $subject;
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/ConsumoDeCombustibles11/Determinado.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\ConsumoDeCombustibles11;

use CfdiUtils\Elements\Common\AbstractElement;

class Determinado extends AbstractElement
{
public function getElementName(): string
{
return 'consumodecombustibles11:Determinado';
}
}
25 changes: 25 additions & 0 deletions src/CfdiUtils/Elements/ConsumoDeCombustibles11/Determinados.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace CfdiUtils\Elements\ConsumoDeCombustibles11;

use CfdiUtils\Elements\Common\AbstractElement;

class Determinados extends AbstractElement
{
public function getElementName(): string
{
return 'consumodecombustibles11:Determinados';
}

public function getDeterminado(): Determinado
{
return $this->helperGetOrAdd(new Determinado());
}

public function addDeterminado(array $attributes = []): Determinado
{
$subject = $this->getDeterminado();
$subject->addAttributes($attributes);
return $subject;
}
}
23 changes: 23 additions & 0 deletions src/CfdiUtils/Elements/Donatarias11/Donatarias.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace CfdiUtils\Elements\Donatarias11;

use CfdiUtils\Elements\Common\AbstractElement;

class Donatarias extends AbstractElement
{
public function getElementName(): string
{
return 'donat:Donatarias';
}

public function getFixedAttributes(): array
{
return [
'xmlns:donat' => 'http://www.sat.gob.mx/donat',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/donat'
. ' http://www.sat.gob.mx/sitio_internet/cfd/donat/donat11.xsd',
'version' => '1.1',
];
}
}
23 changes: 23 additions & 0 deletions src/CfdiUtils/Elements/Iedu10/InstEducativas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace CfdiUtils\Elements\Iedu10;

use CfdiUtils\Elements\Common\AbstractElement;

class InstEducativas extends AbstractElement
{
public function getElementName(): string
{
return 'iedu:InstEducativas';
}

public function getFixedAttributes(): array
{
return [
'xmlns:iedu' => 'http://www.sat.gob.mx/iedu',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/iedu'
. ' http://www.sat.gob.mx/sitio_internet/cfd/iedu/iedu.xsd',
'version' => '1.0',
];
}
}
23 changes: 23 additions & 0 deletions src/CfdiUtils/Elements/Ine11/Ine.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace CfdiUtils\Elements\Ine11;

use CfdiUtils\Elements\Common\AbstractElement;

class Ine extends AbstractElement
{
public function getElementName(): string
{
return 'ine:Ine';
}

public function getFixedAttributes(): array
{
return [
'xmlns:ine' => 'http://www.sat.gob.mx/ine',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/ine'
. ' http://www.sat.gob.mx/sitio_internet/cfd/ine/ine11.xsd',
'Version' => '1.1',
];
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/LeyendasFiscales10/Leyenda.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\LeyendasFiscales10;

use CfdiUtils\Elements\Common\AbstractElement;

class Leyenda extends AbstractElement
{
public function getElementName(): string
{
return 'leyendasFisc:Leyenda';
}
}
38 changes: 38 additions & 0 deletions src/CfdiUtils/Elements/LeyendasFiscales10/LeyendasFiscales.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace CfdiUtils\Elements\LeyendasFiscales10;

use CfdiUtils\Elements\Common\AbstractElement;

class LeyendasFiscales extends AbstractElement
{
public function getElementName(): string
{
return 'leyendasFisc:LeyendasFiscales';
}

public function getFixedAttributes(): array
{
return [
'xmlns:leyendasFisc' => 'http://www.sat.gob.mx/leyendasFiscales',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/leyendasFiscales'
. ' http://www.sat.gob.mx/sitio_internet/cfd/leyendasFiscales/leyendasFisc.xsd',
'version' => '1.0',
];
}

public function addLeyenda(array $attributes = []): Leyenda
{
$subject = new Leyenda($attributes);
$this->addChild($subject);
return $subject;
}

public function multiLeyenda(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addLeyenda($attributes);
}
return $this;
}
}
Loading