FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add CNPJ alphanumeric by pedrofirmiano-stark · Pull Request #41 · starkbank/febraban-python · GitHub

Add CNPJ alphanumeric - #41

Open
pedrofirmiano-stark wants to merge 1 commit into
feature/bradescofrom
feature/cnpj-alphanumeric
Open

Add CNPJ alphanumeric#41
pedrofirmiano-stark wants to merge 1 commit into
feature/bradescofrom
feature/cnpj-alphanumeric

Conversation

Copy link
Copy Markdown

No description provided.

pedrofirmiano-stark changed the base branch from master to feature/bradesco July 6, 2026 22:28
Comment thread febraban/cnab240/row.py
charactersType=type,
numberOfCharacters=len,
defaultCharacter={numeric: "0", alphaNumeric: " "}[type]
defaultCharacter={numeric: "0", alphaNumeric: " ", alphaNumericRightAligned: "0"}[type]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

para alfanumerico é para completar com espaço e não com zero. Zero é usado somente para o numerico

structs = [
(17, 18, 1, numeric, "1" if len(user.identifier) == 11 else "2"), # 1 - CPF/ 2 - CNPJ
(18, 33, 15, numeric, user.identifier), # CPF/CNPJ do Pagador
(18, 33, 15, alphaNumericRightAligned, user.identifier), # CPF/CNPJ do Pagador

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

comentario desalinhado

structs = [
(153, 154, 1, numeric, "1" if len(user.identifier) == 11 else "2"), # 1 - CPF/ 2 - CNPJ
(154, 169, 15, numeric, user.identifier), # CPF/CNPJ do Sacador Avalista
(154, 169, 15, alphaNumericRightAligned, user.identifier), # CPF/CNPJ do Sacador Avalista

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

alinhar o comentario

Comment thread febraban/cnab240/row.py
"""
if type(string) != str: return defaultCharacter * numberOfCharacters
if len(string) > numberOfCharacters: return string[:numberOfCharacters]
if charactersType == numeric: return defaultCharacter * (numberOfCharacters - len(string)) + string

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

porque foi removido essa condicional ?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL