Define "a little more rigorous"?  Other than some rounding/truncation
issues, what exactly are you going for? 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shawn Waldie
Sent: Tuesday, November 30, 2004 12:24 PM
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/

Reply via email to