zoukankan      html  css  js  c++  java
  • Odoo HR Payslip

    pay slip 可以录入多条 worked_days_line 和 input_line,用来人工调整薪资变动部分,比如销售提成,扣款等。 pay slip 可以包含多个pay slip line 用来存储 Hr.salary.rule 计算出的结果。

       

       

    Hr.salary.rule 定义了薪资规则

       

    计算工资规则的时候,会使用 localdict 字典里存放的上下文参数

    {'categories': categories_obj, 'rules': rules_obj, 'payslip': payslip_obj, 'worked_days': worked_days_obj, 'inputs': input_obj,'employee':employee_id, 'contract ':contract }

    也就是这些变量

    • payslip: object containing the payslips
    • employee: hr.employee object
    • contract: hr.contract object
    • rules: object containing the rules code (previously computed)
    • categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).
    • worked_days: object containing the computed worked days.
    • inputs: object containing the computed inputs.

       

    方法compute_rule()计算薪资规则,返回 amount, qty, rate ,三者相乘就是该条规则所定义的薪资,这些规则计算的结果组合在一起,就组成了薪资总额,而这些规则的组合就是薪资结构。

       

    有三种计算类型

    • Fix
    • Percentage
    • Python code

       

    如果是Fix,则会使用Python eval执行字段quantity 保存的公式,得到结果 qty

    方法compute_rule()返回结果为 fixed_amount, qty, 100.0

    例如:

    工作日每天10元

       

    如果是percentage,则会使用Python eval执行字段 amount_percentage_base保存的公式,得到结果percentage_base

    方法compute_rule()返回结果为 percentage_base, qty, percentage

    例如:

    扣减工资的12.5%

       

    如果是Python code计算方式,则会使用Python eval执行字段 amount_python_compute即Python code保存的公式,得到结果result = xxx

    python code的格式必须是 result =

    方法compute_rule()返回结果为 result, result_qty or 1.0, result_rate or 100.0

       

       

    例如:

    使用inputs数据,计算业务提成

       

    以及

    调用薪资规则分类,并相加

       

    转载注明原作者 /by Jeffery
  • 相关阅读:
    关于测试准备工作的要求--测试用例
    测试用例设计:PICT的安装及使用
    导师应该做什么
    黑盒测试流程
    工作职责及内容
    自己在项目中写的一个Jquery插件和Jquery tab 功能
    Javascript中的" "
    Jquery.ajax 详细解释 通过Http请求加载远程数据
    Jquery中的toggle()方法
    Umbraco examine search media folder 中的pdf文件
  • 原文地址:https://www.cnblogs.com/odoouse/p/4690418.html
Copyright © 2011-2022 走看看