From 81f793ef36c08fa10126ea6bbbced610676571f3 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 28 Apr 2022 23:38:13 +0000 Subject: [PATCH] [IMP] l10n_pe_hr_payroll_account: fill in remaining accounts, bonus, commissions --- .../data/l10n_pe_hr_payroll_account_data.xml | 4 ++++ .../models/account_chart_template.py | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/l10n_pe_hr_payroll_account/data/l10n_pe_hr_payroll_account_data.xml b/l10n_pe_hr_payroll_account/data/l10n_pe_hr_payroll_account_data.xml index 0f65f6db..8f0e5f57 100644 --- a/l10n_pe_hr_payroll_account/data/l10n_pe_hr_payroll_account_data.xml +++ b/l10n_pe_hr_payroll_account/data/l10n_pe_hr_payroll_account_data.xml @@ -18,6 +18,8 @@ # pay_ir_5ta_cat='1238', # pay_essalud='1239', # exp_salary='1240', + # exp_com='1222', + # exp_bono='1223', # exp_essalud='1241', env['account.chart.template']._pe_configure_payroll_account_data(companies, salary_rules=records, full_reset=False) @@ -39,6 +41,8 @@ # pay_ir_5ta_cat='1238', # pay_essalud='1239', # exp_salary='1240', + # exp_com='1222', + # exp_bono='1223', # exp_essalud='1241', env['account.chart.template']._pe_configure_payroll_account_data(companies, salary_rules=records, full_reset=True) diff --git a/l10n_pe_hr_payroll_account/models/account_chart_template.py b/l10n_pe_hr_payroll_account/models/account_chart_template.py index 0bdc2f6f..40ec83bc 100644 --- a/l10n_pe_hr_payroll_account/models/account_chart_template.py +++ b/l10n_pe_hr_payroll_account/models/account_chart_template.py @@ -3,14 +3,14 @@ from odoo import models EXP_SALARY = '6211000' +EXP_COM = '6212000' +EXP_BONO = '6213000' EXP_ESSALUD = '6271000' PAY_EE = '4111000' -PAY_AFP = '407' # TODO -PAY_AFP = '4032000' # TODO +PAY_AFP = '4170000' PAY_ONP = '4032000' -PAY_EPS = '4075' # TODO EPS isn't implemented -PAY_IR_5TA_CAT = '4017' # TODO +PAY_IR_5TA_CAT = '4017300' PAY_ESSALUD = '4031000' @@ -33,6 +33,8 @@ class AccountChartTemplate(models.Model): pay_ir_5ta_cat=PAY_IR_5TA_CAT, pay_essalud=PAY_ESSALUD, exp_salary=EXP_SALARY, + exp_com=EXP_COM, + exp_bono=EXP_BONO, exp_essalud=EXP_ESSALUD, salary_rules=None, full_reset=False): account_codes = ( @@ -43,6 +45,8 @@ class AccountChartTemplate(models.Model): pay_ir_5ta_cat, pay_essalud, exp_salary, + exp_com, + exp_bono, exp_essalud, ) pe_structures = self.env['hr.payroll.structure'].search([('country_id', '=', self.env.ref('base.pe').id)]) @@ -122,6 +126,9 @@ class AccountChartTemplate(models.Model): # BASIC* -> SALARY_EXPENSE debit account set_rule_accounts('BASIC%', accounts[exp_salary], accounts['none']) + set_rule_accounts('BASIC_COM%', accounts[exp_com], accounts['none']) + set_rule_accounts('BASIC_BONO%', accounts[exp_bono], accounts['none']) + set_rule_accounts('BASIC_BADGES%', accounts[exp_bono], accounts['none']) # ALW* -> SALARY_EXPENSE debit account set_rule_accounts('ALW%', accounts[exp_salary], accounts['none']) # EE_* -> AP debit