Páginas filhas
  • API - Documentação Técnica - Histórico de Encargos

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Foi criada a API para uso dos produtos de do produto TOTVS Folha de Pagamento das linhas RM, Datasul e Protheus, que será utilizada na nova tela "Histórico de Encargos", desenvolvida em Smart UI. Esta tela oferece novos recursos visuais e funcionais do Histórico de Encargos que já conhecíamos anteriormente.

...

Expandir
titleSchema

Endpoint:  /api/rh/v1/HistoricoProvisaoHistoricoEncargo/Schema
Método:
GET
Objetivo: 
Retornar o Schema utilizado neste endpoint, com propriedades e tipos de dados

Expandir
titleExemplo de Retorno

{
    "title": "Histórico de EncargosEncargo",
    "version": "1.0",
    "identifier": "ProvisionHistoryHistoricoEncargo",
    "fields": [
        {
            "layoutDefinition": [
                {
                    "visible": false,
                    "componentType": "TableLayout"
                },
                {
                    "visible": false,
                    "componentType": "EditLayout"
                },
                {
                    "visible": false,
                    "componentType": "DetailLayout"
                }
            ],
            "key": true,
            "property": "codigoColigadacodColigada",
            "label": "Coligada",
            "disabled": true,
            "visible": false,
            "type": "string",
            "componentType": "Input"
        },
        {
            "quickFilter": true,
            "layoutDefinitioncolumns": [
                {
                    "fieldLabel": false,
                    "orderlabel": 1"Chapa",
                    "componentTypeproperty": "TableLayoutchapa"
                },
                {
                    "gridColumnsfieldLabel": 2false,
                    "componentTypelabel": "EditLayoutNome",
                },
          "property": "nome"
      {          }
            ],
            "gridColumnsrequired": 2true,
                    "componentTypesearchService": "DetailLayout"/api/rh/v1/chapa",
            "format": [
    }
            ]"chapa",
                "keynome":true,
            "property":"ano"],
            "labelfieldLabel": "Anonome",
            "typefieldValue": "stringchapa",
            "componentTypelayoutDefinition": "Input"[
        },
        {
            "quickFilter":true,
              "optionsgridColumns": [5,
                {
                    "value":1,"componentType": "EditLayout"
                },
    "label":"Janeiro"
            {
    },
                {"gridColumns": 3,
                    "valuevisible": 2false,
                    "labelcomponentType": "FevereiroDetailLayout"
                },
                {
                    "valueorder": 31,
                    "labelcomponentType": "MarçoFilterLayout"
                },
                {
    ],
                "valueclean": 4true,
                    "labelnoAutoComplete": "Abril"true,
                }"key": true,
                {
        "property": "chapa",
            "valuelabel": 5"Matrícula",
                    "labelcomponentType": "MaioLookup"
        },
        {
        },    "layoutDefinition": [
                {
                    "valuevisible": 6false,
                    "labelcomponentType": "JunhoEditLayout"
                },
                {
                    "valuecomponentType": 7,"TableLayout"
                    "label":"Julho"
                },
                {
                    "valuegridColumns": 85,
                    "labelcomponentType": "AgostoDetailLayout"
                },
            ],
    {
        "property": "nome",
            "valuelabel": 9"Nome da pessoa colaboradora",
            "disabled": true,
            "labeltype": "Setembrostring",
            "componentType": "Input"
        },
                {
                    "valuequickFilter": 10true,
                    "labelcolumns": "Outubro"[
                },{
                  {  "fieldLabel": false,
                    "valuelabel": 11"Código",
                    "labelproperty": "Novembrocodigo"
                },
                {
                    "valuefieldLabel": 12false,
                    "label": "DezembroDescrição",
                }
            ],
            "layoutDefinition":["property": "descricao"
                {}
            ],
            "widthColumnTablerequired": 60true,
                    "componentTypesearchService": "TableLayout"/api/rh/v1/encargo",
            "format": [
          }      "codigo",
                {"descricao"
            ],
            "gridColumnsfieldLabel": 2"descricao",
                    "componentTypefieldValue": "EditLayoutcodigo",
                "layoutDefinition": [},
                {
                    "gridColumns": 25,
                    "componentType": "DetailLayoutEditLayout"
                },
            ],
    {
        "forceOptionsComponentType":"select",
            "keygridColumns": true3,
            "property        "visible": "mes"false,
            "label":"Mês",
            "componentType": "SelectDetailLayout"
                },
                {
            "quickFilter":true,
            "columnscomponentType": ["TableLayout"
                {},
                    "fieldLabel":false,{
                    "labelorder": "Chapa"1,
                    "propertycomponentType": "chapaFilterLayout"
                },
                {
        ],
            "fieldLabelclean": falsetrue,
            "noAutoComplete": true,
            "labelkey": "Nome"true,
                    "property": "nome"
                }
            ]codEncargo",
            "requiredlabel": true"Código do Encargo",
            "searchServicecomponentType": "/api/rh/v1/chapa"Lookup",
        },
    "format":[
    {
            "chapalayoutDefinition",: [
                "nome"{
            ],
            "fieldLabel":"nome",
            "fieldValue":"chapa",
            "layoutDefinition":[
                {
                    "gridColumns":8visible": false,
                    "componentType": "EditLayout"
                },
                {
                    "gridColumnsorder": 83,
                    "componentType": "DetailLayout"
                }
            ],
            "cleanproperty": true"descricao",
            "noAutoCompletelabel": true"Descrição",
            "keydisabled": true,
            "propertytype": "chapastring",
            "label ":"Funcionário",
            "componentType": "LookupInput"
        },
        {
            "formatquickFilter": "dd/MM/yyyy"true,
            "layoutDefinition": [
                {
                    "gridColumns":4,
                    "divider":"Provisão de Férias"order": 1,
                    "componentType": "EditLayoutTableLayout"
                },
                {
                    "widthColumnTablegridColumns": 1201,
                    "componentType": "TableLayoutEditLayout"
                },
                {
                    "gridColumns": 41,
                    "dividercomponentType": "Provisão de FériasDetailLayout",
                    "componentType":"DetailLayout"}
                ],}
            ]"key": true,
            "property": "dataVencimentoFeriasanoComp",
            "label": "Data de vencimento fériasAno",
            "type": "datestring",
            "componentType": "DatePickerInput"
        },
        {
            "decimalsLengthquickFilter": 2true,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition"options": [
                {
                    "gridColumnsvalue": 41,
                    "componentTypelabel": "EditLayoutJaneiro"
                },
                {
                    "gridColumnsvalue": 42,
                    "componentTypelabel": "DetailLayoutFevereiro"
                },
                {
                    "componentTypevalue": "TableLayout"3,
                }
    "label": "Março"
        ]        },
            "locale":"pt-BR",
    {
        "property":"valorPagoFeriasMes",
            "labelvalue": "Valor pago Férias Mês"4,
                    "typelabel": "currencyAbril",
            "componentType":"Decimal"    },
        },
        {
            "decimalsLength":2,
            "thousandMaxlengthvalue": 65,
                    "minValuelabel": "0.00Maio",
            "layoutDefinition":[    },
                {
                    "gridColumnsvalue": 46,
                    "componentTypelabel": "EditLayoutJunho"
                },
                {
                    "gridColumnsvalue": 47,
                    "componentTypelabel": "DetailLayoutJulho"
                },
                {
                    "value": 8,
                    "componentTypelabel": "TableLayoutAgosto"
                },
              ],  {
                    "propertyvalue": "valorProvisaoFeriasEmDobro"9,
                    "label": "Valor provisão férias em DobroSetembro",
                "type":"currency"},
            "componentType":"Decimal"
        {},
        {
            "decimalsLengthvalue": 210,
            "thousandMaxlength":6,
            "minValuelabel": "0.00Outubro",
            "layoutDefinition":[    },
                {
                    "gridColumnsvalue": 411,
                    "componentTypelabel": "EditLayoutNovembro"
                },
                {
                    "gridColumnsvalue": 412,
                    "componentTypelabel": "DetailLayoutDezembro"
                },
                ],{
                    "componentTypelayoutDefinition": "TableLayout"[
                }{
            ],
            "propertywidthColumnTable": "avosFeriasVencidos"60,
            "label":"Avos férias vencidos",
            "typecomponentType": "currencyTableLayout",
              "componentType":"Decimal"  },
        },
        {
            "decimalsLength":2,
            "thousandMaxlengthgridColumns": 61,
            "minValue":"0.00",
            "layoutDefinitioncomponentType": ["EditLayout"
                },
                {
                    "gridColumns": 41,
                    "componentType": "EditLayoutDetailLayout"
                },
            ],
    {
        "forceOptionsComponentType": "select",
            "gridColumnskey": 4true,
                    "componentTypeproperty": "DetailLayoutmesComp",
                }"label": "Mês",
                {
                    "componentType": "TableLayoutSelect"
        },
        }{
            ]"decimalsLength": 2,
            "propertythousandMaxlength": "mediasFeriasVencidas"6,
            "labelminValue": "Médias férias vencidas0.00",
            "typelayoutDefinition": "currency",[
            "componentType":"Decimal"
        {},
        {
            "decimalsLengthgridColumns": 26,
            "thousandMaxlength":6,
            "minValuecomponentType": "0.00EditLayout",
            "layoutDefinition":[    },
                {
                    "gridColumns": 46,
                    "componentType": "EditLayoutDetailLayout"
                },
                {
                    "gridColumnscomponentType": 4,
"TableLayout"
                }
          "componentType":"DetailLayout"
                }  ],
                {
                    "componentType"locale": "TableLayout"
                }
            ]pt-BR",
            "property": "valorProvisaoFeriasVencidasbaseEncargo",
            "label": "Valor provisão férias vencidasBase do Encargo",
            "type": "currency",
            "componentType": "Decimal"
        },
        {
            "decimalsLength": 2,
            "thousandMaxlength": 6,
            "minValue": "0.00",
            "layoutDefinition": [
                {
                    "gridColumns": 46,
                    "componentType": "EditLayout"
                },
                {
                    "gridColumns": 46,
                    "componentType": "DetailLayout"
                },
                {
                    "componentType": "TableLayout"
                }
            ],
            "propertylocale": "avosFeriasProporcionaispt-BR",
            "labelproperty": "Avos férias proporcionaisvalor",
            "typelabel": "decimalValor Nominal",
            "componentTypetype": "Decimal"
        }currency",
        {
            "decimalsLengthcomponentType": 2,"Decimal"
            "thousandMaxlength":6},
            "minValue":"0.00",{
            "layoutDefinition": [
                {
                    "gridColumnsvisible": 4false,
                    "componentType": "EditLayoutTableLayout"
                },
            ],
    {
        "property": "aplicacao",
            "gridColumnslabel": 4"Aplicacao",
                    "componentTypedisabled": "DetailLayout"true,
                },
                {
                    "componentType":"TableLayout"
                }
            ]"visible": false,
            "propertytype": "mediasFeriasProporcionaisstring",
            "labelcomponentType": "Médias férias proporcionaisInput",
        }
    "type":"currency"],
            "componentTypegroups": "Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"valorProvisaoFeriasProporcionais",
            "label":"Valor provisão férias proporcionais",
            "type":"currency",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"valorAbatimentoFerias",
            "label":"Valor abatimento férias",
            "type":"currency",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"valorSemAbatimentoFerias",
            "label":"Valor sem abatimento férias",
            "type":"currency",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"valorProvisaoFerias",
            "label":"Valor provisão férias",
            "type":"currency",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "divider":"Provisão de 13º Salário",
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "divider":"Provisão de 13º Salário",
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"avos13",
            "label":"Avos 13º",
            "type":"decimal",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"medias13Salario",
            "label":"Médias 13º salário",
            "type":"currency",
            "componentType":"Decimal"
        },
        {
            "decimalsLength":2,
            "thousandMaxlength":6,
            "minValue":"0.00",
            "layoutDefinition":[
                {
                    "gridColumns":4,
                    "componentType":"EditLayout"
                },
                {
                    "gridColumns":4,
                    "componentType":"DetailLayout"
                },
                {
                    "componentType":"TableLayout"
                }
            ],
            "property":"valorProvisao13",
            "label":"Valor provisão 13º",
            "type":"currency",
            "componentType":"Decimal"
        }
    ],
    "groups":[]
}[]
}

