Skip to content

Commit

Permalink
Merge pull request #270 from abgfbr/feature/cod-pss
Browse files Browse the repository at this point in the history
Feature/cod pss
  • Loading branch information
hendrixcosta authored Jun 25, 2019
2 parents 0ec1c5d + a57f2f7 commit 9acb0bb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l10n_br_hr_arquivos_governo/models/hr_payslip_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def gerar_financial_move_darf(
if codigo_receita == '1661':
descricao += ' - PSS Plano de Seguridade Social'

if codigo_receita == '1850':
if codigo_receita == '1769':
descricao += ' - PSS Patronal'

# Calcular data de vencimento da DARF
Expand All @@ -76,7 +76,7 @@ def gerar_financial_move_darf(
fields.Datetime.from_string(data + ' 03:00:00')

# Código de DARFS de PSS
codigo_receita_PSS = ['1850', '1661']
codigo_receita_PSS = ['1769', '1661']

# Se forem darfs de PSS, sera no primeiro dia
if codigo_receita in codigo_receita_PSS:
Expand Down Expand Up @@ -231,7 +231,7 @@ def gerar_guias_pagamento(self):
# Para rubricas de PSS patronal
elif line.code in ['PSS_PATRONAL', 'PSS_13_PATRONAL', 'PSS_PATRONAL_MES_ANTERIOR']:
guia_pss.append({
'code': '1850',
'code': '1769',
'valor': line.total,
'partner_id': line.employee_id.company_id.partner_id,
'num_referencia':
Expand Down
32 changes: 32 additions & 0 deletions l10n_br_hr_payroll/models/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,38 @@ def hr_verify_sheet(self):
holerite.contract_id.resignation_date = \
holerite.data_afastamento

department_id = self.env['hr.department'].search([
('state','=','ativo'),
('manager_id','=', holerite.employee_id.id),
])

if department_id:
raise exceptions.Warning(
_('Funcionário como Gestor do departamento {}.'
'Definir novo gestor antes de finalizar '
'procedimento,'.format(department_id.name)))

holidays_ids = self.env['hr.holidays'].search([
('state','=','confirm'),
('type','=','remove'),
('employee_id','=',holerite.employee_id.id),
])

if holidays_ids:
raise exceptions.Warning(
_('Evento pendente:\n {}'
.format(holidays_ids.mapped('name'))))

ligacoes_ids = self.env['hr.telefonia.line'].search([
('state','=','open'),
('employee_id','=',holerite.employee_id.id),
])

if ligacoes_ids:
raise exceptions.Warning(
_('Ligação em aberto:\n {}'
.format(ligacoes_ids.mapped('name'))))

# setar as ligacoes telefonicas como debitadas
for ligacao_id in holerite.ligacoes_ids:
ligacao_id.state = 'paid'
Expand Down

0 comments on commit 9acb0bb

Please sign in to comment.