Normal Topic x for Income tax. (Read 655 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
x for Income tax.
Jan 27th, 2010 at 9:19am
Print Post Print Post  
Hey All,
I am working on a payroll for a client and I am stuck on how I can work the income tax for here, this is how it works

if I earnt $65,238

$0 to $14,000                at 12.5% = $1,750.00
$14,001 to $48,000        at 21% =    $7,140.00
$48,001 to $65,238        at 33% =    $5,688.54
                                                    $14,578.54    

The total tax I would have to pay is $14,578.54


Please help me.......
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: x for Income tax.
Reply #1 - Jan 27th, 2010 at 3:14pm
Print Post Print Post  
Hello drastixnz

The following should work for you.

Code
Select All
Var vAmountToTax as Money
Var vTierOne as Money
Var vTierTwo as Money
Var vTierThree as Money
Var vTotalTax as Money

//Here is where you would set the Amount Taxable
vAmountToTax = 65238

	vTierOne = 0
	vTierTwo = 0
	vTierThree = 0
	//Tier One is 0 to 14,000
	vTierOne = vAmountToTax - 14000
	If vTierOne < 0 Then
	{
		vTierOne = vAmountToTax
	}
	Else
	{
		vTierOne = 14000
	}
	vAmountToTax = vAmountToTax - vTierOne
	If vAmountToTax > 0 Then
	{
		//Tier Two is now 0 to 34,0000 (48,000-14,000)
		vTierTwo = vAmountToTax - 34000
		If vTierTwo < 0 Then
		{
			vTierTwo = vAmountToTax
		}
		Else
		{
			vTierTwo = 34000
		}
		vAmountToTax = vAmountToTax - vTierTwo
		If vAmountToTax > 0 Then
		{
			//The Rest is Tier Three
			vTierThree = vAmountToTax
		}
	}
	vTotalTax = (vTierOne * .125) + (vTierTwo * .21) + (vTierThree * .33)

Writeln(vTotalTax) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: x for Income tax.
Reply #2 - Feb 4th, 2010 at 10:10pm
Print Post Print Post  
Cheers ray it worked well.
  
Back to top
IP Logged