Congratulations Gyle.
This is exactly how it should be done to keep everything balanced. Semi
monthly = 24 pays per year. fortnightly (every 2 weeks) indicates usually 26
or occasionally 27 pays per year.
Regards Kevin Shepherdson

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Gyle Iverson
Sent: Wednesday, December 01, 2004 7:44 AM
To: [EMAIL PROTECTED]
Subject: RE: [U2] [UD] Precision


Hello, Shawn.

There are some odd cent differences to account for in the monthly amount
calculations. I used the Iconv() function to round the fractional cents.

employerMonthlyAmount = IConv( monthlyAmount * percentage, "MD0" )
employeeMonthlyAmount = monthlyAmount - employerMonthlyAmount

For the semi-monthly amounts, these need to account for the odd cent too.
Use some function of the pay date to know if you are processing the first or
second pay period.

employerSemiAmount = IConv( employerMonthlyAmount / 2, "MD0" )
employeeSemiAmount = IConv( employeeMonthlyAmount / 2, "MD0" )
If firstOfMonth Then
   employerSemiAmount = employerMonthlyAmount - employerSemiAmount
   employeeSemiAmount = employeeMonthlyAmount - employeeSemiAmount
End

Best regards,
Gyle

>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Shawn Waldie
>Sent: Tuesday, November 30, 2004 11:24 AM
>To: [EMAIL PROTECTED]
>Subject: [U2] [UD] Precision
>
>
>I need some help from you payroll pros out here.
>
>Background:
>I've developed a subroutine that will read an "externally-maintained"
>dir-type file (insurance prem. table) for every employee when
>payroll is
>run.
>
>This table contains monthly insurance premiums for different types of
>covereage, i.e.,
>27748  64074   76278
>29236  68088   80620
>33368  75076   89396
>538    1016    1494
>1788   2277    2342
>The OCONV() for these is "MD2".
>The subroutine will find the appropriate premium in this table based on
>other criteria.
>
>
>Pertinent part:
>
>-Based on the employees' salary, the employer will pay either
>80, 70, or
>60 percent of this premium; with the employee
> paying the difference.
>-The Paychecks are issued semi-monthly.
>
>
>
>Here's my logic so far:
>
>MO.PREM = PREM.TBL<X,Y>
>
>BEGIN CASE
>  CASE X.SALARY LT 30000; * Employer pays 80%
>    X.EMPLYR.AMT = MO.PREM * 8 / 10
>    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
>  CASE ((X.SALARY GE 30000) AND (X.SALARY LT 40000)); * Employer pays
>70%
>    X.EMPLYR.AMT = MO.PREM * 7 / 10
>    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
>  CASE X.SALARY GE 40000; * Employer pays 60%
>    X.EMPLYR.AMT = MO.PREM * 6 / 10
>    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
>  CASE 1
>END CASE
>
>* Divide these amounts by two since since employees are payed twice per
>month.
>X.EMPLYR.AMT = X.EMPLYR.AMT / 2
>X.EMPLYE.AMT = X.EMPLYE.AMT / 2
>
>This is all working out satisfactorily, but I want to ensure that the
>accounting folks are happy at the end of the year, so I need
>something a
>little more rigorous.
>
>The internal format of X.EMPLYR.AMT & X.EMPLYE.AMT that is returned to
>the calling process must be such that if viewed 'externally', the
>conversion would MD2
>
>For example, if the monthly premium is 425
>Monthly premium: $425
>Employer (mo)..:  340 - 80%
>Employee (mo)..:   85 - 20%
>
>Per check -
>Employer: $170
>Employee:   42.50
>
>X.EMPLYR.AMT = 17000
>X.EMPLYE.AMT =  4250
>
>
>
>
>Suggestions welcome!
>************************************************
>* Shawn Waldie                San Juan College *
>* Programmer/Analyst         4601 College Blvd *
>* Phone: (505)566-3072   Farmington, NM  87402 *
>*      email: [EMAIL PROTECTED]       *
>************************************************
>-------
>u2-users mailing list
>[EMAIL PROTECTED]
>To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to