Skip to content

Commit

Permalink
Merge pull request #9 from conectra/fix/CS-1281-documentos-dacte
Browse files Browse the repository at this point in the history
fix(docOrigContinuacao): corrige while para conter ultima chave vincu…
  • Loading branch information
gabrielrassweiler authored Apr 13, 2023
2 parents 7509374 + a4b6599 commit 54caa01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/CTe/DacteV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -2539,9 +2539,9 @@ protected function zDocOrigContinuacao($x = 0, $y = 0)
//$h = 9 + 3.5 ;// segunda linha
//$h = 9 + 3.5+ 3.5 ;// segunda linha
$h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9;
if (count($this->arrayNFe)%2 !=0) {
$h = $h+3.5;
} // Caso tenha apenas 1 registro na ultima linha
if (count($this->arrayNFe)%2 !=0 || (count($this->arrayNFe) - $contador) %2 == 0) {
$h = $h+4;
} // Caso tenha apenas 1 registro na ultima linha ou seja impar
$texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO';
$aFont = $this->formatPadrao;
$this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
Expand Down Expand Up @@ -2591,13 +2591,13 @@ protected function zDocOrigContinuacao($x = 0, $y = 0)
$this->pTextBox($x, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, '');
$auxX = $oldX;
$yIniDados += 3;
while ($contador < (count($this->arrayNFe))) {
while ($contador <= (count($this->arrayNFe))) {
if ($contador%(116*($i-1)) == 0) {
// $contador++;
break;
}
$tp = 'NF-e';
$chaveNFe = $this->arrayNFe[$contador];
$chaveNFe = $this->arrayNFe[$contador - 1];
$numNFe = substr($chaveNFe, 25, 9);
$serieNFe = substr($chaveNFe, 22, 3);
$doc = $serieNFe . '/' . $numNFe;
Expand Down

0 comments on commit 54caa01

Please sign in to comment.