Skip to content

Commit 85fb1da

Browse files
committed
Version 2.12.9
2 parents fbad549 + 446aa07 commit 85fb1da

File tree

12 files changed

+71
-40
lines changed

12 files changed

+71
-40
lines changed

.appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ install:
122122
## Run the actual test
123123
test_script:
124124
- cd c:\projects\project
125-
- vendor\bin\phplint.bat
126125
- vendor\bin\phpcs.bat -sp src tests
127126
- vendor\bin\php-cs-fixer.bat fix --dry-run --verbose
128127
- if "%php%"=="7.0" vendor\bin\phpunit.bat --verbose

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
/.gitignore export-ignore
2020
/.markdownlint.json export-ignore
2121
/.php_cs.dist export-ignore
22-
/.phplint.yml export-ignore
2322
/.scrutinizer.yml export-ignore
2423
/.travis.yml export-ignore
2524
/mkdocs.yml export-ignore

.phplint.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.scrutinizer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build:
1111
dependencies:
1212
override:
1313
- composer self-update --no-interaction --no-progress
14+
- composer remove squizlabs/php_codesniffer friendsofphp/php-cs-fixer phpstan/phpstan --dev --no-interaction --no-progress --no-update
1415
- composer install --no-interaction
1516
nodes:
1617
analysis:

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ before_script:
2929
- travis_retry pip install --user mkdocs
3030

3131
script:
32-
- vendor/bin/phplint
3332
- vendor/bin/phpcs -sp src/ tests/
3433
- vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
3534
- | # create code coverage file

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"require-dev": {
4545
"genkgo/xsl": "^0.6",
4646
"phpunit/phpunit": "^6.2|^7.3",
47-
"overtrue/phplint": "^1.0",
4847
"squizlabs/php_codesniffer": "^3.0",
4948
"friendsofphp/php-cs-fixer": "^2.4",
5049
"phpstan/phpstan": "^0.9|^0.10|^0.11"
@@ -78,7 +77,6 @@
7877
"mkdocs build --strict --site-dir build/docs"
7978
],
8079
"dev:test": [
81-
"vendor/bin/phplint",
8280
"@dev:check-style",
8381
"vendor/bin/phpunit --testdox --verbose --stop-on-failure",
8482
"vendor/bin/phpstan analyse --no-progress --level max src/ tests/"
@@ -92,7 +90,7 @@
9290
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
9391
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
9492
"dev:docs": "DEV: search for code style errors unsing markdownlint and build docs using mkdocs",
95-
"dev:test": "DEV: run phplint, dev:check-style, phpunit and phpstan",
93+
"dev:test": "DEV: run dev:check-style, phpunit and phpstan",
9694
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
9795
}
9896
}

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
- Change visibility of `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()` to private.
2929

3030

31+
## Version 2.12.9 2020-04-25
32+
33+
- Review and fix `CreateComprobantePagosCaseTest`.
34+
- Add docblocks on `StatusResponse` and fix script `tests/estadosat.php`.
35+
- Remove `overtrue/phplint` from development dependences.
36+
37+
3138
## Version 2.12.8 2020-01-07
3239

3340
- Change License year to 2020.

docs/componentes/estado-sat.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ Este estado se debe entender como que el SAT reconoce el CFDI y su estado genera
8888
Se refiere a que si en el momento de la consulta el CFDI se puede cancelar.
8989

9090
- `No cancelable`: No se puede cancelar, tal vez ya hay documentos relacionados.
91-
- `Cancelable sin aceptación`: Se puede cancelar de inmediato
91+
- `Cancelable sin aceptación`: Se puede cancelar de inmediato.
9292
- `Cancelable con aceptación`: Se puede cancelar pero se va a tener que esperar respuesta.
9393

9494
### EstatusCancelacion (estado de cancelación)
9595

9696
Se refiere al estado de la cancelación solicitada previamente.
9797

9898
- `(ninguno)`: El estado vacío es que no tiene estado de cancelación, porque no fue solicitada.
99-
- `Cancelado sin aceptación`: Se canceló y no fue necesaria la aceptación
100-
- `En proceso`: En espera de que el receptor la autorice
101-
- `Plazo vencido`: Cancelado por vencimiento de plazo en que el receptor podía denegarla
102-
- `Cancelado con aceptación`: Cancelado con el consentimiento del receptor
103-
- `Solicitud rechazada`: No cancelada.
99+
- `Cancelado sin aceptación`: Se canceló y no fue necesaria la aceptación.
100+
- `En proceso`: En espera de que el receptor la autorice.
101+
- `Plazo vencido`: Cancelado por vencimiento de plazo en que el receptor podía denegarla.
102+
- `Cancelado con aceptación`: Cancelado con el consentimiento del receptor.
103+
- `Solicitud rechazada`: No se realizó la cancelación por rechazo.
104104

105105
## Estados mutuamente excluyentes
106106

docs/contribuir/guia-desarrollador.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ composer install
4040

4141
## Pruebas
4242

43-
Para probar que todos los archivos no contienen errores de sintaxis
44-
45-
```shell
46-
vendor/bin/phplint
47-
```
48-
4943
Para probar que no se están violando las reglas de estilo
5044

