-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from eclipxe13/version-2.26.0
Add CCE 2.0 & add move SAT definitions to Retenciones (version 2.26.0)
- Loading branch information
Showing
20 changed files
with
460 additions
and
13 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
development/ElementsMaker/specifications/ComercioExterior20.json
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,34 @@ | ||
{ | ||
"php-namespace": "CfdiUtils\\Elements\\Cce20", | ||
"prefix": "cce20", | ||
"xml-namespace": "http://www.sat.gob.mx/ComercioExterior20", | ||
"xml-schemalocation": "http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior20/ComercioExterior20.xsd", | ||
"version-attribute": "Version", | ||
"version-value": "2.0", | ||
"root-element": "ComercioExterior", | ||
"structure": { | ||
"Emisor": { | ||
"Domicilio": {} | ||
}, | ||
"Propietario": { | ||
"multiple": true | ||
}, | ||
"Receptor": { | ||
"Domicilio": {} | ||
}, | ||
"Destinatario": { | ||
"multiple": true, | ||
"Domicilio": { | ||
"multiple": true | ||
} | ||
}, | ||
"Mercancias": { | ||
"Mercancia": { | ||
"multiple": true, | ||
"DescripcionesEspecificas": { | ||
"multiple": true | ||
} | ||
} | ||
} | ||
} | ||
} |
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,100 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class ComercioExterior extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:ComercioExterior'; | ||
} | ||
|
||
public function getChildrenOrder(): array | ||
{ | ||
return [ | ||
'cce20:Emisor', | ||
'cce20:Propietario', | ||
'cce20:Receptor', | ||
'cce20:Destinatario', | ||
'cce20:Mercancias', | ||
]; | ||
} | ||
|
||
public function getFixedAttributes(): array | ||
{ | ||
return [ | ||
'xmlns:cce20' => 'http://www.sat.gob.mx/ComercioExterior20', | ||
'xsi:schemaLocation' => 'http://www.sat.gob.mx/ComercioExterior20' | ||
. ' http://www.sat.gob.mx/sitio_internet/cfd/ComercioExterior20/ComercioExterior20.xsd', | ||
'Version' => '2.0', | ||
]; | ||
} | ||
|
||
public function getEmisor(): Emisor | ||
{ | ||
return $this->helperGetOrAdd(new Emisor()); | ||
} | ||
|
||
public function addEmisor(array $attributes = []): Emisor | ||
{ | ||
$subject = $this->getEmisor(); | ||
$subject->addAttributes($attributes); | ||
return $subject; | ||
} | ||
|
||
public function addPropietario(array $attributes = []): Propietario | ||
{ | ||
$subject = new Propietario($attributes); | ||
$this->addChild($subject); | ||
return $subject; | ||
} | ||
|
||
public function multiPropietario(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addPropietario($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function getReceptor(): Receptor | ||
{ | ||
return $this->helperGetOrAdd(new Receptor()); | ||
} | ||
|
||
public function addReceptor(array $attributes = []): Receptor | ||
{ | ||
$subject = $this->getReceptor(); | ||
$subject->addAttributes($attributes); | ||
return $subject; | ||
} | ||
|
||
public function addDestinatario(array $attributes = []): Destinatario | ||
{ | ||
$subject = new Destinatario($attributes); | ||
$this->addChild($subject); | ||
return $subject; | ||
} | ||
|
||
public function multiDestinatario(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addDestinatario($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function getMercancias(): Mercancias | ||
{ | ||
return $this->helperGetOrAdd(new Mercancias()); | ||
} | ||
|
||
public function addMercancias(array $attributes = []): Mercancias | ||
{ | ||
$subject = $this->getMercancias(); | ||
$subject->addAttributes($attributes); | ||
return $subject; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class DescripcionesEspecificas extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:DescripcionesEspecificas'; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Destinatario extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Destinatario'; | ||
} | ||
|
||
public function addDomicilio(array $attributes = []): Domicilio | ||
{ | ||
$subject = new Domicilio($attributes); | ||
$this->addChild($subject); | ||
return $subject; | ||
} | ||
|
||
public function multiDomicilio(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addDomicilio($attributes); | ||
} | ||
return $this; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Domicilio extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Domicilio'; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Emisor extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Emisor'; | ||
} | ||
|
||
public function getDomicilio(): Domicilio | ||
{ | ||
return $this->helperGetOrAdd(new Domicilio()); | ||
} | ||
|
||
public function addDomicilio(array $attributes = []): Domicilio | ||
{ | ||
$subject = $this->getDomicilio(); | ||
$subject->addAttributes($attributes); | ||
return $subject; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Mercancia extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Mercancia'; | ||
} | ||
|
||
public function addDescripcionesEspecificas(array $attributes = []): DescripcionesEspecificas | ||
{ | ||
$subject = new DescripcionesEspecificas($attributes); | ||
$this->addChild($subject); | ||
return $subject; | ||
} | ||
|
||
public function multiDescripcionesEspecificas(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addDescripcionesEspecificas($attributes); | ||
} | ||
return $this; | ||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Mercancias extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Mercancias'; | ||
} | ||
|
||
public function addMercancia(array $attributes = []): Mercancia | ||
{ | ||
$subject = new Mercancia($attributes); | ||
$this->addChild($subject); | ||
return $subject; | ||
} | ||
|
||
public function multiMercancia(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addMercancia($attributes); | ||
} | ||
return $this; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Propietario extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Propietario'; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\Cce20; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Receptor extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cce20:Receptor'; | ||
} | ||
|
||
public function getDomicilio(): Domicilio | ||
{ | ||
return $this->helperGetOrAdd(new Domicilio()); | ||
} | ||
|
||
public function addDomicilio(array $attributes = []): Domicilio | ||
{ | ||
$subject = $this->getDomicilio(); | ||
$subject->addAttributes($attributes); | ||
return $subject; | ||
} | ||
} |
Oops, something went wrong.