/** * Retorna o documento (CPF ou CNPJ) * * @return string */ public function getDocumento() { if ($this->getTipoDocumento() == 'CPF') { return Util::maskString(Util::onlyNumbers($this->documento), '###.###.###-##'); } if ($this->getTipoDocumento() == 'CNPJ') { return Util::maskString(Util::onlyNumbers($this->documento), '##.###.###/####-##'); } return $this->documento; }
public function TopoBB($i) { $this->SetFillColor(255, 255, 204); $this->SetDrawColor('00', '00', '80'); $this->Image($this->logoPath . $this->boleto[$i]->getBanco() . '.png', 20, $this->GetY() - 2, 28); $this->Cell(29, 6, '', ''); $this->SetFont('', '', 13); $this->Cell(15, 6, $this->boleto[$i]->getBanco(true), 'LR', 0, 'C'); $this->SetFont('', '', 10); $this->Cell(0, 6, $this->boleto[$i]->getLinha(), '', 1, 'R'); $this->Ln(1); $this->risco(); $this->Ln(1); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(75, $this->desc, $this->_('Beneficiário'), ''); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(35, $this->desc, $this->_('Agencia/Codigo do beneficiário'), ''); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(10, $this->desc, $this->_('Espécie'), ''); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(20, $this->desc, $this->_('Quantidade'), ''); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('Nosso Numero'), '', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->textFitCell(75, $this->cell, $this->_($this->boleto[$i]->getCedenteNome()), '', 0, 'L'); $this->Cell(35, $this->cell, $this->_($this->boleto[$i]->getAgenciaConta()), ''); $this->Cell(10, $this->cell, $this->_('R$'), ''); $this->Cell(20, $this->cell, $this->_('1'), ''); $this->Cell(30, $this->cell, $this->_($this->boleto[$i]->getNossoNumero()), '', 1, ''); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(50, $this->desc, $this->_('Número do Documento'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(40, $this->desc, $this->_('CPF/CNPJ'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('Vencimento'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(50, $this->desc, $this->_('Valor do Documento'), 'T', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(50, $this->cell, $this->_($this->boleto[$i]->getNumero()), ''); $this->Cell(40, $this->cell, $this->_(Util::maskString($this->boleto[$i]->getCedenteDocumento(), '##.###.###/####-##')), ''); $this->Cell(30, $this->cell, $this->_($this->boleto[$i]->getDataVencimento()->format('d/m/Y')), ''); $this->Cell(50, $this->cell, $this->_(Util::nReal($this->boleto[$i]->getValor())), '', 1, 'R'); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('(-) Descontos/Abatimentos'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('(-) Outras Deduções'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('(+) Mora Multa'), 'T'); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(30, $this->desc, $this->_('(+) Acréscimos'), 'T'); $x = $this->GetX(); $y = $this->GetY(); $this->Cell(50, $this->desc, $this->_('(=) Valor Cobrado'), 'T', 1, 'L', true); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(30, $this->cell, $this->_(''), ''); $this->Cell(30, $this->cell, $this->_(''), ''); $this->Cell(30, $this->cell, $this->_(''), ''); $this->Cell(30, $this->cell, $this->_(''), ''); $this->Cell(50, $this->cell, $this->_(''), '', 1, 'R', true); $this->riscoBB($x, $y); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->riscoBB($this->GetX(), $this->GetY()); $this->Cell(0, $this->desc, $this->_('Pagador'), 'T', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(0, $this->cell, $this->_($this->boleto[$i]->getSacadoNome()), 'B', 1); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(100, $this->desc, $this->_('Demonstrativo'), 0, 0, 'L'); $this->Cell(0, $this->desc, $this->_('Autenticação mecânica'), 0, 1, 'R'); $this->Ln(2); $pulaLinha = 16; $this->SetFont($this->PadraoFont, 'B', $this->fcel); if (count($this->boleto[$i]->getDemonstrativos()) > 0) { foreach ($this->boleto[$i]->getDemonstrativos() as $d) { $pulaLinha -= 2; $this->Cell(0, $this->cell, $this->_($d), 0, 1); } } $this->traco('Corte na linha pontilhada', $pulaLinha, 5); return $this; }
public function Bottom($i) { $this->Image($this->logoPath . $this->boleto[$i]->getBanco() . '.png', 20, $this->GetY() - 2, 28); $this->Cell(29, 6, '', 'B'); $this->SetFont($this->PadraoFont, 'B', 13); $this->Cell(15, 6, $this->boleto[$i]->getBanco(true), 'LBR', 0, 'C'); $this->SetFont($this->PadraoFont, 'B', 10); $this->Cell(0, 6, $this->boleto[$i]->getLinha(), 'B', 1, 'R'); $this->risco(); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(120, $this->desc, $this->_('Local de pagamento'), 'TLR'); $this->Cell(50, $this->desc, $this->_('Vencimento'), 'TR', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(120, $this->cell, $this->_($this->boleto[$i]->getLocalPagamento()), 'LR'); $this->Cell(50, $this->cell, $this->_($this->boleto[$i]->getDataVencimento()->format('d/m/Y')), 'R', 1, 'R'); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(120, $this->desc, $this->_('Beneficiário'), 'TLR'); $this->Cell(50, $this->desc, $this->_('Agência/Código beneficiário'), 'TR', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(60, $this->cell, $this->_($this->boleto[$i]->getCedenteNome()), 'L'); $this->Cell(60, $this->cell, $this->_('CPF/CNPJ - ' . Util::maskString($this->boleto[$i]->getCedenteDocumento(), sizeof($this->boleto[$i]->getCedenteDocumento()) > 11 ? '##.###.###/####-##' : '###.###.###-##')), 'R'); $this->Cell(50, $this->cell, $this->_($this->boleto[$i]->getAgenciaConta()), 'R', 1, 'R'); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(30, $this->desc, $this->_('Data do documento'), 'TLR'); $this->Cell(40, $this->desc, $this->_('Número do documento'), 'TR'); $this->Cell(15, $this->desc, $this->_('Espécie Doc.'), 'TR'); $this->Cell(10, $this->desc, $this->_('Aceite'), 'TR'); $this->Cell(25, $this->desc, $this->_('Data processamento'), 'TR'); $this->Cell(50, $this->desc, $this->_('Nosso número'), 'TR', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(30, $this->cell, $this->_($this->boleto[$i]->getDataDocumento()->format('d/m/Y')), 'LR'); $this->Cell(40, $this->cell, $this->_($this->boleto[$i]->getNumero()), 'R'); $this->Cell(15, $this->cell, $this->_($this->boleto[$i]->getEspecieDocumento()), 'R'); $this->Cell(10, $this->cell, $this->_($this->boleto[$i]->getAceite()), 'R'); $this->Cell(25, $this->cell, $this->_($this->boleto[$i]->getDataProcessamento()->format('d/m/Y')), 'R'); $this->Cell(50, $this->cell, $this->_($this->boleto[$i]->getNossoNumero()), 'R', 1, 'R'); $this->SetFont($this->PadraoFont, '', $this->fdes); if ($this->boleto[$i]->getBanco() == '033') { $this->Cell(55, $this->desc, $this->_('Carteira'), 'TLR'); } else { $this->Cell(30, $this->desc, $this->_('Uso do Banco'), 'TLR'); $this->Cell(25, $this->desc, $this->_('Carteira'), 'TR'); } $this->Cell(12, $this->desc, $this->_('Espécie'), 'TR'); $this->Cell(28, $this->desc, $this->_('Quantidade'), 'TR'); $this->Cell(25, $this->desc, $this->_('Valor Documento'), 'TR'); $this->Cell(50, $this->desc, $this->_('Valor Documento'), 'TR', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); if ($this->boleto[$i]->getBanco() == '033') { $this->TextFitCell(55, $this->cell, $this->_($this->boleto[$i]->getCarteira(true)), 'LR', 0, 'L'); } else { $this->Cell(30, $this->cell, $this->_(''), 'LR'); $this->Cell(25, $this->cell, $this->_(strtoupper($this->boleto[$i]->getCarteira())), 'R'); } $this->Cell(12, $this->cell, $this->_('R$'), 'R'); $this->Cell(28, $this->cell, $this->_('1'), 'R'); $this->Cell(25, $this->cell, $this->_(Util::nReal($this->boleto[$i]->getValor())), 'R'); $this->Cell(50, $this->cell, $this->_(Util::nReal($this->boleto[$i]->getValor())), 'R', 1, 'R'); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(120, $this->desc, $this->_('Instruções (Texto de responsabilidade do beneficiário)'), 'TLR'); $this->Cell(50, $this->desc, $this->_('(-) Desconto / Abatimentos)'), 'TR', 1); $xInstrucoes = $this->GetX(); $yInstrucoes = $this->GetY(); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(120, $this->cell, $this->_(''), 'LR'); $this->Cell(50, $this->cell, $this->_(''), 'R', 1); $this->Cell(120, $this->desc, $this->_(''), 'LR'); $this->Cell(50, $this->desc, $this->_('(-) Outras deduções'), 'TR', 1); $this->Cell(120, $this->cell, $this->_(''), 'LR'); $this->Cell(50, $this->cell, $this->_(''), 'R', 1); $this->Cell(120, $this->desc, $this->_(''), 'LR'); $this->Cell(50, $this->desc, $this->_('(+) Mora / Multa'), 'TR', 1); $this->Cell(120, $this->cell, $this->_(''), 'LR'); $this->Cell(50, $this->cell, $this->_(''), 'R', 1); $this->Cell(120, $this->desc, $this->_(''), 'LR'); $this->Cell(50, $this->desc, $this->_('(+) Outros acréscimos'), 'TR', 1); $this->Cell(120, $this->cell, $this->_(''), 'LR'); $this->Cell(50, $this->cell, $this->_(''), 'R', 1); $this->Cell(120, $this->desc, $this->_(''), 'LR'); $this->Cell(50, $this->desc, $this->_('(=) Valor cobrado'), 'TR', 1); $this->Cell(120, $this->cell, $this->_(''), 'BLR'); $this->Cell(50, $this->cell, $this->_(''), 'BR', 1); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(0, $this->desc, $this->_('Pagador'), 'LR', 1); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(60, $this->cell, $this->_($this->boleto[$i]->getSacadoNome()), 'L'); $this->Cell(0, $this->cell, $this->_('CPF/CNPJ - ' . Util::maskString($this->boleto[$i]->getSacadoDocumento(), sizeof($this->boleto[$i]->getSacadoDocumento()) > 11 ? '##.###.###/####-##' : '###.###.###-##')), 'R', 1); $endereco = explode('_', $this->boleto[$i]->getSacadoEndereco()); $this->Cell(60, $this->cell, $this->_($endereco[0]), 'L'); $this->Cell(0, $this->cell, $this->_(!empty($endereco[1]) ? 'CEP - ' . Util::maskString($endereco[1], '#####-###') : ""), 'R'); $this->Ln(); $this->Cell(60, $this->cell, $this->_($endereco[2]), 'L'); $this->Cell(0, $this->cell, $this->_($this->boleto[$i]->getSacadoCidadeUF()), 'R', 1); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(120, $this->cell, $this->_(''), 'BLR'); $this->Cell(12, $this->cell, $this->_('Cód. Baixa'), 'B'); $this->SetFont($this->PadraoFont, 'B', $this->fcel); $this->Cell(38, $this->cell, $this->_($this->boleto[$i]->getCodigoBaixa()), 'BR', 1); $this->SetFont($this->PadraoFont, '', $this->fdes); $this->Cell(118, $this->desc, $this->_('Pagador/Avalista'), 0); $this->Cell(52, $this->desc, $this->_('Autenticação mecânica - Ficha de Compensação'), 0, 1); $xOriginal = $this->GetX(); $yOriginal = $this->GetY(); if (count($this->boleto[$i]->getInstrucoes()) > 0) { $this->SetXY($xInstrucoes, $yInstrucoes); $this->Ln(4); $this->SetFont($this->PadraoFont, 'B', $this->fcel); foreach ($this->boleto[$i]->getInstrucoes() as $in) { $this->Cell(0, $this->cell, $this->_($in), 0, 1); } $this->SetXY($xOriginal, $yOriginal); } return $this; }
/** * Método que retorna o nosso numero usado no boleto. alguns bancos possuem algumas diferenças. * * @return string */ public function getNossoNumeroBoleto() { return Util::maskString($this->getNossoNumero(), '##/######-#'); }