# Caso de uso 1 - Mensal Simples

<span style="font-weight: 400;">Neste documento, vamos considerar Provisão de 13° Salário como uma coisa só, sendo que, de antemão, sabemos que uma provisão não necessariamente é de 13°. Então, ao avançar neste documento observaremos quais atributos fazem parte da classe “Provisão” e quais atributos fazem parte da extensão “13° Salário”.</span>

##### **Processo como é hoje:**

<span style="font-weight: 400;">Nos modos </span>**Mensal, Integral e Proporcional**<span style="font-weight: 400;">, as seguintes informações estarão presentes: Código do funcionário, nome, salário, hora extra, comissão, valor acumulado, data de admissão, INSS recolhido do funcionário, INSS pago pela empresa, FGTS, IRRF.</span>

<span style="font-weight: 400;">Selecionando o tipo “</span>**Mensal**<span style="font-weight: 400;">”, o relatório deve exibir as informações já citadas e o valor do 13° salário correspondente ao mês definido. (Valor referente ao avo do mês);</span>

<span style="font-weight: 400;">Selecionando o tipo “</span>**Integral**<span style="font-weight: 400;">”, o relatório deve exibir as informações já citadas e o valor do 13° salário integral.</span>

<span style="font-weight: 400;">Selecionando o tipo “</span>**Proporcional**<span style="font-weight: 400;">”, o relatório deve exibir as informações já citadas, a data de referência utilizada, o número de avos a que o funcionário tem direito e o valor acumulado do 13° salário até a data de referência.</span>

<span style="font-weight: 400;">Selecionando o tipo “</span>**Geral**<span style="font-weight: 400;">”, o relatório deve exibir as seguintes informações: Código, Nome, Cargo/Função do Funcionário, Salário, período proporcional a que se refere o relatório, número de avos, valor acumulado do 13°, valor/mês do 13°, INSS acumulado, INSS/mês, FGTS acumulado e FGTS/mês.</span>

##### **Como deve funcionar “por baixo” dos panos:**

<span style="font-weight: 400;">Para entender como a provisão deve funcionar, devemos levar em consideração alguns fatores importantes:</span>

- <span style="font-weight: 400;">A data de admissão/rescisão do funcionário;</span>
- <span style="font-weight: 400;">Afastamentos ou Férias;</span>
- <span style="font-weight: 400;">O Tipo de salário do funcionário (mensal, diária, por hora, outro(?));</span>
- <span style="font-weight: 400;">Caso seja horista,</span>
- <span style="font-weight: 400;">Parâmetro da empresa para cálculo do funcionário horista (dias do mês, sempre 30, ou média de horas trabalhadas);</span>

- <span style="font-weight: 400;">Alterações salariais;</span>
- <span style="font-weight: 400;">Faltas;</span>

##### **Caso ideal:**

<span style="font-weight: 400;">Funcionário mensalista, admitido no ano anterior, sem desligamento, sem afastamento, sem férias no período, não comissionado, sem horas extras e sem alteração salarial no período.</span>

<span style="font-weight: 400;">Código do Funcionário: 1</span>

<span style="font-weight: 400;">Nome: João da Silva</span>

<span style="font-weight: 400;">Salário: R$1200,00</span>

<span style="font-weight: 400;">Hora Extra: R$0,00</span>

<span style="font-weight: 400;">Valor Acumulado: R$0,00</span>

<span style="font-weight: 400;">INSS: R$91,50 / 12 = R$7,625/mês</span>

<span style="font-weight: 400;">INSS empresa: \* Varia de acordo com atividade exercida (eu acho)</span>

<span style="font-weight: 400;">FGTS: Salário \* 0,08 = R$96,00 = R$8,00/mês</span>

<span style="font-weight: 400;">IRRF: R$0,00.</span>

##### **Mensal**

<span style="font-weight: 400;">Neste caso, o relatório deve exibir os seguintes valores, independente do mês gerado.</span><span style="font-weight: 400;">  
</span>

<table id="bkmrk-cod-nome-sal%E3%A1rio-h.-e" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><tbody><tr><td><span style="font-weight: 400;">Cod</span>

</td><td><span style="font-weight: 400;">Nome</span>

</td><td><span style="font-weight: 400;">Salário</span>

</td><td><span style="font-weight: 400;">H. Extra</span>

</td><td><span style="font-weight: 400;">Valor Acum</span>

</td><td><span style="font-weight: 400;">INSS Func</span>

</td><td><span style="font-weight: 400;">INSS Empr</span>

</td><td><span style="font-weight: 400;">FGTS</span>

</td><td><span style="font-weight: 400;">IRRF</span>

</td><td><span style="font-weight: 400;">13° mês</span>

</td></tr><tr><td><span style="font-weight: 400;">1</span>

</td><td><span style="font-weight: 400;">João da Silva</span>

</td><td><span style="font-weight: 400;">1200,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">7,625</span>

</td><td><span style="font-weight: 400;">?</span>

</td><td><span style="font-weight: 400;">8,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">100,00</span>

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

##### **Integral**

<span style="font-weight: 400;">Neste caso, o relatório deve exibir os seguintes valores:</span><span style="font-weight: 400;">  
</span>

<table id="bkmrk-cod-nome-sal%E3%A1rio-h.-e-0" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><tbody><tr><td><span style="font-weight: 400;">Cod</span>

</td><td><span style="font-weight: 400;">Nome</span>

</td><td><span style="font-weight: 400;">Salário</span>

</td><td><span style="font-weight: 400;">H. Extra</span>

</td><td><span style="font-weight: 400;">Valor Acum</span>

</td><td><span style="font-weight: 400;">INSS Func</span>

