Skip to content

Commit

Permalink
daycoval homologacao
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Oct 4, 2024
1 parent 38a4585 commit 41507e1
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 2 deletions.
58 changes: 58 additions & 0 deletions exemplos/daycoval_remessa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

require 'autoload.php';
$beneficiario = new Eduardokum\LaravelBoleto\Pessoa([
'nome' => 'ACME',
'endereco' => 'Rua um, 123',
'bairro' => 'Bairro',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '99.999.999/9999-99',
]);

$pagador = new Eduardokum\LaravelBoleto\Pessoa([
'nome' => 'Cliente',
'endereco' => 'Rua um, 123',
'bairro' => 'Bairro',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '999.999.999-99',
]);

$boleto = new Eduardokum\LaravelBoleto\Boleto\Banco\Daycoval([
'logo' => realpath(__DIR__ . '/../logos/') . DIRECTORY_SEPARATOR . '707.png',
'dataVencimento' => new Carbon\Carbon(),
'valor' => 100,
'multa' => false,
'juros' => false,
'numero' => '0004309540',
'numeroDocumento' => 1,
'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'],
'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'],
'aceite' => 'S',
'especieDoc' => 'DM',
'pagador' => $pagador,
'beneficiario' => $beneficiario,
'carteira' => 3,
'operacao' => 1234567,
'agencia' => '0001',
'conta' => '7654321',
'notas_fiscais' => [
Eduardokum\LaravelBoleto\NotaFiscal::create('12345678901234567890123456789012345678901235', 2, new Carbon\Carbon(), 100),
],
]);

$remessa = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Daycoval([
'agencia' => 1111,
'carteira' => '3',
'contaDv' => 9,
'codigoCliente' => '190600851565400',
'beneficiario' => $beneficiario,
]);
$remessa->addBoleto($boleto);

//echo $remessa->save(__DIR__ . DIRECTORY_SEPARATOR . 'arquivos' . DIRECTORY_SEPARATOR . 'daycoval.txt');
echo '<pre>';
echo $remessa->gerar();
58 changes: 58 additions & 0 deletions exemplos/notas_fiscais_remessa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

require 'autoload.php';
$beneficiario = new Eduardokum\LaravelBoleto\Pessoa([
'nome' => 'ACME',
'endereco' => 'Rua um, 123',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '99.999.999/9999-99',
]);

$pagador = new Eduardokum\LaravelBoleto\Pessoa([
'nome' => 'Cliente',
'endereco' => 'Rua um, 123',
'bairro' => 'Bairro',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '999.999.999-99',
]);

$boleto = new Eduardokum\LaravelBoleto\Boleto\Banco\Abc([
'logo' => realpath(__DIR__ . '/../logos/') . DIRECTORY_SEPARATOR . '246.png',
'dataVencimento' => new Carbon\Carbon(),
'valor' => 100,
'multa' => false,
'juros' => false,
'numero' => '0004309540',
'numeroDocumento' => 1,
'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'],
'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'],
'aceite' => 'S',
'especieDoc' => 'DM',
'pagador' => $pagador,
'beneficiario' => $beneficiario,
'carteira' => 6,
'operacao' => 1234567,
'agencia' => '0001',
'conta' => '7654321',
'notas_fiscais' => [
['chave' => '12345678901234567890123456789012345678901234', 'numero' => 1, 'data' => new Carbon\Carbon(), 'valor' => 100],
Eduardokum\LaravelBoleto\NotaFiscal::create('12345678901234567890123456789012345678901235', 2, new Carbon\Carbon(), 100),
new Eduardokum\LaravelBoleto\NotaFiscal(['chave' => '12345678901234567890123456789012345678901236', 'numero' => 3, 'data' => new Carbon\Carbon(), 'valor' => 100]),
],
]);

$remessa = new Eduardokum\LaravelBoleto\Cnab\Remessa\Cnab400\Banco\Abc([
'agencia' => '0001',
'conta' => '7654321',
'carteira' => 6,
'codigoCliente' => '00011234567',
'beneficiario' => $beneficiario,
]);
$remessa->addBoleto($boleto);

echo '<pre>';
echo $remessa->gerar();
4 changes: 2 additions & 2 deletions src/Cnab/Remessa/Cnab400/Banco/Daycoval.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ public function addBoleto(BoletoContract $boleto)
$this->add(3, 71, Util::formatCnab('X', Arr::get($instrucoes, 0), 69));
$this->add(72, 140, Util::formatCnab('X', Arr::get($instrucoes, 1), 69));
$this->add(141, 209, Util::formatCnab('X', Arr::get($instrucoes, 2), 69));
$this->add(210, 274, Util::formatCnab('X', Arr::get($instrucoes, 3), 69));
$this->add(275, 394, '');
$this->add(210, 278, Util::formatCnab('X', Arr::get($instrucoes, 3), 69));
$this->add(279, 394, '');
$this->add(395, 400, Util::formatCnab('9', $this->iRegistros + 1, 6));
}

Expand Down

0 comments on commit 41507e1

Please sign in to comment.