Exemple #1
0
$carne->addInstrucao(" ");
$carne->addInstrucao("MULTA DE R\$: 1,00 APÓS: 17/10/2015");
$carne->addInstrucao("JUROS DE R\$: 0,09 AO DIA");
$carne->addInstrucao(" ");
$carne->addInstrucao("NÃO RECEBER APÓS 10 DIAS DO VENCIMENTO");
$dataInicial = new DateTime('2015-09-01');
$boletosValidacao = [];
$i = 1;
while (10 != count($boletosValidacao)) {
    $dataVenciemento = clone $dataInicial;
    $parcela = new \Simonetti\Boleto\Carne\Parcela();
    $parcela->setValorBoleto('10,00');
    $parcela->setDataVencimento($dataVenciemento);
    $parcela->setNossoNumero($i);
    $parcela->setNumeroDocumento(100 + $i);
    $boletotmp = new \Simonetti\Boleto\Boleto();
    $boletotmp->setBanco($carne->getBanco());
    $boletotmp->setCedente($carne->getCedente());
    $boletotmp->setSacado($carne->getSacado());
    $boletotmp->setAvalista($carne->getAvalista());
    $boletotmp->setNumeroDocumento($parcela->getNumeroDocumento());
    $boletotmp->setNossoNumero($parcela->getNossoNumero());
    $boletotmp->setDataVencimento($parcela->getDataVencimento());
    $boletotmp->setDataDocumento($carne->getDataDocumento());
    $boletotmp->setDataProcessamento($carne->getDataProcessamento());
    $boletotmp->setNumeroMoeda($carne->getNumeroMoeda());
    $boletotmp->setValorBoleto($parcela->getValorBoleto());
    $boletotmp->setDemonstrativos($carne->getDemonstrativos());
    $boletotmp->setInstrucoes($carne->getInstrucoes());
    $linha = substr($boletotmp->gerarLinhaDigitavel(), 35, 1);
    if (!in_array($linha, $boletosValidacao)) {
<?php

require __DIR__ . '/../vendor/autoload.php';
$oBoleto = new \Simonetti\Boleto\Boleto();
$oBoleto->setBanco(new \Simonetti\Boleto\Banco\Bradesco());
$oBoleto->setNumeroMoeda("9");
$oBoleto->setDataVencimento(DateTime::createFromFormat('d/m/Y', "07/07/2014"));
$oBoleto->setDataDocumento(DateTime::createFromFormat('d/m/Y', "10/07/2014"));
$oBoleto->setDataProcessamento(DateTime::createFromFormat('d/m/Y', "10/07/2014"));
$oBoleto->addDemostrativo('Pagamento de Compra na Móveis Simonetti');
$oBoleto->addInstrucao("- Sr. Caixa, não receber após o vencimento");
$oBoleto->addInstrucao("- Pedido cancelado após o vencimento");
$oBoleto->addInstrucao("- Em caso de dúvidas entre em contato conosco: www.moveissimonetti.com.br");
$oBoleto->setValorBoleto("1200,00");
$oBoleto->setNossoNumero("50000012151");
$oBoleto->setNumeroDocumento("50000012151");
$oCedente = new \Simonetti\Boleto\Cedente();
$oCedente->setNome("Loja Moveis Mix");
$oCedente->setAgencia("1859");
$oCedente->setDvAgencia("7");
$oCedente->setConta("3176");
$oCedente->setDvConta("3");
$oCedente->setEndereco("Rua Carlos Castro, N&ordm; 245, Centro");
$oCedente->setCidade("Pinheiros");
$oCedente->setUf("ES");
$oCedente->setCpfCnpj("128.588.555-13");
$oBoleto->setCedente($oCedente);
$oSacado = new \Simonetti\Boleto\Sacado();
$oSacado->setNome("Vinicius Silva");
$oSacado->setTipoLogradouro("Rua");
$oSacado->setEnderecoLogradouro("Bartolomeu da Gama");