</td><td><span style="font-weight: 400;">INSS Empr</span>

</td><td><span style="font-weight: 400;">FGTS</span>

</td><td><span style="font-weight: 400;">IRRF</span>

</td><td><span style="font-weight: 400;">13° sal.</span>

</td></tr><tr><td><span style="font-weight: 400;">1</span>

</td><td><span style="font-weight: 400;">João da Silva</span>

</td><td><span style="font-weight: 400;">1200,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">91,50</span>

</td><td><span style="font-weight: 400;">?</span>

</td><td><span style="font-weight: 400;">96,00</span>

</td><td><span style="font-weight: 400;">0,00</span>

</td><td><span style="font-weight: 400;">1200,00</span>

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

##### **Proporcional**

<span style="font-weight: 400;">Neste caso, o relatório deve exibir os seguintes valores para os valores proporcionais ao mês </span>**N**<span style="font-weight: 400;">:</span><span style="font-weight: 400;">  
</span>

<table id="bkmrk-cod-nome-sal%E3%A1rio-h.-e-1"><tbody><tr><td style="width: 43px;"><span style="font-weight: 400;">Cod</span>

</td><td style="width: 66px;"><span style="font-weight: 400;">Nome</span>

</td><td style="width: 66px;"><span style="font-weight: 400;">Salário</span>

</td><td style="width: 50px;"><span style="font-weight: 400;">H. Extra</span>

</td><td style="width: 62px;"><span style="font-weight: 400;">Valor Acum</span>

</td><td style="width: 56px;"><span style="font-weight: 400;">INSS Func</span>

</td><td style="width: 58px;"><span style="font-weight: 400;">INSS Empr</span>

</td><td style="width: 48px;"><span style="font-weight: 400;">FGTS</span>

</td><td style="width: 45px;"><span style="font-weight: 400;">IRRF</span>

</td><td style="width: 109px;"><span style="font-weight: 400;">Dt. Admit</span>

</td><td style="width: 109px;"><span style="font-weight: 400;">Dt. Ref</span>

</td><td style="width: 47px;"><span style="font-weight: 400;">Avos</span>

</td><td style="width: 50px;"><span style="font-weight: 400;">13° prop.</span>

</td></tr><tr><td style="width: 43px;"><span style="font-weight: 400;">1</span>

</td><td style="width: 66px;"><span style="font-weight: 400;">João da Silva</span>

</td><td style="width: 66px;"><span style="font-weight: 400;">1200,00</span>

</td><td style="width: 50px;"><span style="font-weight: 400;">0,00</span>

</td><td style="width: 62px;"><span style="font-weight: 400;">0,00</span>

</td><td style="width: 56px;">**X**

</td><td style="width: 58px;"><span style="font-weight: 400;">?</span>

</td><td style="width: 48px;"><span style="font-weight: 400;">8</span>

</td><td style="width: 45px;"><span style="font-weight: 400;">0</span>

</td><td style="width: 109px;"><span style="font-weight: 400;">DD/MM/AAAA</span>

</td><td style="width: 109px;"><span style="font-weight: 400;">DD/MM/AAAA</span>

</td><td style="width: 47px;">**N**

</td><td style="width: 50px;">**Y**

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

<span style="font-weight: 400;">Sendo que:</span>

<span style="font-weight: 400;">X = (INSS ref mês 01) + (INSS ref mês 02) + .... + (INSS ref mês N);</span>

<span style="font-weight: 400;">Y = (13° ref mês 01) + (13° ref mês 02) + ... + (13° ref mês N);</span>

##### **Geral**

<span style="font-weight: 400;">No modo geral, pode-se considerar uma forma híbrida entre o tipo “Proporcional” de acordo com o mês de referência e o tipo “mensal” indicando os valores mensais do mês de referência.</span>

<table id="bkmrk-infos-do-funcio-per%E3%ADo"><tbody><tr><td><span style="font-weight: 400;">Infos do Funcio</span>

</td><td><span style="font-weight: 400;">Período Prop.</span>

</td><td><span style="font-weight: 400;">Avos</span>

</td><td><span style="font-weight: 400;">Base 13°</span>

</td><td><span style="font-weight: 400;">13° Acum.</span>

</td><td><span style="font-weight: 400;">13° Mês</span>

</td><td><span style="font-weight: 400;">INSS Acum</span>

</td><td><span style="font-weight: 400;">INSS Mês</span>

</td><td><span style="font-weight: 400;">FGTS Acum</span>

</td><td><span style="font-weight: 400;">FGTS Mês</span>

</td></tr><tr><td><span style="font-weight: 400;">Abstraídas</span>

</td><td><span style="font-weight: 400;">01/01/AAAA - DD/MM/AAAA</span>

</td><td>**N**

</td><td><span style="font-weight: 400;">1200,00</span>

</td><td>**X**

</td><td><span style="font-weight: 400;">100,00</span>

</td><td>**Y**

</td><td><span style="font-weight: 400;">7,625</span>

</td><td>**Z**

</td><td><span style="font-weight: 400;">8,00</span>

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

<span style="font-weight: 400;">Sendo que:</span>

**N**<span style="font-weight: 400;"> = Mês selecionado;</span>

**X** <span style="font-weight: 400;">= (13° ref mês 01) + (13° ref mês 02) + ... + (13° ref mês N);</span>

**Y**<span style="font-weight: 400;"> = (INSS ref mês 01) + (INSS ref mês 02) + .... + (INSS ref mês N);</span>

**Z** <span style="font-weight: 400;">= (FGTS ref mês 01) + (FGTS ref mês 02) + .... + (FGTS ref mês N);</span>