Skip to content

Commit

Permalink
remessa nao envia se nao tiver chave
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Aug 13, 2024
1 parent 77be20d commit 57f33a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion exemplos/abc_remessa.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
'operacao' => 1234567,
'agencia' => '0001',
'conta' => '7654321',
'chaveNfe' => '35240826589893000146550010000263841557593869',
]);

$remessa = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Abc([
Expand Down
20 changes: 12 additions & 8 deletions src/Cnab/Remessa/Cnab400/Banco/Abc.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,20 @@ public function addBoleto(BoletoContract $boleto)
$this->add(38, 81, Util::formatCnab('9', $nota1->getChave(), 44)); // Chave da nota 1

$nota2 = $boleto->getNotaFiscal(1);
$this->add(82, 96, Util::formatCnab('X', $nota2->getNumero(), 15)); // Numero da nota 2
$this->add(97, 109, Util::formatCnab('9', $nota2->getValor(), 11, 2)); // valor da nota 2
$this->add(110, 117, Util::formatCnab('9', $nota2->getData('dmY'), 8)); // data nota 2
$this->add(118, 161, Util::formatCnab('9', $nota2->getChave(), 44)); // Chave da nota 2
if ($nota2->getChave()) {
$this->add(82, 96, Util::formatCnab('X', $nota2->getNumero(), 15)); // Numero da nota 2
$this->add(97, 109, Util::formatCnab('9', $nota2->getValor(), 11, 2)); // valor da nota 2
$this->add(110, 117, Util::formatCnab('9', $nota2->getData('dmY'), 8)); // data nota 2
$this->add(118, 161, Util::formatCnab('9', $nota2->getChave(), 44)); // Chave da nota 2
}

$nota3 = $boleto->getNotaFiscal(2);
$this->add(162, 176, Util::formatCnab('X', $nota3->getNumero(), 15)); // Numero da nota 3
$this->add(177, 189, Util::formatCnab('9', $nota3->getValor(), 11, 2)); // valor da nota 3
$this->add(190, 197, Util::formatCnab('9', $nota3->getData('dmY'), 8)); // data nota 3
$this->add(198, 241, Util::formatCnab('9', $nota3->getChave(), 44)); // Chave da nota 3
if ($nota3->getChave()) {
$this->add(162, 176, Util::formatCnab('X', $nota3->getNumero(), 15)); // Numero da nota 3
$this->add(177, 189, Util::formatCnab('9', $nota3->getValor(), 11, 2)); // valor da nota 3
$this->add(190, 197, Util::formatCnab('9', $nota3->getData('dmY'), 8)); // data nota 3
$this->add(198, 241, Util::formatCnab('9', $nota3->getChave(), 44)); // Chave da nota 3
}

$this->add(395, 400, Util::formatCnab('9', $this->iRegistros + 1, 6));
}
Expand Down

0 comments on commit 57f33a9

Please sign in to comment.