All Projects → brazanation → Php Documents

brazanation / Php Documents

Library to provide Brazilian Documents as Value Objects in PHP

Projects that are alternatives of or similar to Php Documents

Gnome Cedilla Fix
A fix to make the Gnome "US-International" layouts generate a cedilla c (ç) when the user types '+c.
Stars: ✭ 106 (-46.19%)
Mutual labels:  brazil
Lexpredict Contraxsuite
LexPredict ContraxSuite
Stars: ✭ 140 (-28.93%)
Mutual labels:  documents
Scribd Downloader
Download documents, books and audiobooks off Scribd
Stars: ✭ 166 (-15.74%)
Mutual labels:  documents
Equivalentes Brasil Alemanha
equivalentes de comidas, lugares entre brasil e alemanha 🇧🇷🇩🇪
Stars: ✭ 114 (-42.13%)
Mutual labels:  brazil
Zephyr Doc
《Zephyr OS 文档 - 中文版》
Stars: ✭ 127 (-35.53%)
Mutual labels:  documents
Correios
A client library for Brazilian Correios APIs and services (SIGEP & SRO).
Stars: ✭ 153 (-22.34%)
Mutual labels:  brazil
Op Website Hugo
Projeto do Site https://OsProgramadores.com
Stars: ✭ 99 (-49.75%)
Mutual labels:  brazil
Catalogos Dados Brasil
Mapeamento de iniciativas (e catálogos) de dados abertos governamentais no Brasil.
Stars: ✭ 187 (-5.08%)
Mutual labels:  brazil
Awesome Brazil Data
Curated list of Brazilian datasets for anyone interested in studying the country.
Stars: ✭ 126 (-36.04%)
Mutual labels:  brazil
Open Semantic Etl
Python based Open Source ETL tools for file crawling, document processing (text extraction, OCR), content analysis (Entity Extraction & Named Entity Recognition) & data enrichment (annotation) pipelines & ingestor to Solr or Elastic search index & linked data graph database
Stars: ✭ 165 (-16.24%)
Mutual labels:  documents
Stevedore
search document dumps: ingest and explore in one extensible framework
Stars: ✭ 118 (-40.1%)
Mutual labels:  documents
Etherpad Lite
Etherpad: A modern really-real-time collaborative document editor.
Stars: ✭ 11,937 (+5959.39%)
Mutual labels:  documents
Mm Wiki
MM-Wiki 一个轻量级的企业知识分享与团队协同软件,可用于快速构建企业 Wiki 和团队知识分享平台。部署方便,使用简单,帮助团队构建一个信息共享、文档管理的协作环境。
Stars: ✭ 2,364 (+1100%)
Mutual labels:  documents
Enegrecer Web
Verdade Seja Dita!
Stars: ✭ 113 (-42.64%)
Mutual labels:  brazil
Web Client
Cryptee's web client source code for all platforms.
Stars: ✭ 174 (-11.68%)
Mutual labels:  documents
Pyzh
📚 一起写Python文章,一起看Python文章 - 利用readthedocs的Python技术文章的收集和翻译。
Stars: ✭ 1,387 (+604.06%)
Mutual labels:  documents
Svglib
Read SVG files and convert them to other formats.
Stars: ✭ 139 (-29.44%)
Mutual labels:  documents
Inspire Openlung
An [IN PROGRESS] open source, low cost, low resource, quick deployment ventilator design that utilizes a Ambu-bag as a core component. Another project into the "war" against COVID-19. [Repo in Potuguese]
Stars: ✭ 196 (-0.51%)
Mutual labels:  brazil
Doctree
Repository of Japanese Ruby reference manual
Stars: ✭ 184 (-6.6%)
Mutual labels:  documents
Templates
A set of standard document templates.
Stars: ✭ 1,953 (+891.37%)
Mutual labels:  documents

Brazanation Documents

Build Status Codacy Badge Scrutinizer Code Quality Code Coverage StyleCI

A PHP library to provide Brazilian Documents safer, easier and fun!

Installation

Install the library using composer. Add the following to your composer.json:

{
    "require": {
        "brazanation/documents": "2.0.*"
    }
}

Now run the install command.

$ composer.phar install

or

$ composer require brazanation/documents 2.0.*

CPF (cadastro de pessoas físicas)

Registration of individuals or Tax Identification

use Brazanation\Documents\Cpf;

