Skip to main content

A beancount plugin to calculate and validate china personal income tax

Project description

本插件用于 beancount 计算每 月所应缴纳的中华人民共和国个人所得税. 如计算金额与实际缴纳额度不同, bean-checkbeancount-fava 会显示 error.

税表和扣除项目

插件所使用税表来自 中华人民共和国个人所得税法 所附 附件1:个人所得税税率表(综合所得适用).pdf

级数 年应纳税所得额 税率(%) 速算扣除数
1 不超过36000元的 3 0
2 超过36000元至144000元的部分 10 2520
3 超过144000元至300000元的部分 20 16920
4 超过300000元至420000元的部分 25 31920
5 超过420000元至660000元的部分 30 52920
6 超过660000元至960000元的部分 35 85920
7 超过960000元的部分 45 181920

根据 2006第07期-基本养老保险, 基本医疗保险费, 失业保险费, 住房公积金免征个人所得税个人所得税专项附加扣除暂行办法, 纳税人可享有相应扣除项目, 可在本插件中指定扣除账户或扣除额度.

使用方法

beancount 插件的工作流程和使用方法可参考 Beancount Scripting & Plugins. 最简单的方法是 pip install beancount-china-income-tax, 然后在 beanount 里指定

plugin "beancount-china-income-tax.china_income_tax" "category=china-income-tax,account=Expenses:IncomeTax"

在参与所得税计算的 beancount 账户和 transaction 下指定 category:china-income-tax, 如:

1970-01-01 open Income:Salary
  category: "china-income-tax"
1970-01-01 open Income:Allowance
  category: "china-income-tax"
1970-01-01 open Expenses:Pension
  category: "china-income-tax"

可在 transaction thread 下用 tax-deduction 修正税款计算, 如下面的示例 中 tax-deduction: -3300. 负数为扣除, 正数为增加 (如有未记录的额外收益时).

2022-01-31 * "salary"
  category: "china-income-tax"
  tax-deduction: -3300
  Income:Allowance                          -500 CNY
  Income:Salary                           -40000 CNY
  Expenses:Pension                          1000 CNY
  Expenses:IncomeTax:2022                 410.41 CNY
  Assets:BankCard

本插件会根据相应账户收支及指定的扣除来计算应纳税额. 如果 Expenses:IncomeTax:2022 的税款与插件计算不符, beancount-fava 会显示

income tax does not match, calculated: 1005.00, actual: 410.41

设置选项

option 分类 用途 是否必需? 示例
category plugin/transaction option 指定参与本插件计算的账户和 transaction category=china-income-tax
account plugin option 税款账户前缀 account=Expenses:IncomeTax
monthly-deduction plugin option 每月的修正额度, 默认为 -5000, 正数为增加 monthly-deduction=-5000
precision plugin option 税款账户比较精度, 默认为 0.01 precision=0.01
tax-deduction transaction option 指定 transaction 的税款计算修正, 默认为 0 tax-deduction: -1100

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beancount-china-income-tax-0.1.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beancount_china_income_tax-0.1.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file beancount-china-income-tax-0.1.4.tar.gz.

File metadata

  • Download URL: beancount-china-income-tax-0.1.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.24.1 CPython/3.12.3 Linux/6.11.0-1012-azure

File hashes

Hashes for beancount-china-income-tax-0.1.4.tar.gz
Algorithm Hash digest
SHA256 330df0b13eaae875bde8622a630b28eed5c8d7151e1d7afd8de759905336ac33
MD5 50422d38e1870cb6cfe79f48cede21df
BLAKE2b-256 add218667bc59bfb578820b4bf2f359090e95e57776b88ef8a3aea0b6cc12548

See more details on using hashes here.

File details

Details for the file beancount_china_income_tax-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for beancount_china_income_tax-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2a0de048102c8f2423930312e378e20266f411e54f0150d82a51f628394a5787
MD5 83c1904fe7effc2ed821f6b7311cb37d
BLAKE2b-256 2ddaa4c63160f50c184efcba6654d8ff71884549e8831b47d3eb2bab97980a9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page