Skip to content

Commit 61288f8

Browse files
authored
Merge pull request #20 from eclipxe13/version-0.4.2
Version 0.4.2 2024-09-02
2 parents eb36411 + a7ada73 commit 61288f8

File tree

9 files changed

+52
-38
lines changed

9 files changed

+52
-38
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
runs-on: "ubuntu-latest"
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: '8.2'
26+
php-version: '8.3'
2727
coverage: none
2828
tools: composer-normalize
2929
env:
@@ -36,11 +36,11 @@ jobs:
3636
runs-on: "ubuntu-latest"
3737
steps:
3838
- name: Checkout
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
4242
with:
43-
php-version: '8.2'
43+
php-version: '8.3'
4444
coverage: none
4545
tools: cs2pr, phpcs
4646
env:
@@ -53,11 +53,11 @@ jobs:
5353
runs-on: "ubuntu-latest"
5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5757
- name: Setup PHP
5858
uses: shivammathur/setup-php@v2
5959
with:
60-
php-version: '8.2'
60+
php-version: '8.3'
6161
coverage: none
6262
tools: cs2pr, php-cs-fixer
6363
env:
@@ -70,11 +70,11 @@ jobs:
7070
runs-on: "ubuntu-latest"
7171
steps:
7272
- name: Checkout
73-
uses: actions/checkout@v3
73+
uses: actions/checkout@v4
7474
- name: Setup PHP
7575
uses: shivammathur/setup-php@v2
7676
with:
77-
php-version: '8.2'
77+
php-version: '8.3'
7878
coverage: none
7979
tools: composer:v2, phpstan
8080
extensions: soap, gd
@@ -84,7 +84,7 @@ jobs:
8484
id: composer-cache
8585
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8686
- name: Cache dependencies
87-
uses: actions/cache@v3
87+
uses: actions/cache@v4
8888
with:
8989
path: ${{ steps.composer-cache.outputs.dir }}
9090
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -95,14 +95,14 @@ jobs:
9595
run: phpstan analyse --no-progress --verbose
9696

