l10n_ir_hr_payroll/data/hr_salary_rule_data.xml

378 lines
19 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="hr_salary_rule_ir_monthly_wage" model="hr.salary.rule">
<field name="name">حقوق پایه</field>
<field name="sequence" eval="1"/>
<field name="code">MONTHLY_WAGE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_basic"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
work_hours = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0
leave_120_hours = worked_days['LEAVE120'].number_of_hours if 'LEAVE120' in worked_days else 0
leave_100_hours = worked_days['LEAVE100'].number_of_hours if 'LEAVE100' in worked_days else 0
total_hours = work_hours + leave_120_hours + leave_100_hours
result = contract.wage * total_hours / 8
</field>
</record>
<record id="hr_salary_rule_ir_overtime_wage" model="hr.salary.rule">
<field name="name">اضافه‌کاری</field>
<field name="sequence" eval="2"/>
<field name="code">OVERTIME_WAGE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_basic"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = worked_days['OVERTIME'].number_of_hours</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = contract.wage * worked_days['OVERTIME'].number_of_hours * 1.4 / 8
</field>
</record>
<record id="hr_salary_rule_ir_housing_allowance" model="hr.salary.rule">
<field name="name">کمک هزینه مسکن</field>
<field name="sequence" eval="10"/>
<field name="code">HOUSING_ALLOWANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_allowance"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = payslip._rule_parameter('housing_allowance')
</field>
</record>
<record id="hr_salary_rule_ir_marital_allowance" model="hr.salary.rule">
<field name="name">کمک هزینه عائله‌مندی</field>
<field name="sequence" eval="11"/>
<field name="code">MARITAL_ALLOWANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_allowance"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = employee.marital == 'married'</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = payslip._rule_parameter('marital_allowance')
</field>
</record>
<record id="hr_salary_rule_ir_family_allowance" model="hr.salary.rule">
<field name="name">کمک هزینه فرزند</field>
<field name="sequence" eval="12"/>
<field name="code">FAMILY_ALLOWANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_allowance"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = employee.children > 0</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = payslip._rule_parameter('child_allowance') * employee.children
</field>
</record>
<record id="hr_salary_rule_ir_CONSUMPTION_ALLOWANCE" model="hr.salary.rule">
<field name="name">کمک هزینه خواربار</field>
<field name="sequence" eval="13"/>
<field name="code">CONSUMPTION_ALLOWANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_allowance"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = payslip._rule_parameter('CONSUMPTION_ALLOWANCE')</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = payslip._rule_parameter('CONSUMPTION_ALLOWANCE')
</field>
</record>
<record id="hr_salary_rule_ir_GOODATTENACE_ALLOWANCE" model="hr.salary.rule">
<field name="name">حضور به موقع</field>
<field name="sequence" eval="14"/>
<field name="code">GOODATTENDANCE_ALLOWANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_allowance"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = payslip._rule_parameter('GOODATTENDANCE_ALLOWANCE')</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = payslip._rule_parameter('GOODATTENDANCE_ALLOWANCE')
</field>
</record>
<record id="hr_salary_rule_ir_remained_expenses" model="hr.salary.rule">
<field name="name">مانده هزینه‌ها</field>
<field name="sequence" eval="20"/>
<field name="code">REMAINED_EXPENSES</field>
<field name="category_id" ref="hr_salary_rule_category_ir_expense_settlement"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = inputs['REIMBURSEMENT']</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = inputs['REIMBURSEMENT']
</field>
</record>
<record id="hr_salary_rule_ir_ssp_company" model="hr.salary.rule">
<field name="name">بیمه سهم کارفرما</field>
<field name="sequence" eval="50"/>
<field name="code">SSP_COMPANY</field>
<field name="category_id" ref="hr_salary_rule_category_ir_company_share"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
# مبنای مشمول بیمه: جمع BASIC و ALW
insurable_base = categories['BASIC'] + categories['ALW']
# سهم کارفرما ۲۳٪ و سهم کارمند ۷٪
employer_share = insurable_base * 0.23
# محاسبه ناخالص مشمول بیمه
result = employer_share
result_name = "ناخالص مشمول بیمه"
</field>
</record>
<record id="hr_salary_rule_ir_unemployment_security" model="hr.salary.rule">
<field name="name">بیمه بیکاری</field>
<field name="sequence" eval="51"/>
<field name="code">UNEMPLOYMENT_SECURITY</field>
<field name="category_id" ref="hr_salary_rule_category_ir_company_share"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = 0.0
</field>
</record>
<record id="hr_salary_rule_ir_ssp_employee" model="hr.salary.rule">
<field name="name">بیمه سهم کارگر</field>
<field name="sequence" eval="52"/>
<field name="code">SSP_EMPLOYEE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
# مبنای مشمول بیمه: جمع BASIC و ALW
insurable_base = categories['BASIC'] + categories['ALW']
# سهم کارفرما ۲۳٪ و سهم کارمند ۷٪
employer_share = insurable_base * 0.23
employee_share = insurable_base * 0.07
# محاسبه ناخالص مشمول بیمه
result = employee_share
</field>
</record>
<record id="hr_salary_rule_ir_gross_ssp" model="hr.salary.rule">
<field name="name">ناخالص مشمول بیمه</field>
<field name="sequence" eval="60"/>
<field name="code">GROSS_SSP</field>
<field name="category_id" ref="hr_salary_rule_category_ir_gross"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
# مبنای مشمول بیمه: جمع BASIC و ALW
insurable_base = categories['BASIC'] + categories['ALW']
# سهم کارفرما ۲۳٪ و سهم کارمند ۷٪
employer_share = insurable_base * 0.23
employee_share = insurable_base * 0.07
# محاسبه ناخالص مشمول بیمه
result = insurable_base + employer_share + employee_share
result_name = "ناخالص مشمول بیمه"
</field>
</record>
<record id="hr_salary_rule_ir_gross_taxable" model="hr.salary.rule">
<field name="name">ناخالص مشمول مالیات</field>
<field name="sequence" eval="61"/>
<field name="code">GROSS_TAXABLE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_gross"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = worked_days['WORK100'].number_of_days</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
# ۱) مبلغ حقوق ماهانه
mw = contract.wage * (worked_days['WORK100'].number_of_days + (worked_days['LEAVE120'].number_of_days if worked_days['LEAVE120'].number_of_days else 0.0) )
# ۳) ناخالص مشمول مالیات = حقوق ماهانه + اضافه‌کاری
result = mw
# ۴) نام دلخواه برای نمایش
result_name = "ناخالص مشمول مالیات"
</field>
</record>
<record id="hr_salary_rule_ir_tax_amount" model="hr.salary.rule">
<field name="name">مالیات</field>
<field name="sequence" eval="70"/>
<field name="code">TAX_AMOUNT</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
monthly_wage = contract.wage
if monthly_wage &lt;= 24000000:
result = 0
elif monthly_wage &lt;= 30000000:
result = (monthly_wage - 24000000) * 0.10
elif monthly_wage &lt;= 38000000:
result = (6000000 * 0.10) + (monthly_wage - 30000000) * 0.15
elif monthly_wage &lt;= 50000000:
result = (6000000 * 0.10) + (8000000 * 0.15) + (monthly_wage - 38000000) * 0.20
elif monthly_wage &lt;= 66667000:
result = (6000000 * 0.10) + (8000000 * 0.15) + (12000000 * 0.20) + (monthly_wage - 50000000) * 0.25
else:
result = (6000000 * 0.10) + (8000000 * 0.15) + (12000000 * 0.20) + (16667000 * 0.25) + (monthly_wage - 66667000) * 0.30
</field>
</record>
<record id="hr_salary_rule_ir_supplementary_insurance" model="hr.salary.rule">
<field name="name">بیمه تکمیلی</field>
<field name="sequence" eval="71"/>
<field name="code">SUPPLEMENTARY_INSURANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = inputs.ASSIG_SALARY</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = inputs['ASSIG_SALARY'].amount
</field>
</record>
<record id="hr_salary_rule_ir_loan_installment" model="hr.salary.rule">
<field name="name">قسط وام</field>
<field name="sequence" eval="72"/>
<field name="code">LOAN_INSTALLMENT</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = inputs['DEDUCTION']</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = inputs['DEDUCTION'].amount
</field>
</record>
<record id="hr_salary_rule_ir_advance_installment" model="hr.salary.rule">
<field name="name">قسط مساعده</field>
<field name="sequence" eval="73"/>
<field name="code">ADVANCE_INSTALLMENT</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = 0.0
</field>
</record>
<record id="hr_salary_rule_ir_delayed_checkin" model="hr.salary.rule">
<field name="name">دیر آمدگی</field>
<field name="sequence" eval="74"/>
<field name="code">DELAYED_CHECKIN</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">result = payslip.late_check_in_count_slip >= 2</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
result = 0
result_name = ""
if payslip.late_check_in_count_slip >= 2:
result = inputs['DELAYED_CHCK'].amount
result_name = "دیر آمدگی"
</field>
</record>
<record id="hr_salary_rule_ir_net" model="hr.salary.rule">
<field name="name">خالص دریافتی</field>
<field name="sequence" eval="100"/>
<field name="code">NET</field>
<field name="category_id" ref="hr_salary_rule_category_ir_net"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<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>
</record>
<record id="iran_end_of_service_base_daily_1404" model="hr.salary.rule">
<field name="name">End of Service Base Daily - 1404</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="code">EOSBASE1404_D</field>
<field name="sequence">7</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
# جدول پایه سنوات روزانه به ازای سال سابقه
service_table = {
0: 0, 1: 94000, 2: 186400, 3: 299128, 4: 435529, 5: 561017, 6: 673958,
7: 764873, 8: 839722, 9: 922359, 10: 976799, 11: 1038860, 12: 1075168,
13: 1099568, 14: 1121934, 15: 1141081, 16: 1161373, 17: 1174944,
18: 1189193, 19: 1204156, 20: 1220615, 21: 1235386, 22: 1248422,
23: 1258705, 24: 1267521, 25: 1275000, 26: 1281327, 27: 1285196,
28: 1288468, 29: 1291772, 30: 1295768, 31: 1299202
}
years = int(contract.l10n_ir_years_of_service or 0)
daily_amount = service_table.get(years, 0)
date_from = payslip.date_from
date_to = payslip.date_to
month_days = (date_to - date_from).days + 1
result = daily_amount * month_days
</field>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
</record>
<record id="hr_salary_rule_ir_low_performance" model="hr.salary.rule">
<field name="name">کم‌کارکرد</field>
<field name="sequence" eval="76"/>
<field name="code">LOW_PERFORMANCE</field>
<field name="category_id" ref="hr_salary_rule_category_ir_deduction"/>
<field name="struct_id" ref="l10n_ir_hr_payroll.hr_payroll_structure_ir_employee_salary"/>
<field name="condition_select">python</field>
<field name="condition_python">
expected_hours = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
actual_hours = (
worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
) + (
worked_days['LEAVE120'].number_of_hours if 'LEAVE120' in worked_days else 0.0
) + (
worked_days['LEAVE105'].number_of_hours if 'LEAVE105' in worked_days else 0.0
) + (
worked_days['LEAVE110'].number_of_hours if 'LEAVE110' in worked_days else 0.0
) + (
worked_days['WORK110'].number_of_hours if 'WORK110' in worked_days else 0.0
)
result = actual_hours &lt; expected_hours
</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">
expected_hours = worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
actual_hours = (
worked_days['WORK100'].number_of_hours if 'WORK100' in worked_days else 0.0
) + (
worked_days['LEAVE120'].number_of_hours if 'LEAVE120' in worked_days else 0.0
) + (
worked_days['LEAVE105'].number_of_hours if 'LEAVE105' in worked_days else 0.0
) + (
worked_days['LEAVE110'].number_of_hours if 'LEAVE110' in worked_days else 0.0
) + (
worked_days['WORK110'].number_of_hours if 'WORK110' in worked_days else 0.0
)
short_hours = max(0.0, expected_hours - actual_hours)
hourly_rate = contract.wage / 30.0 / (contract.resource_calendar_id.hours_per_day or 8.0)
result = -1 * short_hours * hourly_rate
result_name = "کم‌کارکرد"
</field>
</record>
</data>
</odoo>