Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adicionando coluna nome_sanitizado #39

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,21 @@ func main() {
for id, p := range er.Rc.Folha.ContraCheque {
salary, benefits, discounts, remuneration := calcBaseSalary(*p)
paychecks = append(paychecks, models.Paycheck{
ID: id + 1,
Agency: er.Rc.Coleta.Orgao,
Month: int(er.Rc.Coleta.Mes),
Year: int(er.Rc.Coleta.Ano),
CollectKey: er.Rc.Coleta.ChaveColeta,
Name: p.Nome,
RegisterID: p.Matricula,
Role: p.Funcao,
Workplace: p.LocalTrabalho,
Salary: salary,
Benefits: benefits,
Discounts: discounts,
Remuneration: remuneration,
Situation: ativoInativo(p.Ativo, er.Rc.Coleta.Orgao),
ID: id + 1,
Agency: er.Rc.Coleta.Orgao,
Month: int(er.Rc.Coleta.Mes),
Year: int(er.Rc.Coleta.Ano),
CollectKey: er.Rc.Coleta.ChaveColeta,
Name: p.Nome,
RegisterID: p.Matricula,
Role: p.Funcao,
Workplace: p.LocalTrabalho,
Salary: salary,
Benefits: benefits,
Discounts: discounts,
Remuneration: remuneration,
Situation: ativoInativo(p.Ativo, er.Rc.Coleta.Orgao),
SanitizedName: sanitizarItem(p.Nome),
})
// Detalhamento das despesas
i := 1
Expand Down Expand Up @@ -327,7 +328,7 @@ func ativoInativo(ativo bool, orgao string) *string {
}
}

// Sanitizando as rubricas:
// Sanitizando as rubricas e nomes:
// deixando-as em minúsculo, sem acentos, pontuações, caracteres especiais e espaços duplos
func sanitizarItem(item string) string {
// Converte para minúsculas
Expand Down