Expandir
titleInclusão de Registro

Endpoint:  //api/rh/v1/HistoricoEncargo/
Método:
POST
Objetivo: 
Incluir registros no Histórico da Encargos de maneira manual, não necessitando do processo de geração de Histórico de Encargos.

Expandir
titleExemplo de requisição

{
  "chapa": "00002",
  "codEncargo": "015",
  "anoComp": "2026",
  "mesComp": 3,
  "baseEncargo": 200,
  "valor": 250
}

Expandir
titleExemplo de Retorno

Status Code: 201 Created

Expandir
titleInclusão de Registro
Endpoint:  /api/rh/v1/HistoricoProvisao/
Método:
POST
Objetivo: 
Incluir registros no Histórico da provisão de maneira manual, não necessitando do processo de geração de Histórico de Encargos.
Expandir
titleExemplo de requisição

{
  "codigoColigada": 1,
  "ano": 2024,
  "mes": 7,
  "chapa": "F0002",
  "dataVencimentoFerias": "2025-02-01T00:00:00-03:00",
  "valorPagoFeriasMes": 0,
  "valorProvisaoFeriasEmDobro": 210.46,
  "avosFeriasVencidos": 24,
  "mediasFeriasVencidas": 150,
  "valorProvisaoFeriasVencidas": 960,
  "avosFeriasProporcionais": 9.85,
  "mediasFeriasProporcionais": 0,
  "valorProvisaoFeriasProporcionais": 110.23,
  "valorAbatimentoFerias": 1083.8,
  "valorSemAbatimentoFerias": 1083.8,
  "valorProvisaoFerias": 4400.97,
  "avos13": 9.9,
  "medias13Salario": 15.96,
  "valorProvisao13": 792
}