$document = Cpf::createFromString('06843273173');
if (false === $document) {
   echo "Not Valid";
}
echo $document; // prints 06843273173
echo $document->format(); // prints 068.432.731-73

or

use Brazanation\Documents\Cpf;
use Brazanation\Documents\Exception\InvalidDocument as  InvalidDocumentException;

try {
    $document = new Cpf('06843273173');
    echo $document; // prints 06843273173
    echo $document->format(); // prints 068.432.731-73
} catch (InvalidDocumentException $e) {
    echo $e->getMessage();
}

CNPJ (cadastro nacional da pessoa jurídica)

Company Identification or National Register of Legal Entities

use Brazanation\Documents\Cnpj;

$document = Cnpj::createFromString('99999090910270');

if (false === $document) {
   echo "Not Valid";
}
echo $document; // prints 99999090910270
echo $document->format(); // prints 99.999.090/9102-70

CNH (carteira nacional de habilitação)

National Driving License

use Brazanation\Documents\Cnh;

$document = Cnh::createFromString('83592802666');

if (false === $document) {
   echo "Not Valid";
}
echo $document; // prints 83592802666
echo $document->format(); // prints 83592802666

Chave de Acesso Sped (chave da NFe, CTe e MDFe)

Sped Access Key

Available models:

  • NFe
  • NFCe
  • CTe
  • CTeOther
  • MDFe
use Brazanation\Documents\Sped\NFe;

$document = NFe::createFromString('52060433009911002506550120000007801267301613');

if (false === $document) {
   echo "Not Valid";
}
echo $document; // prints 52060433009911002506550120000007801267301613
echo $document->format(); // prints 5206 0433 0099 1100 2506 5501 2000 0007 8012 6730 1613

or generate your number

try {
    $nfeKey = NFe::generate(
        52,
        $generatedAt,
        new Cnpj('33009911002506'),
        12,
        780,
        EmissionType::normal(),
        26730161
    );
    echo $accessKey; // prints 52060433009911002506550120000007801267301613
}catch (InvalidDocumentException $e){
    echo $e->getMessage();
}

PIS/PASEP (programa de integração social e programa de formação do patrimônio do servidor público)

Social Integration Program and Training Program of the Heritage of Public Servant

use Brazanation\Documents\PisPasep;

$document = PisPasep::createFromString('518.23129.49-1');

if (false === $document) {
   echo "Not Valid";
}

echo $document; // prints 51823129491
echo $document->format(); // prints 518.23129.49-1

Título de Eleitor

Voter Registration

use Brazanation\Documents\Voter;

$document = Voter::createFromString('106644440302', 20, 42);

if (false === $document) {
   echo "Not Valid";
}

echo $document; // prints 106644440302
echo $document->getSection(); // prints 0020
echo $document->getZone(); // prints 042

Inscrição Estadual

State Registration

use Brazanation\Documents\StateRegistration;

// for Commercial São Paulo
$state = StateRegistration::SP('110.042.490.114');
echo $state; // prints 110042490114
echo $state->format(); // prints 110.042.490.114

// for Rural Producer São Paulo
$state = StateRegistration::SP('P011004243002');
echo $state; // prints P011004243002
echo $state->format(); // prints P-01100424.3/002

or

use Brazanation\Documents\StateRegistration;

$document = StateRegistration::createFromString('P011004243002', 'SP');

if (false === $document) {
   echo "Not Valid";
}

Cartão Nacional de Saúde (SUS)

National Health Card

use Brazanation\Documents\Cns;

$document = Cns::createFromString('242912018460005');

if (false === $document) {
   echo "Not Valid";
}

echo $document; // prints 242912018460005
echo $document->format(); // prints 242 9120 1846 0005

Renavam (Registro Nacional de Veículos Automotores)

National Registry of Motor Vehicles

use Brazanation\Documents\Renavam;

$document = Renavam::createFromString('61855253306');

if (false === $document) {
   echo "Not Valid";
}

echo $document; // prints 61855253306
echo $document->format(); // prints 6185.525330-6

Processos Judiciais

Numbers of legal proceedings related to Judiciary assessments

use Brazanation\Documents\JudiciaryProcess;

$document = JudiciaryProcess::createFromString('0048032982009809');

if (false === $document) {
   echo "Not Valid";
}

echo $document; //prints  0048032982009809
echo $document->format(); //prints  0048032.98.2009.8.09.0000

License

MIT, hell yeah!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].