-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se agregan los elementos de Carta Porte 1.0, Gracias @AndreyPootMay Closes #70
- Loading branch information
1 parent
988a9d8
commit 40e0421
Showing
52 changed files
with
2,205 additions
and
0 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,27 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Arrendatario extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:Arrendatario'; | ||
} | ||
|
||
public function getDomicilio(): Domicilio | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new Domicilio()); | ||
} | ||
|
||
public function addDomicilio(array $attributes = []): Domicilio | ||
{ | ||
$domicilio = $this->getDomicilio(); | ||
$domicilio->addAttributes($attributes); | ||
|
||
return $domicilio; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/CfdiUtils/Elements/CartaPorte10/AutotransporteFederal.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,41 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class AutotransporteFederal extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:AutotransporteFederal'; | ||
} | ||
|
||
public function addIdentificacionVehicular(array $attributes = []): IdentificacionVehicular | ||
{ | ||
$identificacionVehicular = new IdentificacionVehicular($attributes); | ||
$this->addChild($identificacionVehicular); | ||
|
||
return $identificacionVehicular; | ||
} | ||
|
||
public function getIdentificacionVehicular(): IdentificacionVehicular | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new IdentificacionVehicular()); | ||
} | ||
|
||
public function addRemolques(array $attributes = []): Remolques | ||
{ | ||
$remolques = new Remolques($attributes); | ||
$this->addChild($remolques); | ||
|
||
return $remolques; | ||
} | ||
|
||
public function getRemolques(): Remolques | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new Remolques()); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/CfdiUtils/Elements/CartaPorte10/CantidadTransporta.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,13 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class CantidadTransporta extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:CantidadTransporta'; | ||
} | ||
} |
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,29 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Carro extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:Carro'; | ||
} | ||
|
||
public function addContenedor(array $attributes = []): Contenedor | ||
{ | ||
$contenedor = new Contenedor($attributes); | ||
$this->addChild($contenedor); | ||
|
||
return $contenedor; | ||
} | ||
|
||
public function multiContenedor(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addContenedor($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,74 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class CartaPorte extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:CartaPorte'; | ||
} | ||
|
||
public function getChildrenOrder(): array | ||
{ | ||
return [ | ||
'cartaporte:Ubicaciones', | ||
'cartaporte:Mercancias', | ||
'cartaporte:FiguraTransporte', | ||
]; | ||
} | ||
|
||
public function getFixedAttributes(): array | ||
{ | ||
return [ | ||
'xmlns:cartaporte' => 'http://www.sat.gob.mx/cartaporte', | ||
'xsi:schemaLocation' => 'http://www.sat.gob.mx/cartaporte' | ||
. ' http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte.xsd', | ||
'Version' => '1.0', | ||
]; | ||
} | ||
|
||
public function getUbicaciones(): Ubicaciones | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new Ubicaciones()); | ||
} | ||
|
||
public function addUbicaciones(array $attributes = []): Ubicaciones | ||
{ | ||
$ubicaciones = $this->getUbicaciones(); | ||
$ubicaciones->addAttributes($attributes); | ||
|
||
return $ubicaciones; | ||
} | ||
|
||
public function getMercancias(): Mercancias | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new Mercancias()); | ||
} | ||
|
||
public function addMercancias(array $attributes = []): Mercancias | ||
{ | ||
$mercancias = $this->getMercancias(); | ||
$mercancias->addAttributes($attributes); | ||
|
||
return $mercancias; | ||
} | ||
|
||
public function getFiguraTransporte(): FiguraTransporte | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new FiguraTransporte()); | ||
} | ||
|
||
public function addFiguraTransporte(array $attributes = []): FiguraTransporte | ||
{ | ||
$figuraTransporte = $this->getFiguraTransporte(); | ||
$figuraTransporte->addAttributes($attributes); | ||
|
||
return $figuraTransporte; | ||
} | ||
} |
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\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Contenedor extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:Contenedor'; | ||
} | ||
} |
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\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class DerechosDePaso extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:DerechosDePaso'; | ||
} | ||
} |
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\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Destino extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:Destino'; | ||
} | ||
} |
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\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class DetalleMercancia extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:DetalleMercancia'; | ||
} | ||
} |
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\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Domicilio extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte: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,77 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class FiguraTransporte extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:FiguraTransporte'; | ||
} | ||
|
||
public function addOperadores(array $attributes = []): Operadores | ||
{ | ||
$operadores = new Operadores($attributes); | ||
$this->addChild($operadores); | ||
|
||
return $operadores; | ||
} | ||
|
||
public function multiOperadores(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addOperadores($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function addPropietario(array $attributes = []): Propietario | ||
{ | ||
$propietario = new Propietario($attributes); | ||
$this->addChild($propietario); | ||
|
||
return $propietario; | ||
} | ||
|
||
public function multiPropietario(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addPropietario($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function addArrendatario(array $attributes = []): Arrendatario | ||
{ | ||
$arrendatario = new Arrendatario($attributes); | ||
$this->addChild($arrendatario); | ||
|
||
return $arrendatario; | ||
} | ||
|
||
public function multiArrendatario(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addArrendatario($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function addNotificado(array $attributes = []): Notificado | ||
{ | ||
$arrendatario = new Notificado($attributes); | ||
$this->addChild($arrendatario); | ||
|
||
return $arrendatario; | ||
} | ||
|
||
public function multiNotificado(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addNotificado($attributes); | ||
} | ||
return $this; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/CfdiUtils/Elements/CartaPorte10/IdentificacionVehicular.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,13 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class IdentificacionVehicular extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:IdentificacionVehicular'; | ||
} | ||
} |
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,43 @@ | ||
<?php | ||
|
||
namespace CfdiUtils\Elements\CartaPorte10; | ||
|
||
use CfdiUtils\Elements\Common\AbstractElement; | ||
|
||
class Mercancia extends AbstractElement | ||
{ | ||
public function getElementName(): string | ||
{ | ||
return 'cartaporte:Mercancia'; | ||
} | ||
|
||
public function addCantidadTransporta(array $attributes = []): CantidadTransporta | ||
{ | ||
$cantidadTransporta = new CantidadTransporta($attributes); | ||
$this->addChild($cantidadTransporta); | ||
|
||
return $cantidadTransporta; | ||
} | ||
|
||
public function multiCantidadTransporta(array ...$elementAttributes): self | ||
{ | ||
foreach ($elementAttributes as $attributes) { | ||
$this->addCantidadTransporta($attributes); | ||
} | ||
return $this; | ||
} | ||
|
||
public function addDetalleMercancia(array $attributes = []): DetalleMercancia | ||
{ | ||
$detalleMercancia = new DetalleMercancia($attributes); | ||
$this->addChild($detalleMercancia); | ||
|
||
return $detalleMercancia; | ||
} | ||
|
||
public function getDetalleMercancia(): DetalleMercancia | ||
{ | ||
/** @noinspection PhpIncompatibleReturnTypeInspection */ | ||
return $this->helperGetOrAdd(new DetalleMercancia()); | ||
} | ||
} |
Oops, something went wrong.
40e0421
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hola, Carta Porte 2.0 es la que debería ya usarse
http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte20.xsd
http://omawww.sat.gob.mx/tramitesyservicios/Paginas/documentos/CartaPorte20.pdf
http://omawww.sat.gob.mx/tramitesyservicios/Paginas/complemento_carta_porte.htm
40e0421
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfecto caballero, reviso y en un momento se corrige. saludos y muchas gracias ✨ 👍🏾
40e0421
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hola @ramelp !
La Carta Porte 2.0 se debe usar a partir de 2021-12-01, aún no debería utilizarse.
Las diferencias entre Carta Porte 2.0 y 1.0 no son muchas pero sí son sustaciales.
Lo mejor sería abrir un issue independiente para crear también los Elementos (code helpers) de este estándar.
Ambas versiones pueden convivir en la librería porque tienen espacios de nombres diferentes.