Expandir
titleExemplo de Retorno

Status Code: 201 Created
{
    "codigoColigada":1,
    "ano":2024,
    "mes":7,
    "chapa":"F0002",
    "dataVencimentoFerias":"2025-02-01T00:00:00-03:00",
    "valorPagoFeriasMes":0.0,
    "valorProvisaoFeriasEmDobro":210.46,
    "avosFeriasVencidos":24.0,
    "mediasFeriasVencidas":150.0,
    "valorProvisaoFeriasVencidas":960.0,
    "avosFeriasProporcionais":9.85,
    "mediasFeriasProporcionais":0.0,
    "valorProvisaoFeriasProporcionais":110.23,
    "valorAbatimentoFerias":1083.8,
    "valorSemAbatimentoFerias":1083.8,
    "valorProvisaoFerias":4400.97,
    "avos13":9.9,
    "medias13Salario":15.96,
    "valorProvisao13":792.0{
    "codColigada": 1,
    "chapa": "00002",
    "codEncargo": "015",
    "anoComp": 2026,
    "mesComp": 3,
    "baseEncargo": 200.0,
    "valor": 250.0,
    "aplicacao": "P"

}

Expandir
titleExemplo de utilização

Para análise rápida, importe a seguinte collection no Postman:

View file
nameHistoricoProvisaoHistoricoEncargo API.postman_collection.json
height150


Para a utilização da collection, podemos utilizar um mock, para melhor visualização da API, basta importar o seguinte arquivo .json, usando a ferramenta Mockoon, basta importar o enviroment na ferramenta e iniciar o servidor:

View file
namemock_historicodados_dissidio_provisaodelete.json
height150


Expandir
titleEdição de Registro

Endpoint:   /api/rh/v1/HistoricoProvisao/CODCOLIGADA %7C ANOCOMP %7C MESCOMP %7C  CHAPAHistoricoEncargo/1%7CA0004%7C015%7C2011%7C10 ( Este end point é dinâmico, onde o que se mantém sempre é %7C e o que sempre se altera são as informações CODCOLIGADA / CHAPA / CODENCARGO / ANOCOMP / MESCOMP / CHAPA   )
Exemplo de requisição com Endpoint montado:
/api/rh/v1/HistoricoProvisao/1%7C1998%7C2%7C00004
MESCOMP  )

