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
  • 相关阅读:
    使用SDL2显示一张图片,SDL2上手贴
    两种方法操作其它mac应用的窗口
    golang子进程的启动和停止,mac与linux的区别
    自己动手,装一个液晶电视
    在Ubuntu上搭建kindle gtk开发环境
    macOS的OpenCL高性能计算
    量子计算及量子计算的模拟
    iPhone多次输入错误密码锁机后刷机恢复(原有内容会丢失)
    Day 2 总结
    Day 13 linux 的输入输出与管道的使用
  • 原文地址:https://www.cnblogs.com/odoouse/p/4690418.html
Copyright © 2011-2022 走看看