Welcome to Dream.In.Code
Become a VB Expert!

Join 137,265 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,507 people online right now. Registration is fast and FREE... Join Now!




how to calc overtime from gross and tax it

 
Reply to this topicStart new topic

how to calc overtime from gross and tax it, none

niftydee
13 Dec, 2006 - 09:40 PM
Post #1

New D.I.C Head
*

Joined: 13 Dec, 2006
Posts: 1


My Contributions
CODE
Imports Microsoft.VisualBasic

Public Class Management
    Implements Final.IPayCheck

    Private _benefitCode As String
    Private _taxCategoryId As String
    Private _benefitCost As Decimal

    Private _hoursWorked As Decimal
    Private _hourlySalary As Decimal


    Public Property benefitCode() As String Implements Final.IPayCheck.benefitCode
        Get
            Return Me._benefitCode
        End Get

        Set(ByVal value As String)
            Me._benefitCode = value
        End Set
    End Property

    Public Function getGrossWeeklySalary() As Decimal Implements Final.IPayCheck.getGrossWeeklySalary

        Dim grossPaycheck As Decimal
        grossPaycheck = Me._hoursWorked * Me._hourlySalary

        Return grossPaycheck

    End Function

    Public Function getNetWeeklySalary() As Decimal Implements Final.IPayCheck.getNetWeeklySalary

        Dim currentBenefitCost As Decimal
        Dim grossSalary As Decimal



        grossSalary = Me.getGrossWeeklySalary()

        If _benefitCode = "A" Then
            currentBenefitCost = (10000 / 12) * 0.05 / 4
        ElseIf _benefitCode = "B" Then
            currentBenefitCost = (15000 / 12) * 0.05 / 4
        ElseIf _benefitCode = "C" Then
            currentBenefitCost = (20000 / 12) * 0.05 / 4
        ElseIf _benefitCode = "D" Then
            currentBenefitCost = (25000 / 12) * 0.05 / 4
        ElseIf _benefitCode = "F" Then
            currentBenefitCost = (30000 / 12) * 0.05 / 4
        End If

        ' tax logic
        'Dim netSalary = grossSalary - currentBenefitCost ') - Tax
        Dim grossSalary1 As Decimal

        grossSalary1 = Me.getNetWeeklySalary

        'Dim grossSalary1 As Decimal

        Dim Tax As Decimal
        Dim T1 As Decimal
        Dim T2 As Decimal
        Dim T3 As Decimal
        Dim T4 As Decimal

        grossSalary1 = grossSalary - currentBenefitCost

        If T1 <= 500 Then
            Tax = (grossSalary1 * 0.05)
        ElseIf T2 <= 1000 Then
            Tax = (grossSalary1 * 0.1)
        ElseIf T3 <= 2000 Then
            Tax = (grossSalary1 * 0.3)
        ElseIf T4 <= 20000 Then
            Tax = (grossSalary1 * 0.35)
        End If



        Dim netSalary = grossSalary1 - Tax

        Return netSalary
    End Function


    Public Function getOvertimePay() As Decimal Implements Final.IPayCheck.getOvertimePay


        Return 0



    End Function

    Public Property hourlySalary() As Decimal Implements Final.IPayCheck.hourlySalary
        Get
            Return Me._hourlySalary
        End Get
        Set(ByVal value As Decimal)
            Me._hourlySalary = value
        End Set
    End Property

    Public Property hoursWorked() As Long Implements Final.IPayCheck.hoursWorked
        Get
            Return Me._hourlySalary
        End Get
        Set(ByVal value As Long)

            Me._hoursWorked = value

        End Set
    End Property
End Class

User is offlineProfile CardPM
+Quote Post

Mach1Guy
RE: How To Calc Overtime From Gross And Tax It
14 Dec, 2006 - 07:10 PM
Post #2

D.I.C Head
Group Icon

Joined: 4 Dec, 2006
Posts: 79



Thanked: 4 times
Dream Kudos: 25
My Contributions
is this just a code snippet or are you having some kind of problem with this piece of code?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:24PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month