Método:  PUT

Objetivo: Alterar um registro já incluido anteriormente

Expandir
titleExemplo de requisição

{
    "codigoColigadacodColigada": 1,
    "ano": 1998,
    "mes": 2,
    "chapa": "00003A0004",
    "dataVencimentoFeriasnome": "1997-08-14T00:00:00-03:00FL LANÇAMENTO FINANCEIRO PROXIMO MÊS FUNCIONÁRIO AFASTADO TIPO T",
    "valorPagoFeriasMescodEncargo": 0"015",
    "valorProvisaoFeriasEmDobrodescricao": 15"FGTS AFASTAMENTO DO TIPO T",
    "avosFeriasVencidosanoComp": 122011,
    "mediasFeriasVencidasmesComp": 20010,
    "valorProvisaoFeriasVencidasbaseEncargo": 01102,
    "avosFeriasProporcionaisvalor": 688.4,
    "mediasFeriasProporcionaisaplicacao": 0"P",
    "valorProvisaoFeriasProporcionaislinks": 0,
[
    {
      "valorAbatimentoFeriasrelation": 4400.97"RateioEncargosCC",
      "valorSemAbatimentoFeriasapiMetaData": 4400.97"api/rh/v1/RateioEncargoCC/schema",
      "valorProvisaoFeriasapiData": 4400.97"api/rh/v1/RateioEncargoCC/",
      "avos13": 2apiDataFilter": "?$filter=codColigada eq 1 and chapa eq 'A0004' and anoComp eq 2011 and mesComp eq 10 and codEncargo eq '015'",
      "medias13Salariotype": 0"RelatedItems",
      "valorProvisao13": 323.18
}

Expandir
titleExemplo de Retorno

Status Code: 200  OK
label": "Rateio de Encargo por Centro de Custo",
      "mapper": {
        "codigoColigadaanoComp": 1"2011",
        "anomesComp": 1998"10",
        "mescodColigada": 2"1",
        "chapacodEncargo": "00003015",
        "dataVencimentoFeriaschapa": "1997-08-14T00:00:00-03:00"A0004"
      }
    }
  ]
}


