Created
March 29, 2016 11:14
-
-
Save ViktorOgnev/3e1e4da51d10557b41ca to your computer and use it in GitHub Desktop.
calculate taxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
income = { | |
'1': 3.0, | |
'2': 3.0, | |
'3': 3.0, | |
'4': 3.0, | |
'5': 3.0, | |
'6': 3.0, | |
'7': 3.0, | |
'8': 3.0, | |
'9': 3.0, | |
'10': 3.0, | |
'11': 3.0, | |
'12-1': 3.0, | |
'12-2': 3.0, | |
'12-3': 3.0 | |
} | |
PENSION_FIXED_2015 = 3650.58 + 18610.8 | |
total = sum(income.values()) | |
avg = total / 12 | |
pension = (total - 300000.0) * 0.01 | |
pension_all = pension + PENSION_FIXED_2015 | |
taxes = total * 0.03 - pension_all | |
def tax_info(qnum, qincome): | |
perc3 = round(qincome * 0.03 + 0.5) | |
pensn = ((PENSION_FIXED_2015 / 12) * 3 * qnum + (qincome - 300000.0) * 0.01) | |
diff = round((perc3 - pensn) + 0.5) | |
result = ( | |
'{0} quartal incom = {1}\n' | |
'{0} quartal 3% = {2}\n' | |
'{0} quartal pensn = {3}\n' | |
'{0} quartal 3-pns = {4}\n' | |
).format( | |
str(qnum), | |
qincome, | |
perc3, | |
pensn, | |
diff) | |
return result | |
print('So youve got\n' | |
'total income = {}\n' | |
'average monthly income = {}\n' | |
'variable pension fund payment = {}\n' | |
'total pension fund payment = {}\n' | |
'3 precent taxes(minus pension payment) {}\n\n'.format( | |
total, avg, pension, pension_all, taxes)) | |
print('pension variable(percent) KBK : 39210202010062200160') | |
income1 = sum(income[i] for i in '123') | |
print(tax_info(1, income1)) | |
income2 = sum(income[i] for i in '123456') | |
print(tax_info(2, income2)) | |
income3 = sum(income[i] for i in '123456789') | |
print(tax_info(3, income3)) | |
print(tax_info(4, total)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment