# PROC003 - Adição de segmento no cadastro de cliente/fornecedor

<table border="1" id="bkmrk-%C2%A0-projeto%2Fsistema%3Age" style="border-collapse: collapse; width: 100.123%; height: 68px;"><tbody><tr style="border-style: solid;"><td rowspan="3" style="width: 26.6667%; height: 68px; border-color: black; border-top-style: hidden; border-left-style: hidden; border-bottom-style: hidden;">  
[![image-1762776253666.png](https://docs.softensistemas.com.br/uploads/images/gallery/2025-11/scaled-1680-/image-1762776253666.png)](https://docs.softensistemas.com.br/uploads/images/gallery/2025-11/image-1762776253666.png)

</td><td style="width: 49.9999%; height: 10px; border-color: black; border-style: solid;"><span style="color: #000000;">**Projeto/Sistema:**</span>  
<span style="color: #000000;">Segmentos - GerencieAqui</span></td><td class="align-center" style="width: 23.3333%; height: 10px; border-color: black; border-style: solid;"><span style="color: #000000;">**Versão do *Template:***</span>  
<span style="color: #000000;">1.2</span></td></tr><tr style="border-style: solid;"><td style="width: 49.9999%; height: 29px; border-color: black; border-style: solid;"><span style="color: #000000;">**Processo:**</span>  
PROC003 - Adição de segmento no cadastro de cliente/fornecedor</td><td class="align-center" style="width: 23.3333%; height: 29px; border-color: black; border-style: solid;"><span style="color: #000000;">**Versão do Documento:**</span>  
<span style="color: #000000;">1.0</span></td></tr><tr style="border-style: solid;"><td style="width: 49.9999%; height: 29px; border-color: black; border-style: solid;"><span style="color: #000000;">**Responsável(eis):** </span>  
<span style="color: #000000;">Luís Leite</span></td><td class="align-center" style="width: 23.3333%; height: 29px; border-color: black; border-style: solid;"><span style="color: #000000;">**Data:** </span>

<span style="color: #000000;">05/02/2025</span>

</td></tr></tbody></table>

##### <span style="color: #000000;">**1. Introdução**</span>

<span style="color: #000000;">**Este processo visa exemplificar a documentação para a criação de SelectBox de segmento no cadastro do cliente.**</span>

<table cellpadding="9" cellspacing="0" id="bkmrk-processo-envolvidos-" style="width: 100%;" width="100%"><tbody><tr valign="top"><td bgcolor="#acb9ca" style="border-style: solid; border-color: black; width: 27%;" width="27%"><span style="font-size: small; color: #000000;">**Processo**</span>

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black; width: 19%;" width="19%"><span style="font-size: small; color: #000000;">**Envolvidos**</span>

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black; width: 27%;" width="27%"><span style="font-size: small; color: #000000;">**Dados de Entrada**</span>

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black; width: 27%;" width="27%"><span style="font-size: small; color: #000000;">**Dados de Saída**</span>

</td></tr><tr><td align="left" height="78" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">PROC001 - Tela de Cadastro de Segmento</span></span></td><td align="left" style="width: 19%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">-</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Cadastro de segmento</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Segmento salvo na base de dados</span></span></td></tr><tr><td align="left" height="78" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">PROC001.1 - Tela de Edição de Segmento</span></span></td><td align="left" style="width: 19%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">-</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Edição de segmento</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Segmento editado na base de dados</span></span></td></tr><tr><td align="left" height="59" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">PROC002 - Listagem de Segmento</span></span></td><td align="left" style="width: 19%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">-</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Informações filtradas</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Segmentos consultados</span></span></td></tr><tr><td align="left" height="116" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">PROC003 - Adição de segmento no cadastro de cliente/fornecedor</span></span></td><td align="left" style="width: 19%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">-</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Seleção de Segmento</span></span></td><td align="left" style="width: 27%; border-style: solid; border-color: black;"><span style="color: #000000;"><span style="font-family: Liberation Serif;">Segmento vinculado ao cliente na BD</span></span></td></tr></tbody></table>

#### **Processos Relacionados**

<span style="color: #3366ff;">[PROC001 - Tela de Cadastro de Segmento](https://docs.softensistemas.com.br/books/segmento-de-clientefornecedor/page/proc001-tela-de-cadastro-de-segmento)</span>

<span style="color: #3366ff;">[<span style="font-family: Liberation Serif;">PROC002 - Listagem de Segmento</span>](https://docs.softensistemas.com.br/books/segmento-de-clientefornecedor/page/proc002-listagem-de-segmento)</span>

#### **Especificação Funcional**

- - - - - -

#### **PROC003 - ADIÇÃO DE SEGMENTO NO CADASTRO DE CLIENTE/FORNECEDOR:**

##### ***Protótipo de Tela:***

[![image-1764684922519.png](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/scaled-1680-/image-1764684922519.png)](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/image-1764684922519.png)

Imagem I - Seleção de Segmento de Atividade

[![image-1764684757154.png](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/scaled-1680-/image-1764684757154.png)](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/image-1764684757154.png)

imagem II - Caixa de Seleção aberta

##### ***Descrição dos Campos:***

<table border="1" cellpadding="7" cellspacing="0" id="bkmrk-campo-tipo-tamanho-o" style="width: 843px;"><tbody><tr valign="top"><td bgcolor="#acb9ca" style="width: 168px; border-style: solid; border-color: black;"><span style="color: #000000;">**Campo**</span>

</td><td bgcolor="#acb9ca" style="width: 102px; border-style: solid; border-color: black;"><span style="color: #000000;">**Tipo**</span>

</td><td bgcolor="#acb9ca" style="width: 88px; border-style: solid; border-color: black;"><span style="color: #000000;">**Tamanho**</span>

</td><td bgcolor="#acb9ca" style="width: 165px; border-style: solid; border-color: black;"><span style="color: #000000;">**Obrig. ?**</span>

</td><td bgcolor="#acb9ca" style="width: 119px; border-style: solid; border-color: black;"><span style="color: #000000;">**Máscara**</span>

</td><td bgcolor="#acb9ca" style="width: 201px; border-style: solid; border-color: black;"><span style="color: #000000;">**Observações**</span>

</td></tr><tr><td style="width: 168px; border-style: solid; border-color: black;"><span style="color: #000000;">Segmento de Atividade</span>

</td><td style="width: 102px; border-style: solid; border-color: black;"><span style="color: #000000;">Caixa de Seleção</span>

</td><td style="width: 88px; border-style: solid; border-color: black;"><span style="color: #000000;">-</span>

</td><td style="width: 165px; border-style: solid; border-color: black;"><span style="color: #000000;">-</span>

</td><td style="width: 119px; border-style: solid; border-color: black;">-

</td><td style="width: 201px; border-style: solid; border-color: black;">-

</td></tr></tbody></table>

##### ***Regras de Interface:***

***1. Segmento de Atividade:***

Deve conter o *placeholder* "Selecione o segmento".  
Devem ser listados apenas os segmentos ativos.  
Caso o cadastro for inativado e vinculado a um cliente, ainda deve permanecer em exibição no cadastro do cliente. Não sendo mais exibido em novas seleções do segmento no cadastro.  
O valor padrão é "em branco". Deve ser possível selecionar o valor vazio novamente, caso seja necessário limpar um valor selecionado.

##### ***Regras de Negócio:***

**1** O botão [![image-1764685515310.png](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/scaled-1680-/image-1764685515310.png)](https://docs.softensistemas.com.br/uploads/images/gallery/2025-12/image-1764685515310.png) Deve permitir o cadastro de novos segmentos diretamente pelo módulo, dando sequência com o PROC001 - Tela de Cadastro de Segmento.

##### ***Questões Técnicas:***

***1.*** As informações devem ser consultadas na tabela:

```SQL
SELECT * FROM segmentosclientes WHERE empresa = 'x'
```

***2.*** Deve ser criado uma nova coluna na tabela de cadastro de clientes para armazenar o código do segmento:

```SQL
ALTER TABLE cliente 
    ADD COLUMN segmento BIGINT,
    ADD CONSTRAINT fk_cliente_seguimento 
        FOREIGN KEY (segmento) REFERENCES segmentosclientes(id);
```

**3.** Deve seguir o esquema de cores:

<table border="1" cellpadding="7" cellspacing="0" class="align-center" id="bkmrk-gerencieaqui-campo-c"><tbody><tr><td colspan="2" style="border-style: solid; border-color: black;">**GerencieAqui**

</td></tr><tr valign="top"><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Campo**

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Cód. Hexadecimal**

</td></tr><tr><td style="border-style: solid; border-color: black;">Label dos campos

</td><td style="border-style: solid; border-color: black;">\#044572

</td></tr><tr><td style="border-style: solid; border-color: black;">Placeholder

</td><td style="border-style: solid; border-color: black;">\#505050 50%

</td></tr></tbody></table>

<table border="1" cellpadding="7" cellspacing="0" class="align-center" id="bkmrk-aplicativo-empresari"><tbody><tr><td colspan="2" style="border-style: solid; border-color: black;">**Aplicativo Empresarial**

</td></tr><tr valign="top"><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Campo**

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Cód. Hexadecimal**

</td></tr><tr><td style="border-style: solid; border-color: black;">Label dos campos

</td><td style="border-style: solid; border-color: black;">\#621FA4

</td></tr><tr><td style="border-style: solid; border-color: black;">Placeholder

</td><td style="border-style: solid; border-color: black;">\#505050 50%

</td></tr></tbody></table>

<table border="1" cellpadding="7" cellspacing="0" class="align-center" id="bkmrk-emissor-nota-campo-c"><tbody><tr><td colspan="2" style="border-style: solid; border-color: black;">**Emissor Nota**

</td></tr><tr valign="top"><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Campo**

</td><td bgcolor="#acb9ca" style="border-style: solid; border-color: black;">**Cód. Hexadecimal**

</td></tr><tr><td style="border-style: solid; border-color: black;">Label dos campos

</td><td style="border-style: solid; border-color: black;">\#E0650D

</td></tr><tr><td style="border-style: solid; border-color: black;">Placeholder

</td><td style="border-style: solid; border-color: black;">\#505050 50%

</td></tr></tbody></table>

©SOFTEN SISTEMAS 2025