Descontos Família Opcional
A tabela BG0 faz parte do sistema ERP Protheus da TOTVS e é utilizada para descontos família opcional.
Ela pertence ao dicionário de dados do Protheus (SX2) e armazena informações essenciais utilizadas em processos como cadastros, movimentações e integrações do sistema.
A tabela BG0 possui diversos campos (SX3), cada um com regras específicas como tipo, tamanho e validações, além de índices (SIX) que otimizam a performance das consultas.
Nesta página você pode consultar a estrutura completa da tabela BG0, incluindo todos os campos e índices relacionados.
| Propriedade | Valor |
|---|---|
| X2_CHAVE | BG0 |
| X2_PATH | \DATA\ |
| X2_ARQUIVO | BG0990 |
| X2_NOME | Descontos Família Opcional |
| X2_NOMESPA | Desuentos Familia Opcional |
| X2_NOMEENG | Optional family discounts |
| X2_ROTINA | - |
| X2_MODO | C |
| X2_MODOUN | E |
| X2_MODOEMP | E |
| X2_DELET | 0 |
| X2_TTS | - |
| X2_UNICO | - |
| X2_PYME | N |
| X2_MODULO | 33 |
| X2_DISPLAY | - |
| X2_SYSOBJ | - |
| X2_USROBJ | - |
| X2_POSLGT | 1 |
| X2_CLOB | 2 |
| X2_AUTREC | 2 |
| X2_TAMFIL | 2 |
| X2_TAMUN | 0 |
| X2_TAMEMP | 0 |
| X2_STAMP | 2 |
| X2_INSDT | 2 |
| D_E_L_E_T_ | - |
| R_E_C_N_O_ | 1142 |
| R_E_C_D_E_L_ | 0 |
| X3_ARQUIVO | X3_ORDEM | X3_CAMPO | X3_TIPO | X3_TAMANHO | X3_DECIMAL | X3_TITULO | X3_TITSPA | X3_TITENG | X3_DESCRIC | X3_DESCSPA | X3_DESCENG | X3_PICTURE | X3_VALID | X3_USADO | X3_RELACAO | X3_F3 | X3_NIVEL | X3_RESERV | X3_CHECK | X3_TRIGGER | X3_PROPRI | X3_BROWSE | X3_VISUAL | X3_CONTEXT | X3_OBRIGAT | X3_VLDUSER | X3_CBOX | X3_CBOXSPA | X3_CBOXENG | X3_PICTVAR | X3_WHEN | X3_INIBRW | X3_GRPSXG | X3_FOLDER | X3_PYME | X3_CONDSQL | X3_CHKSQL | X3_IDXSRV | X3_ORTOGRA | X3_IDXFLD | X3_TELA | X3_PICBRV | X3_AGRUP | X3_POSLGT | X3_MODAL | X3_CHKSUM | X3_ADDSUM | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BG0 | 01 | BG0_FILIAL | C | 2 | 0 | Filial | Sucursal | Branch | Filial do Sistema | Sucursal del Sistema | System Branch | - | - | x x x x x x x x x x x x x x x | - | - | 1 | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | 033 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19058 | 0 |
| BG0 | 02 | BG0_CODOPE | C | 4 | 0 | Cod. Operad. | Cod. Operad. | OperatorCode | Codigo Operadora | Codigo Operadora | Operator code | @! | - | x x x x x x x x x x x x x x x | - | - | 1 | - | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19059 | 0 |
| BG0 | 03 | BG0_CODEMP | C | 4 | 0 | Cod. Empresa | Cod. Empresa | Company Code | Codigo Empresa | Codigo Empresa | Company Code | @! | - | x x x x x x x x x x x x x x x | - | - | 1 | - | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19060 | 0 |
| BG0 | 04 | BG0_MATRIC | C | 6 | 0 | Matricula | Matricula | Registration | Matricula | Matricula | Registration | @! | - | x x x x x x x x x x x x x x x | - | - | 1 | - | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19061 | 0 |
| BG0 | 05 | BG0_CODOPC | C | 4 | 0 | Cd. Opcional | Cod Opcional | Option code | Codigo do Opcional | Codigo del Opcional | Option code | @! | - | x x x x x x x x x x x x x x x x | cCodOpc | - | 1 | xxxxxx x | - | - | - | S | V | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19062 | 0 |
| BG0 | 06 | BG0_VEROPC | C | 3 | 0 | Vs. Opcional | Vs. Opcional | Option Vers. | Versao do Opcional | Version del Opcional | Option version | @! | - | x x x x x x x x x x x x x x x x | cVerOpc | - | 1 | xxxxxx x | - | - | - | S | V | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19063 | 0 |
| BG0 | 07 | BG0_CODFOR | C | 3 | 0 | Forma Cobr. | Modal.Cobran | Collec. Mode | Modalidade de Cobranca | Modalidad de Cobranza | Collection mode | @! | - | x x x x x x x x x x x x x x x x | cCodFor | - | 1 | x | - | - | - | - | V | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 19064 | 0 |
| BG0 | 08 | BG0_CODFAI | C | 3 | 0 | Codigo | Codigo | Code | Codigo | Codigo | Code | @! | - | x x x x x x x x x x x x x x x x | If(Type('oBrwBBY')=="O",oBrwBBY:FieldGet("BBY_CODFAI"),"001") | - | 1 | xxxxxx x | - | - | - | - | V | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19065 | 0 |
| BG0 | 09 | BG0_TIPUSR | C | 1 | 0 | Tipo Usr. | Tipo Usuario | User type | Tipo de Usuario | Tipo de Usuario | User type | @! | - | x x x x x x x x x x x x x x x x | - | B47PLS | 1 | xxxxxx x | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19066 | 0 |
| BG0 | 10 | BG0_GRAUPA | C | 2 | 0 | Grau Parent. | Parentesco | Kinsh.Degree | Grau Parentesco | Parentesco | Kinship degree | @! | - | x x x x x x x x x x x x x x x x | - | B37PLS | 1 | xxxxxx x | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19067 | 0 |
| BG0 | 11 | BG0_PERCEN | N | 16 | 2 | Percentual | Porcent. | Percentage | Percentual | Porcentaje | Percentage | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxxx x | - | - | - | - | - | - | - | - | - | - | - | - | M->BG0_VALOR == 0 | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19068 | 0 |
| BG0 | 12 | BG0_VALOR | N | 16 | 2 | Valor | Valor | Amount | Valor | Valor | Amount | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxxx x | - | - | - | - | - | - | - | - | - | - | - | - | M->BG0_PERCEN == 0 | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19069 | 0 |
| BG0 | 13 | BG0_QTDDE | N | 3 | 0 | Qtd De | De Cantid. | FromQuantity | Quantidade de Usr. De | De Cantidad de Usr. | From number of users | 999 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxxx x | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19070 | 0 |
| BG0 | 14 | BG0_QTDATE | N | 3 | 0 | Qtd Ate | A Cantidad | To quantity | Quantidade de Usr. Ate | A Cantid. de Usuarios | To number of users | 999 | - | x x x x x x x x x x x x x x x x | 999 | - | 1 | xx | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 19071 | 0 |
| BG0 | 15 | BG0_TIPO | C | 1 | 0 | Tipo | Tipo | Type | Tipo | Tipo | Type | @! | - | x x x x x x x x x x x x x x x x | "1" | - | 1 | xx | - | - | - | - | - | - | - | - | 1=Desconto;2=Acrescimo | 1=Descuento;2=Incremento | 1=Discount;2=Increase | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 19072 | 0 |
| BG0 | 16 | BG0_AUTOMA | C | 1 | 0 | Automatico | Automatico | Automatic | Gerado Automaticamente ? | ¿Generado Automaticam.? | Generated automatically | @! | - | x x x x x x x x x x x x x x x x | "0" | - | 1 | xxxx x x | - | - | - | - | V | - | - | - | 1=Automatico;0=Informado Manualmente | 1=Automatico;0=Informado Manualmente | 1=Automatic;0=Manual | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 19073 | 0 |
| INDICE | ORDEM | CHAVE | DESCRICAO | DESCSPA | DESCENG | PROPRI | F3 | NICKNAME | SHOWPESQ | IX_VIRTUAL | IX_VIRCUST | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BG0 | 1 | BG0_FILIAL+BG0_CODOPE+BG0_CODEMP+BG0_MATRIC+BG0_CODOPC+BG0_VEROPC+BG0_CODFOR+BG0_CODFAI | Cod. Operad. + Cod. Empresa + Matricula + Cd. Opcional + Vs. Opcional | Cod. Operad. + Cod. Empresa + Matricula + Cod Opcional + Vs. Opcional | OperatorCode + Company Code + Registration + Option code + Option Vers | S | - | - | S | 2 | 3 | - | 2766 | 0 |
Ela é utilizada para descontos família opcional dentro do sistema ERP Protheus.
Nesta página você pode visualizar todos os campos, incluindo tipo, tamanho e validações.
Os índices são estruturas que melhoram a performance de busca e acesso aos dados dentro do Protheus.
Modelo de query gerado automaticamente com base na estrutura da tabela.
SELECT
BG0_FILIAL,
BG0_CODOPE,
BG0_CODEMP,
BG0_MATRIC,
BG0_CODOPC,
BG0_VEROPC,
BG0_CODFOR,
BG0_CODFAI,
BG0_TIPUSR,
BG0_GRAUPA,
BG0_PERCEN,
BG0_VALOR,
BG0_QTDDE,
BG0_QTDATE,
BG0_TIPO,
BG0_AUTOMA
FROM BG0
WHERE
D_E_L_E_T_ = ' '
AND BG0_FILIAL = 'VALOR'
AND BG0_CODOPE = 'VALOR'
AND BG0_CODEMP = 'VALOR'
AND BG0_MATRIC = 'VALOR'
AND BG0_CODOPC = 'VALOR'
AND BG0_VEROPC = 'VALOR'
AND BG0_CODFOR = 'VALOR'
AND BG0_CODFAI = 'VALOR'
AND BG0_TIPUSR = 'VALOR'
AND BG0_GRAUPA = 'VALOR'
AND BG0_PERCEN = 0
AND BG0_VALOR = 0
AND BG0_QTDDE = 0
AND BG0_QTDATE = 0
AND BG0_TIPO = 'VALOR'
AND BG0_AUTOMA = 'VALOR'