Expandir
titleExemplo de Retorno

Status Code: 200  OK

{,
    "valorPagoFeriasMes":0.0,
    "valorProvisaoFeriasEmDobrocodColigada": 15.01,
    "avosFeriasVencidoschapa": 12.0,
    "mediasFeriasVencidas":200.0"A0004",
    "valorProvisaoFeriasVencidasnome": 0.0,
    "avosFeriasProporcionais":6.0"FL LANÇAMENTO FINANCEIRO PROXIMO MÊS FUNCIONÁRIO AFASTADO TIPO T",
    "mediasFeriasProporcionaiscodEncargo": 0.0,
    "valorProvisaoFeriasProporcionais":0.0"015",
    "valorAbatimentoFeriasdescricao": 4400.97"FGTS AFASTAMENTO DO TIPO T",
    "valorSemAbatimentoFeriasanoComp": 4400.972011,
    "valorProvisaoFeriasmesComp": 4400.9710,
    "avos13baseEncargo": 21102.0,
    "medias13Salariovalor": 088.04,
    "valorProvisao13aplicacao": 323.18"P"
}

Expandir
titleExemplo de utilização

Para análise rápida, importe a seguinte collection no Postman:

View file
nameHistoricoProvisaoUpdateHistoricoEncargo Update.postman_collection.json
height150


Para a utilização da collection, podemos utilizar um mock, para melhor visualização da API, basta importar o seguinte arquivo .json, usando a ferramenta Mockoon, basta importar o enviroment na ferramenta e iniciar o servidor:

View file
namemock_historico_provisaoencargos_updateput.json
height150


Expandir
titleExclusão de Registro

Endpoint:   /api/rh/v1/HistoricoProvisao/CODCOLIGADA %7C ANOCOMP %7C MESCOMP %7C  CHAPAHistoricoEncargo/1%7CT0001%7C003%7C2011%7C9 ( Este end point é dinâmico, onde o que se mantém sempre é %7C e o que sempre se altera são as informações CODCOLIGADA / CHAPA / CODENCARGO / ANOCOMP / MESCOMP / CHAPA   )
Exemplo de requisição com Endpoint montado:
/api/rh/v1/HistoricoProvisao/1%7C1998%7C2%7C00004
MESCOMP  )


Método:  DELETE

Objetivo: Excluir um registro já incluido anteriormente

Expandir
titleExemplo de Retorno

Status Code: 204  No Content

Expandir
titleExemplo de utilização

Para análise rápida, importe a seguinte collection no Postman:

View file
nameHistoricoProvisaoDeleteHistoricoEncargo Delete.postman_collection.json
height150


Para a utilização da collection, podemos utilizar um mock, para melhor visualização da API, basta importar o seguinte arquivo .json, usando a ferramenta Mockoon, basta importar o enviroment na ferramenta e iniciar o servidor:

View file
namemock_historico_provisaoencargos_delete.json
height150