diff --git a/manuais/BANRISUL/webservice/Banrisul.pdf b/manuais/BANRISUL/webservice/Banrisul.pdf new file mode 100644 index 00000000..f1ba0e09 Binary files /dev/null and b/manuais/BANRISUL/webservice/Banrisul.pdf differ diff --git a/manuais/BB/webservice/BancoDoBrasil.pdf b/manuais/BB/webservice/BancoDoBrasil.pdf new file mode 100644 index 00000000..e76b7eb4 Binary files /dev/null and b/manuais/BB/webservice/BancoDoBrasil.pdf differ diff --git a/manuais/CEF/webservice/Caixa.pdf b/manuais/CEF/webservice/Caixa.pdf new file mode 100644 index 00000000..5b16eb4e Binary files /dev/null and b/manuais/CEF/webservice/Caixa.pdf differ diff --git a/manuais/SANTANDER/webservice/Santander.pdf b/manuais/SANTANDER/webservice/Santander.pdf new file mode 100644 index 00000000..2e18573c Binary files /dev/null and b/manuais/SANTANDER/webservice/Santander.pdf differ diff --git a/src/Boleto/Render/cache/.gitignore b/src/Boleto/Render/cache/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/src/Boleto/Render/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/src/Boleto/Render/view/carne.blade.php b/src/Boleto/Render/view/carne.blade.php index bf552d6d..af43f701 100644 --- a/src/Boleto/Render/view/carne.blade.php +++ b/src/Boleto/Render/view/carne.blade.php @@ -1,6 +1,10 @@ @extends('BoletoHtmlRender::layout') @section('boleto') - + @foreach($boletos as $i => $boleto) @php extract($boleto, EXTR_OVERWRITE); @endphp
@@ -113,7 +117,7 @@
Corte na linha pontilhada
- @if(count($boletos) > 3 && $i > 0 && $i % 3 === 0) + @if(count($boletos) > 3 && $i > 0 && ($i+1) % 3 === 0)
@endif @endforeach diff --git a/src/Cnab/Remessa/AbstractRemessa.php b/src/Cnab/Remessa/AbstractRemessa.php index bc6f00c9..40cb7a5c 100644 --- a/src/Cnab/Remessa/AbstractRemessa.php +++ b/src/Cnab/Remessa/AbstractRemessa.php @@ -1,9 +1,10 @@ dataRemessa = $data; @@ -150,11 +152,13 @@ public function setDataRemessa($data){ /** * Retorna a data da remessa a ser gerada * - * @return \Carbon\Carbon; + * @param $format + * + * @return string; */ public function getDataRemessa($format){ if(is_null($this->dataRemessa)){ - return \Carbon\Carbon::now()->format($format); + return Carbon::now()->format($format); } return $this->dataRemessa->format($format); } @@ -364,6 +368,8 @@ public function getCarteiras() /** * Método que valida se o banco tem todos os campos obrigadotorios preenchidos * + * @param $messages + * * @return boolean */ public function isValid(&$messages) @@ -487,7 +493,7 @@ protected function valida(array $a) throw new \Exception('Classe remessa deve informar o tamanho da linha'); } - $a = array_filter($a, 'strlen'); + $a = array_filter($a, 'mb_strlen'); if (count($a) != $this->tamanho_linha) { throw new \Exception(sprintf('$a não possui %s posições, possui: %s', $this->tamanho_linha, count($a))); } diff --git a/src/Cnab/Remessa/Cnab240/Banco/Bancoob.php b/src/Cnab/Remessa/Cnab240/Banco/Bancoob.php index e3a5de0b..86193d85 100644 --- a/src/Cnab/Remessa/Cnab240/Banco/Bancoob.php +++ b/src/Cnab/Remessa/Cnab240/Banco/Bancoob.php @@ -68,7 +68,7 @@ class Bancoob extends AbstractRemessa implements RemessaContract * * @var null */ - protected $fimArquivo = "\r\n"; + protected $fimArquivo = "\n"; /** * @param BoletoContract $boleto @@ -146,7 +146,7 @@ protected function segmentoP(BoletoContract $boleto) $this->add(222, 223, Util::formatCnab('9', $boleto->getDiasProtesto(), 2)); $this->add(224, 224, '0'); $this->add(225, 227, ''); - $this->add(227, 229, '09'); + $this->add(228, 229, '09'); $this->add(230, 239, '0000000000'); $this->add(240, 240, ''); @@ -186,14 +186,14 @@ public function segmentoQ(BoletoContract $boleto) $this->add(152, 153, Util::formatCnab('X', $boleto->getPagador()->getUf(), 2)); $this->add(154, 154, '0'); $this->add(155, 169, '000000000000000'); - $this->add(170, 209, ''); + $this->add(170, 209, Util::formatCnab('X', '', 40)); $this->add(210, 212, '000'); - $this->add(213, 240, ''); + $this->add(213, 240, Util::formatCnab('X', '', 28)); if($boleto->getSacadorAvalista()) { $this->add(154, 154, strlen(Util::onlyNumbers($boleto->getSacadorAvalista()->getDocumento())) == 14 ? 2 : 1); $this->add(155, 169, Util::formatCnab('9', Util::onlyNumbers($boleto->getSacadorAvalista()->getDocumento()), 15)); - $this->add(170, 209, Util::formatCnab('X', $boleto->getSacadorAvalista()->getNome(), 30)); + $this->add(170, 209, Util::formatCnab('X', $boleto->getSacadorAvalista()->getNome(), 40)); } return $this; diff --git a/src/Cnab/Remessa/Cnab400/Banco/Bancoob.php b/src/Cnab/Remessa/Cnab400/Banco/Bancoob.php index 1eec0b2d..ff1679e7 100644 --- a/src/Cnab/Remessa/Cnab400/Banco/Bancoob.php +++ b/src/Cnab/Remessa/Cnab400/Banco/Bancoob.php @@ -120,6 +120,10 @@ public function setConvenio($convenio) return $this; } + /** + * @return $this|mixed + * @throws \Exception + */ protected function header() { $this->iniciaHeader(); @@ -128,7 +132,7 @@ protected function header() $this->add(2, 2, '1'); $this->add(3, 9, 'REMESSA'); $this->add(10, 11, '01'); - $this->add(12, 26, 'COBRANÇA '); + $this->add(12, 26, Util::formatCnab('X', 'COBRANÇA', 15)); $this->add(27, 30, Util::formatCnab('9', $this->getAgencia(), 4)); $this->add(31, 31, CalculoDv::bancoobAgencia($this->getAgencia())); $this->add(32, 40, Util::formatCnab('9', $this->getConvenio(), 9)); @@ -144,6 +148,12 @@ protected function header() return $this; } + /** + * @param BoletoContract $boleto + * + * @return mixed|void + * @throws \Exception + */ public function addBoleto(BoletoContract $boleto) { $this->boletos[] = $boleto; @@ -225,6 +235,10 @@ public function addBoleto(BoletoContract $boleto) $this->add(395, 400, Util::formatCnab('9', $this->iRegistros + 1, 6)); } + /** + * @return $this|mixed + * @throws \Exception + */ protected function trailer() { $this->iniciaTrailer(); diff --git a/src/Cnab/Remessa/Cnab400/Banco/Sicredi.php b/src/Cnab/Remessa/Cnab400/Banco/Sicredi.php index 5571b947..badbbe63 100644 --- a/src/Cnab/Remessa/Cnab400/Banco/Sicredi.php +++ b/src/Cnab/Remessa/Cnab400/Banco/Sicredi.php @@ -183,7 +183,7 @@ public function addBoleto(BoletoContract $boleto) $this->add(13, 21, Util::formatCnab('9', $boleto->getNossoNumero(), 9)); $this->add(22, 101, Util::formatCnab('X', $boleto->getInstrucoes()[0], 80)); $this->add(102, 181, Util::formatCnab('X', $boleto->getInstrucoes()[1], 80)); - $this->add(122, 261, Util::formatCnab('X', $boleto->getInstrucoes()[2], 80)); + $this->add(182, 261, Util::formatCnab('X', $boleto->getInstrucoes()[2], 80)); $this->add(262, 341, Util::formatCnab('X', $boleto->getInstrucoes()[3], 80)); $this->add(342, 351, Util::formatCnab('9', $boleto->getNumeroDocumento(), 10)); $this->add(352, 394, ''); diff --git a/src/Util.php b/src/Util.php index 1270dbd5..78496bba 100644 --- a/src/Util.php +++ b/src/Util.php @@ -823,7 +823,7 @@ public static function adiciona(&$line, $i, $f, $value) } $value = sprintf("%{$t}s", $value); - $value = preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY); + $value = preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY) + array_fill(0, $t, ''); return array_splice($line, $i, $t, $value); }