5145
```shell

src/CfdiUtils/ConsultaCfdiSat/StatusResponse.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,63 @@ public function __construct(
2828
$this->cancellationStatus = $cancellationStatus;
2929
}
3030

31+
/**
32+
* Status request code, values:
33+
* - S - Comprobante obtenido satisfactoriamente
34+
* - N - 601: La expresión impresa proporcionada no es válida
35+
* - N - 602: Comprobante no encontrado
36+
*
37+
* @see responseWasOk()
38+
*
39+
* @return string
40+
*/
3141
public function getCode(): string
3242
{
3343
return $this->code;
3444
}
3545

46+
/**
47+
* Status about the CFDI, values:
48+
* - `Vigente`: El comprobante está vigente al momento de la consulta
49+
* - `Cancelado`: El comprobante está cancelado al momento de la consulta
50+
* - `No Encontrado`: El comprobante no se encuentra en la base de datos del SAT
51+
*
52+
* @see isVigente()
53+
* @see isNotFound()
54+
* @see isCancelled()
55+
*
56+
* @return string
57+
*/
3658
public function getCfdi(): string
3759
{
3860
return $this->cfdi;
3961
}
4062

63+
/**
64+
* Cancellable status, values:
65+
* - `No cancelable`: No se puede cancelar, tal vez ya hay documentos relacionados.
66+
* - `Cancelable sin aceptación`: Se puede cancelar de inmediato.
67+
* - `Cancelable con aceptación`: Se puede cancelar pero se va a tener que esperar respuesta.
68+
*
69+
* @return string
70+
*/
4171
public function getCancellable(): string
4272
{
4373
return $this->cancellable;
4474
}
4575

76+
/**
77+
* Cancellation process status, values:
78+
*
79+
* - `(ninguno)`: El estado vacío es que no tiene estado de cancelación, porque no fue solicitada.
80+
* - `Cancelado sin aceptación`: Se canceló y no fue necesaria la aceptación.
81+
* - `En proceso`: En espera de que el receptor la autorice.
82+
* - `Plazo vencido`: Cancelado por vencimiento de plazo en que el receptor podía denegarla.
83+
* - `Cancelado con aceptación`: Cancelado con el consentimiento del receptor.
84+
* - `Solicitud rechazada`: No se realizó la cancelación por rechazo.
85+
*
86+
* @return string
87+
*/
4688
public function getCancellationStatus(): string
4789
{
4890
return $this->cancellationStatus;

tests/CfdiUtilsTests/CreateComprobantePagosCaseTest.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testMoveSatDefinitionsToComprobante()
2121
$comprobante = $creator->comprobante();
2222
$comprobante->addAttributes([
2323
'Fecha' => Format::datetime($fecha),
24-
'TipoDeComprobante' => 'P', // ingreso
24+
'TipoDeComprobante' => 'P', // pago
2525
'LugarExpedicion' => '52000',
2626
'Moneda' => 'XXX',
2727
'Total' => '0',
@@ -35,6 +35,7 @@ public function testMoveSatDefinitionsToComprobante()
3535
'RegimenFiscal' => '601',
3636
]);
3737
$comprobante->addReceptor(['Rfc' => 'COSC8001137NA', 'UsoCFDI' => 'P01']);
38+
// The concepto *must* have this content
3839
$comprobante->addConcepto([
3940
'ClaveProdServ' => '84111506',
4041
'Cantidad' => '1',
@@ -44,6 +45,8 @@ public function testMoveSatDefinitionsToComprobante()
4445
'Importe' => '0',
4546
]);
4647

48+
// create and populate the "complemento de pagos"
49+
// @see \CfdiUtils\Elements\Pagos10\Pagos
4750
$complementoPagos = new Pagos();
4851
$pago = $complementoPagos->addPago([
4952
'FechaPago' => Format::datetime($fechaPago),
@@ -76,25 +79,25 @@ public function testMoveSatDefinitionsToComprobante()
7679
'ImpSaldoInsoluto' => '7000.00',
7780
]
7881
);
82+
83+
// add the "complemento de pagos" ($complementoPagos) to the $comprobante
7984
$comprobante->addComplemento($complementoPagos);
8085

8186
// add sello and validate to assert that the specimen does not have any errors
8287
$creator->addSello('file://' . $keyfile, '');
83-
$findings = $creator->validate();
84-
$this->assertFalse(
85-
$findings->hasErrors() || $findings->hasWarnings(),
86-
'Created document must not contain errors, fix your test specimen'
87-
);
8888

89-
// this is after add sello to probe that it did not change it
89+
// this is after add sello to probe that it did not change the cadena origen or the sello
9090
$creator->moveSatDefinitionsToComprobante();
91+
92+
// perform validations, it should not have any error nor warnings
93+
$findings = $creator->validate();
9194
$this->assertFalse(
9295
$findings->hasErrors() || $findings->hasWarnings(),
93-
'After moveSatDefinitionsToComprobante the document must not have any warnings or errors'
96+
'Created document must not contain errors, fix your test specimen'
9497
);
9598

99+
// test that the file is the same as expected
96100
$expectedFile = $this->utilAsset('created-pago-with-ns-at-root.xml');
97-
file_put_contents($expectedFile, $creator->asXml());
98101
$this->assertXmlStringEqualsXmlFile(
99102
$expectedFile,
100103
$creator->asXml(),

tests/estadosat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
print_r(array_filter([
3737
'file' => $file,
38-
'Petición' => $response->getCfdi(),
39-
'Estado CFDI' => $response->getCode(),
38+
'Petición' => $response->getCode(),
39+
'Estado CFDI' => $response->getCfdi(),
4040
'Cancelable' => $response->getCancellable(),
4141
'Estado cancelación' => $response->getCancellationStatus(),
4242
]));

0 commit comments

Comments
 (0)