[MERGE] merged the branch with improvements related to payroll accounting. Added and improved demo/poc data for belgian payroll (also related to accounting stuff)

bzr revid: qdp-launchpad@openerp.com-20120628124405-4xktptkuac7v9lde
This commit is contained in:
Quentin (OpenERP) 2012-06-28 14:44:05 +02:00
commit b7d65458b1
13 changed files with 2988 additions and 1521 deletions

View File

@ -156,7 +156,8 @@ class contrib_register(osv.osv):
_description = 'Contribution Register'
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=False),
'company_id':fields.many2one('res.company', 'Company'),
'partner_id':fields.many2one('res.partner', 'Partner'),
'name':fields.char('Name', size=256, required=True, readonly=False),
'register_line_ids':fields.one2many('hr.payslip.line', 'register_id', 'Register Line', readonly=True),
'note': fields.text('Description'),
@ -773,7 +774,7 @@ class hr_salary_rule(osv.osv):
'company_id':fields.many2one('res.company', 'Company', required=False),
'condition_select': fields.selection([('none', 'Always True'),('range', 'Range'), ('python', 'Python Expression')], "Condition Based on", required=True),
'condition_range':fields.char('Range Based on',size=1024, readonly=False, help='This will be used to compute the % fields values; in general it is on basic, but you can also use categories code fields in lowercase as a variable names (hra, ma, lta, etc.) and the variable basic.'),
'condition_python':fields.text('Python Condition', required=True, readonly=False, help='Applied this rule for calculation if condition is true. You can specify condition like basic > 1000.'),#old name = conditions
'condition_python':fields.text('Python Condition', required=True, readonly=False, help='Applied this rule for calculation if condition is true. You can specify condition like basic > 1000.'),
'condition_range_min': fields.float('Minimum Range', required=False, help="The minimum amount, applied for this rule."),
'condition_range_max': fields.float('Maximum Range', required=False, help="The maximum amount, applied for this rule."),
'amount_select':fields.selection([

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="contrib_register_employees" model="hr.contribution.register">
<field name="name">Employees</field>
<field name="partner_id" eval="False"/>
</record>
<record id="BASIC" model="hr.salary.rule.category">
<field name="name">Basic</field>
@ -60,6 +64,7 @@
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = categories.BASIC + categories.ALW + categories.DED</field>
<field name="register_id" ref="contrib_register_employees"/>
</record>

View File

@ -99,6 +99,7 @@ class hr_payslip(osv.osv):
else:
period_id = slip.period_id.id
default_partner_id = slip.employee_id.address_home_id.id
name = _('Payslip of %s') % (slip.employee_id.name)
move = {
'narration': name,
@ -109,7 +110,7 @@ class hr_payslip(osv.osv):
}
for line in slip.line_ids:
amt = slip.credit_note and -line.total or line.total
partner_id = False
partner_id = line.salary_rule_id.register_id.partner_id and line.salary_rule_id.register_id.partner_id.id or default_partner_id
debit_account_id = line.salary_rule_id.account_debit.id
credit_account_id = line.salary_rule_id.account_credit.id
@ -118,7 +119,7 @@ class hr_payslip(osv.osv):
debit_line = (0, 0, {
'name': line.name,
'date': timenow,
'partner_id': partner_id,
'partner_id': (line.salary_rule_id.register_id.partner_id or line.salary_rule_id.account_debit.type in ('receivable', 'payable')) and partner_id or False,
'account_id': debit_account_id,
'journal_id': slip.journal_id.id,
'period_id': period_id,
@ -136,7 +137,7 @@ class hr_payslip(osv.osv):
credit_line = (0, 0, {
'name': line.name,
'date': timenow,
'partner_id': partner_id,
'partner_id': (line.salary_rule_id.register_id.partner_id or line.salary_rule_id.account_credit.type in ('receivable', 'payable')) and partner_id or False,
'account_id': credit_account_id,
'journal_id': slip.journal_id.id,
'period_id': period_id,
@ -156,7 +157,7 @@ class hr_payslip(osv.osv):
adjust_credit = (0, 0, {
'name': _('Adjustment Entry'),
'date': timenow,
'partner_id': partner_id,
'partner_id': False,
'account_id': acc_id,
'journal_id': slip.journal_id.id,
'period_id': period_id,
@ -172,7 +173,7 @@ class hr_payslip(osv.osv):
adjust_debit = (0, 0, {
'name': _('Adjustment Entry'),
'date': timenow,
'partner_id': partner_id,
'partner_id': False,
'account_id': acc_id,
'journal_id': slip.journal_id.id,
'period_id': period_id,

View File

@ -2,80 +2,6 @@
<openerp>
<data>
<record id="hr_payroll.hr_salary_rule_houserentallowance1" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_salary_rule_convanceallowance1" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_salary_rule_professionaltax1" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_salary_rule_providentfund1" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_salary_rule_meal_voucher" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_salary_rule_ca_paolino" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_rule_basic" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_rule_taxable" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<record id="hr_payroll.hr_rule_net" model="hr.salary.rule">
<field name="account_debit" ref="account.a_salary_expense"/>
</record>
<!-- Payslip -->
<!-- <record id="hr_payroll.hr_payslip_salaryslipofbonamyforjune0" model="hr.payslip">
<field name="journal_id" ref="account.expenses_journal"/>
<field name="bank_journal_id" ref="account.bank_journal"/>
</record>-->
<!-- Assigned Default Account in Different Demo Employees -->
<!-- <record id="hr.employee" model="hr.employee">
<field name="property_bank_account" ref="account.bnk"/>
<field name="salary_account" ref="account.a_salary_expense"/>
<field name="employee_account" ref="account.a_expense"/>
</record>
<record id="hr.employee_fp" model="hr.employee">
<field name="property_bank_account" ref="account.bnk"/>
<field name="salary_account" ref="account.a_salary_expense"/>
<field name="employee_account" ref="account.a_expense"/>
</record>
<record id="hr.employee_qdp" model="hr.employee">
<field name="property_bank_account" ref="account.bnk"/>
<field name="salary_account" ref="account.a_salary_expense"/>
<field name="employee_account" ref="account.a_expense"/>
</record>
<record id="hr.employee_al" model="hr.employee">
<field name="property_bank_account" ref="account.bnk"/>
<field name="salary_account" ref="account.a_salary_expense"/>
<field name="employee_account" ref="account.a_expense"/>
</record>
<record id="hr_payroll.hr_employee_bonamy0" model="hr.employee">
<field name="property_bank_account" ref="account.bnk"/>
<field name="salary_account" ref="account.a_salary_expense"/>
<field name="employee_account" ref="account.a_expense"/>
</record>-->
<record id="bnk" model="account.account">
<field name="code">X110041</field>
<field name="name">Bank Current Account</field>
@ -101,6 +27,14 @@
<field name="user_type" ref="account.data_account_type_payable"/>
</record>
<record id="res_partner_bonamy" model="res.partner">
<field name="name">Employee: Bonamy</field>
</record>
<record id="hr_payroll.hr_employee_bonamy0" model="hr.employee">
<field name="address_home_id" ref="res_partner_bonamy"/>
</record>
</data>
</openerp>

View File

@ -3903,28 +3903,28 @@
<record id="a4550" model="account.account.template">
<field name="name">Administrateurs, gérants et commissaires</field>
<field name="code">4550</field>
<field name="type">other</field>
<field name="type">payable</field>
<field name="user_type" ref="account.data_account_type_payable"/>
<field ref="a455" name="parent_id"/>
</record>
<record id="a4551" model="account.account.template">
<field name="name">Direction</field>
<field name="code">4551</field>
<field name="type">other</field>
<field name="type">payable</field>
<field name="user_type" ref="account.data_account_type_payable"/>
<field ref="a455" name="parent_id"/>
</record>
<record id="a4552" model="account.account.template">
<field name="name">Employés</field>
<field name="code">4552</field>
<field name="type">other</field>
<field name="type">payable</field>
<field name="user_type" ref="account.data_account_type_payable"/>
<field ref="a455" name="parent_id"/>
</record>
<record id="a4553" model="account.account.template">
<field name="name">Ouvriers</field>
<field name="code">4553</field>
<field name="type">other</field>
<field name="type">payable</field>
<field name="user_type" ref="account.data_account_type_payable"/>
<field ref="a455" name="parent_id"/>
</record>

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@ class hr_contract_be(osv.osv):
'additional_net_amount': fields.float('Net supplements', digits_compute=dp.get_precision('Payroll')),
'retained_net_amount': fields.float('Net retained ', digits_compute=dp.get_precision('Payroll')),
}
hr_contract_be()
class hr_employee_be(osv.osv):
@ -50,7 +50,7 @@ class hr_employee_be(osv.osv):
'resident_bool': fields.boolean('Nonresident', help="if recipient lives in a foreign country"),
'disabled_children_number': fields.integer('Number of disabled children'),
}
hr_employee_be()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- CONTRIBUTION REGISTERS -->
<record id="res_partner_onss" model="res.partner">
<field name="name">ONSS</field>
</record>
<record id="contrib_register_onss" model="hr.contribution.register">
<field name="name">ONSS</field>
<field name="note">National Office of Social Security</field>
<field name="partner_id" ref="res_partner_onss"/>
</record>
<record id="res_partner_pp" model="res.partner">
<field name="name">Fiscal Administration</field>
</record>
<record id="contrib_register_pp" model="hr.contribution.register">
<field name="name">Fiscal Administration</field>
<field name="partner_id" ref="res_partner_pp"/>
</record>
<record id="res_partner_meal_vouchers" model="res.partner">
<field name="name">Restaurant Tickets Organism</field>
</record>
<record id="contrib_register_meal_vouchers" model="hr.contribution.register">
<field name="name">Restaurant Tickets Organism</field>
<field name="partner_id" ref="res_partner_meal_vouchers"/>
</record>
<!-- HR SALARY RULE CATEGORIES-->
<record id="hr_payroll_head_salary" model="hr.salary.rule.category">
<field name="name">Gross</field>
<field name="code">BRUT</field>
@ -62,6 +87,7 @@
<field name="amount_select">percentage</field>
<field name="amount_percentage_base">SALARY</field>
<field name="amount_percentage">-13.07</field>
<field name="register_id" ref="contrib_register_onss"/>
</record>
<record id="hr_payroll_rules_p_p_b1" model="hr.salary.rule">
<field name="category_id" ref="hr_payroll_head_pp"/>
@ -223,6 +249,7 @@
<field name="condition_select">python</field>
<field name="condition_python">result = bool(contract.meal_voucher_amount)</field>
<field name="appears_on_payslip" eval="False"/>
<field name="register_id" ref="contrib_register_meal_vouchers"/>
</record>
<record id="hr_payroll_rules_ch_worker" model="hr.salary.rule">
<field name="category_id" ref="hr_payroll_head_div_net"/>
@ -237,6 +264,7 @@
<field name="amount_percentage_base">contract.meal_voucher_employee_deduction</field>
<field name="quantity">worked_days.WORK100.number_of_days</field>
<field name="appears_on_payslip" eval="True"/>
<field name="register_id" ref="contrib_register_meal_vouchers"/>
</record>
<record id="hr_payroll_rules_reim_travel" model="hr.salary.rule">
<field name="category_id" ref="hr_payroll.DED"/>

View File

@ -0,0 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,41 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Belgium - Payroll',
'category': 'Localization',
'author': 'OpenERP SA',
'depends': ['l10n_be_hr_payroll', 'hr_payroll_account', 'l10n_be'],
'version': '1.0',
'description': """
Accounting Data for Belgian Payroll Rules
""",
'auto_install': True,
'demo': [
],
'data':[
'l10n_be_hr_payroll_account_data.xml',
'data/hr.salary.rule.csv',
],
'installable': True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- HR SALARY RULES-->
<record id="l10n_be_hr_payroll.hr_payroll_rules_onss_rule" model="hr.salary.rule">
<field name="account_debit" search="[('code', 'like', '4540%')]"/>
</record>
<record id="hr_payroll.hr_rule_basic" model="hr.salary.rule">
<field name="account_debit" search="[('code', 'like', '6202%')]"/>
</record>
<record id="hr_payroll.hr_rule_net" model="hr.salary.rule">
<field name="account_credit" search="[('code', 'like', '4552%')]"/>
</record>
<record id="l10n_be_hr_payroll.hr_payroll_rules_ch_worker" model="hr.salary.rule">
<field name="account_debit" search="[('code', 'like', '4597%')]"/>
</record>
<record id="l10n_be_hr_payroll.hr_payroll_rules_suppl_net" model="hr.salary.rule">
<field name="account_debit" search="[('code', 'like', '4552%')]"/>
</record>
<record id="l10n_be_hr_payroll.hr_payroll_rules_retained_net" model="hr.salary.rule">
<field name="account_debit" search="[('code', 'like', '4552%')]"/>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B