Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
First version....
Browse files Browse the repository at this point in the history
  • Loading branch information
rdomenzain committed Oct 18, 2019
1 parent a8b31b3 commit a2ddc8a
Show file tree
Hide file tree
Showing 64 changed files with 2,403 additions and 158 deletions.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# rdomenzain/cfdi33-utils

[![Source Code][badge-source]][source]
[![Issues][badge-issues]][issues]
[![Software License][badge-license]][license]
[![Total Downloads][badge-downloads]][downloads]
[![Pagina Web][badge-pagina]][pagina]
Expand Down Expand Up @@ -36,8 +37,66 @@ $emisor->RegimenFiscal = "608";
$comprobante->Emisor = $emisor;

$cfdi = new Cfdv33($comprobante, $rutaCert, $rutaKey);
// This XML is already signed by the certificate and primary key
// Is ready to send to the favorite PAC
echo $cfdi->getXml();

```
## How signed only the XML
```php
<?php
// Declare utils
$utlXml = new XmlUtils();

// Get original string from the XML
$cadenaOriginal = $utlXml->GeneraCadenaOriginal(file_get_contents($pathXml));

// generated sign from original string, this add to the XML
$sello = $this->utlXml->GeneralSelloCfdi33($cadenaOriginal, file_get_contents($rutaKey), $claveKey);

```

## How get certificate and certificate number
```php
<?php
// Certificate utilities declared
$utlCert = new CertificadoUtils();

// Get the bash from to certificate, this add to the XML
$certificado = $utlCert->GeneraCertificado2Pem(file_get_contents($rutaCert));

// Get the certificate number from file .cer, this add to the XML
$noCertificado = $utlCert->GetNumCertificado(file_get_contents($rutaCert));

```

## Otras utilidades sobre CFDI 33
```php
<?php
// Certificate utilities declared
$utlCert = new CertificadoUtils();
$utlCommons = new CommonsUtils();

// Get date format requiered for the XML
echo $utlCommons->GetFechaActualCFDI();
// Out: 2019-10-18T13:21:36

// Replace characters especial
echo $utlCommons->ReplaceEncodeUtf8('Asociados&Otros');
// Out: Asociados&amp;Otros

// Formato to numbers
echo $utlCommons->FormatNumber(100, 2)
// Out: 100.00

// Validate certificate
echo $utlCert->ValidateCertificado(file_get_contents($rutaCert));
// Out: Certificado emitido por el SAT.

// Validate file primary key
echo $utlCert->ValidatePrivateKey(file_get_contents($rutaKey));
// Out: Certificado emitido por el SAT.

```

## PHP Support
Expand All @@ -64,9 +123,11 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[downloads]: https://packagist.org/packages/rdomenzain/cfdi33-utils
[git]: https://packagist.org/packages/rdomenzain
[pagina]: https://ddsis.com.mx
[issues]: https://github.com/rdomenzain/cfdi33-utils/issues

[badge-source]: https://img.shields.io/badge/source-cfdi33--utils-blue?style=flat-square
[badge-license]: https://img.shields.io/badge/licence-MIT-red?style=flat-square
[badge-downloads]: https://img.shields.io/badge/downloads-%3E%20999-orange?style=flat-square
[badge-downloads]: https://img.shields.io/github/downloads/rdomenzain/cfdi33-utils/total?style=flat-square
[badge-git]: https://img.shields.io/github/followers/rdomenzain?label=rdomenzain&style=social
[badge-pagina]: https://img.shields.io/badge/Web-DDsis-lightgrey?style=flat-square
[badge-issues]: https://img.shields.io/github/issues/rdomenzain/cfdi33-utils?style=flat-square
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"source": "https://github.com/rdomenzain/cfdi33-utils",
"issues": "https://github.com/rdomenzain/cfdi33-utils/issues"
},
"require": { }
"require": { },
"autoload": {
"cfdi33-utils": { "rdomenzain\\cfdi\\utils\\": ["src/", "lib/"] }
}
}
8 changes: 4 additions & 4 deletions docs/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- [x] Create XSD and XSD
- [x] Modelos del CFDI
- [ ] Utilerias con SHL
- [ ] Generacion de XML
- [ ] Sellado XML
- [ ] Utilerias
- [x] Utilerias con SHL
- [x] Generacion de XML
- [x] Sellado XML
- [x] Utilerias
Loading

0 comments on commit a2ddc8a

Please sign in to comment.