9797
tests:
98-
name: Tests on PHP ${{ matrix.php-versions }}
98+
name: Tests on PHP ${{ matrix.php-version }}
9999
runs-on: "ubuntu-latest"
100100
strategy:
101101
matrix:
102-
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
102+
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
103103
steps:
104104
- name: Checkout
105-
uses: actions/checkout@v3
105+
uses: actions/checkout@v4
106106
with:
107107
fetch-depth: 0 # required for sudo-bot/action-scrutinizer
108108
- name: Install poppler-utils
@@ -112,7 +112,7 @@ jobs:
112112
- name: Setup PHP
113113
uses: shivammathur/setup-php@v2
114114
with:
115-
php-version: ${{ matrix.php-versions }}
115+
php-version: ${{ matrix.php-version }}
116116
coverage: xdebug
117117
tools: composer:v2
118118
extensions: soap, gd
@@ -133,7 +133,7 @@ jobs:
133133
id: composer-cache
134134
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
135135
- name: Cache dependencies
136-
uses: actions/cache@v3
136+
uses: actions/cache@v4
137137
with:
138138
path: ${{ steps.composer-cache.outputs.dir }}
139139
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: "ubuntu-latest"
1818
steps:
1919
- name: "Checkout"
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
- name: "Setup PHP"
2222
uses: shivammathur/setup-php@v2
2323
with:
@@ -31,7 +31,7 @@ jobs:
3131
id: composer-cache
3232
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
3333
- name: "Cache dependencies"
34-
uses: actions/cache@v3
34+
uses: actions/cache@v4
3535
with:
3636
path: ${{ steps.composer-cache.outputs.dir }}
3737
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.phive/phars.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-normalize" version="^2.31.0" installed="2.31.0" location="./tools/composer-normalize" copy="false"/>
4-
<phar name="php-cs-fixer" version="^3.19.2" installed="3.19.2" location="./tools/php-cs-fixer" copy="false"/>
5-
<phar name="phpcs" version="^3.7.2" installed="3.7.2" location="./tools/phpcs" copy="false"/>
6-
<phar name="phpcbf" version="^3.7.2" installed="3.7.2" location="./tools/phpcbf" copy="false"/>
7-
<phar name="phpstan" version="^1.10.21" installed="1.10.21" location="./tools/phpstan" copy="false"/>
3+
<phar name="composer-normalize" version="^2.43.0" installed="2.43.0" location="./tools/composer-normalize" copy="false"/>
4+
<phar name="php-cs-fixer" version="^3.64.2" installed="3.64.0" location="./tools/php-cs-fixer" copy="false"/>
5+
<phar name="phpcs" version="^3.10.2" installed="3.10.2" location="./tools/phpcs" copy="false"/>
6+
<phar name="phpcbf" version="^3.10.2" installed="3.10.2" location="./tools/phpcbf" copy="false"/>
7+
<phar name="phpstan" version="^1.12.0" installed="1.12.0" location="./tools/phpstan" copy="false"/>
88
</phive>

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
'whitespace_after_comma_in_array' => true,
2525
'no_empty_statement' => true,
2626
'no_extra_blank_lines' => true,
27-
'function_typehint_space' => true,
27+
'type_declaration_spaces' => true,
2828
'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'arguments']],
29-
'new_with_braces' => true,
29+
'new_with_parentheses' => true,
3030
'no_blank_lines_after_class_opening' => true,
3131
'no_blank_lines_after_phpdoc' => true,
3232
'object_operator_without_whitespace' => true,

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 - 2023 PhpCfdi https://www.phpcfdi.com/
3+
Copyright (c) 2018 - 2024 PhpCfdi https://www.phpcfdi.com/
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
},
2424
"require": {
2525
"php": ">=7.3",
26-
"eclipxe/cfdiutils": "^2.11.0",
27-
"league/plates": "^3.3",
28-
"phpcfdi/cfdi-cleaner": "^1.2",
29-
"spipu/html2pdf": "^5.1"
26+
"eclipxe/cfdiutils": "^2.29",
27+
"league/plates": "^3.5",
28+
"phpcfdi/cfdi-cleaner": "^1.3.3",
29+
"spipu/html2pdf": "^5.2.8"
3030
},
3131
"require-dev": {
3232
"phpunit/phpunit": "^9.5"

docs/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# `phpcfdi/cfditopdf` Changelog
22

3+
## Version 0.4.2 2024-09-02
4+
5+
- Fix issue on CFDI 4.0 generate only the first block of information for `cfdi:CfdiRelacionados`.
6+
Now it creates a block for every occurence.
7+
- Update license year to 2024.
8+
- Maintenance changes:
9+
- Use GitHub Actions version 4.
10+
- Add PHP 8.3 to test matrix.
11+
- Run jobs using PHP 8.3.
12+
- Use `matrix.php-version` in singular instead of plural.
13+
- Update `php-cs-fixer` configuration files deprecated rules.
14+
- Update direct dependencies.
15+
- Update development tools.
16+
317
## Maintenance 2023-06-26
418

519
- Fix configuration file `.php-cs-fixer.dist.php`.

docs/TODO.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# phpcfdi/cfditopdf To Do List
22

3-
Intro: Al completar una tarea pasarla de *Planeada* a *Finalizada*. Escribir fecha o versión del cambio.
3+
Intro: Al completar una tarea pasarla de *Planeada* a *Finalizada*. Escribir fecha o versión del cambio.
44

5-
# Planeadas
5+
## Planeadas
66

77
- Revisar que <https://github.com/spipu/html2pdf/issues/530> esté solucionado para desactivar "permitir fallos"
88
en PHP 7.4 porque `spipu/html2pdf` tiene un bug.
@@ -15,8 +15,8 @@ Intro: Al completar una tarea pasarla de *Planeada* a *Finalizada*. Escribir fec
1515

1616
## Finalizadas
1717

18-
### En versión 0.3.2 o anteriores:
19-
18+
### En versión 0.3.2 o anteriores
19+
2020
- Otros nodos de los conceptos.
2121
- Cadena de origen del TFD.
2222
- Liga del código QR.

templates/generic.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
$emisor = $cfdiData->emisor();
1616
$receptor = $cfdiData->receptor();
1717
$tfd = $cfdiData->timbreFiscalDigital();
18-
$relacionados = $comprobante->searchNode('cfdi:CfdiRelacionados');
18+
$relacionados = $comprobante->searchNodes('cfdi:CfdiRelacionados');
1919
$totalImpuestosTrasladados = $comprobante->searchAttribute('cfdi:Impuestos', 'TotalImpuestosTrasladados');
2020
$totalImpuestosRetenidos = $comprobante->searchAttribute('cfdi:Impuestos', 'TotalImpuestosRetenidos');
2121
$conceptos = $comprobante->searchNodes('cfdi:Conceptos', 'cfdi:Concepto');
@@ -184,16 +184,16 @@
184184
</p>
185185
</div>
186186
</div>
187-
<?php if (null !== $relacionados) : ?>
187+
<?php foreach ($relacionados as $relacionado) : ?>
188188
<div class="panel">
189-
<div class="title">CFDI Relacionados (Tipo de relación: <?=$this->e($relacionados['TipoRelacion'])?>)</div>
189+
<div class="title">CFDI Relacionados (Tipo de relación: <?=$this->e($relacionado['TipoRelacion'])?>)</div>
190190
<div class="content">
191-
<?php foreach ($relacionados->searchNodes('cfdi:CfdiRelacionado') as $relacionado) : ?>
192-
<span>UUID: <?=$relacionado['UUID']?></span>
191+
<?php foreach ($relacionado->searchNodes('cfdi:CfdiRelacionado') as $cfdiRelacionado) : ?>
192+
<span>UUID: <?=$cfdiRelacionado['UUID']?></span>
193193
<?php endforeach; ?>
194194
</div>
195195
</div>
196-
<?php endif; ?>
196+
<?php endforeach; ?>
197197
<?php foreach ($conceptos as $concepto) : ?>
198198
<?php
199199
$conceptoCounter = $conceptoCounter + 1;

0 commit comments

Comments
 (0)