Adiciona validação para rejeitar valores negativos no campo Capital S…#1087
Open
henriquercz wants to merge 1 commit intoportabilis:2.10from
Open
Adiciona validação para rejeitar valores negativos no campo Capital S…#1087henriquercz wants to merge 1 commit intoportabilis:2.10from
henriquercz wants to merge 1 commit intoportabilis:2.10from
Conversation
…ocial (portabilis#1074) - Cria método privado reutilizável validaValorPositivo() - Valida se o campo Capital Social contém apenas valores positivos ou zero - Aceita vírgula e ponto como separadores de decimal/milhar - Aplica validação tanto na criação quanto na edição de Pessoa Jurídica - Exibe mensagem de erro clara ao usuário
|
edineivaldameri
requested changes
Nov 4, 2025
| return true; | ||
| } | ||
|
|
||
| $valorNumerico = (float) str_replace(search: [',', '.'], replace: ['.', ''], subject: $valor); |
Collaborator
There was a problem hiding this comment.
Nesse caso o replace pode estar incorreto, porque um valor como 1.234,56 irá se transformar em 123456, quando na verdade deveria se tornar: 1234.56.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



DESCRIÇÃO:
Este pull request resolve a issue #1074 adicionando validação para rejeitar valores negativos no campo "Capital Social" no cadastro de Pessoa Jurídica.
Problema:
O sistema permitia o cadastro de valores negativos no campo "Capital Social", o que é funcionalmente incorreto, pois um capital social não pode ser negativo. Isso gera inconsistências graves em cálculos financeiros.
Solução Implementada:
Alterações:
Testes Realizados:
AMBIENTE: