Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nets = [12000,24000,36000,48000,60000]
- tax = {
- 'personalAllowance' : 11850,
- 'basicRate' : 0.2,
- 'basicRateUpperLimit' : 46350,
- 'higherRate' : 0.4,
- 'higherRateUpperLimit' : 150000,
- 'additionalRate' : 0.45
- }
- nic = {
- 'lowerProfitsLimit' : 8424,
- 'upperProfitsLimit' : 46356,
- 'basicRate' : 0.12,
- 'higherRate' : 0.02
- }
- threshold1 = nic['lowerProfitsLimit']
- threshold2 = tax['personalAllowance'] - nic['basicRate'] * (tax['personalAllowance'] - nic['lowerProfitsLimit'])
- threshold3 = (tax['personalAllowance'] + tax['basicRateUpperLimit']) - tax['basicRate'] * tax['basicRateUpperLimit'] - nic['basicRate'] * (nic['upperProfitsLimit'] - nic['lowerProfitsLimit'])
- threshold4 = (tax['personalAllowance'] + tax['higherRateUpperLimit']) - tax['higherRate'] * (tax['higherRateUpperLimit'] - tax['basicRateUpperLimit']) - tax['basicRate'] * tax['basicRateUpperLimit'] - nic['higherRate'] * (tax['personalAllowance'] + tax['higherRateUpperLimit'] - nic['upperProfitsLimit']) - nic['basicRate'] * (nic['upperProfitsLimit'] - nic['lowerProfitsLimit'])
- for net in nets:
- print "net: {}".format(net)
- if net <= threshold1:
- print net
- elif net <= threshold2:
- gross = (net - nic['basicRate'] * nic['lowerProfitsLimit']) / (1 - nic['basicRate'])
- elif net <= threshold3:
- gross = (net - (nic['basicRate'] * nic['lowerProfitsLimit']) - tax['basicRate'] * (tax['personalAllowance'])) / (1 - nic['basicRate'] - tax['basicRate'])
- elif net <= threshold4:
- gross = (net * 1 + nic['basicRate'] * (nic['upperProfitsLimit'] - nic['lowerProfitsLimit']) + tax['basicRate'] * tax['basicRateUpperLimit'] - nic['higherRate'] * nic['upperProfitsLimit'] - tax['higherRate'] * (tax['personalAllowance'] + tax['basicRateUpperLimit'])) / (1 - nic['higherRate'] - tax['higherRate'])
- else:
- gross = (net * 1 + nic['basicRate'] * (nic['upperProfitsLimit'] - nic['lowerProfitsLimit']) + tax['basicRate'] * tax['basicRateUpperLimit'] + tax['higherRate'] * (tax['higherRateUpperLimit'] - tax['basicRateUpperLimit']) - nic['higherRate'] * nic['upperProfitsLimit'] - tax['additionalRate'] * (tax['higherRateUpperLimit'] + tax['personalAllowance'])) / (1 - nic['higherRate'] - tax['additionalRate'])
- print "gross: {}".format(gross)
- print "----------"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement