0% found this document useful (0 votes)
70 views3 pages

Pay Deductions Balances Service

This document describes the PayDeductionsBalances service which provides deduction balance information for employees. It retrieves data from the PS_DEDUCTION_BAL table in the database, including the employee ID, company, balance details, deduction codes, amounts, and descriptions. The service returns the raw data or enhanced with translations from reference tables to provide more context to the deduction codes and types.

Uploaded by

balasuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views3 pages

Pay Deductions Balances Service

This document describes the PayDeductionsBalances service which provides deduction balance information for employees. It retrieves data from the PS_DEDUCTION_BAL table in the database, including the employee ID, company, balance details, deduction codes, amounts, and descriptions. The service returns the raw data or enhanced with translations from reference tables to provide more context to the deduction codes and types.

Uploaded by

balasuk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PayDeductionsBalances Service

Model: PayDeductionsBalances.java
Repository: PayDeductionsBalancesRepository.java
Service: PayDeductionsBalancesServiceImpl.java (interface PayDeductionsBalancesService.java)
Controller: PayDeductionsBalancesController.java
Example URLs:
http://javadev1.yrcw.com:5069/api/v1/paydeductionsbalances/emplid/0001000

Database table: PSFT88.PS_DEDUCTION_BAL number of columns: 14


View: PSFT88. YRC_DEDUCT_BAL _SERVICE
Public Synonym: YRC_DEDUCT_BAL_SERVICE

Note: This is an inquiry only service.

Service Data items:


Java name Database column
Id ID
emplid EMPLID
Company COMPANY
balanceYear BALANCE_YEAR
balanceQtr BALANCE_QTR
balancePeriod BALANCE_PERIOD
planType PLAN_TYPE
benefitPlan BENEFIT_PLAN
dedCd DEDCD
dedClass DED_CLASS
dedYtd DED_YTD
dedQtd DED_QTD
dedMtd DED_MTD
benefitRcdNbr BENEFIT_RCD_NBR
dedcdDesc select PLAN_TYPE, DEDCD, EFFDT, DESCR
from PSFT88.PS_DEDUCTION_TBL pdt
where pdt.EFFDT = (select max(effdt)
from PSFT88.PS_DEDUCTION_TBL y
where y.plan_type = pdt.plan_type
and y.dedcd = pdt.dedcd)
planTypeDesc PSFT88.PS_PLAN_TYPE_VW.DESCR
benefitPlanDesc select PLAN_TYPE, BENEFIT_PLAN, DESCR
from PSFT88.PS_BENEF_PLAN_TBL bpt
where bpt.EFFDT = (select max(effdt)
from PSFT88.PS_BENEF_PLAN_TBL x
where x.plan_type = bpt.plan_type
and x.BENEFIT_PLAN = bpt.BENEFIT_PLAN)
dedClassDesc select trim(i.fieldvalue) as fieldvalue,trim(i.xlatlongname) as descr
from PSFT88.PSXLATITEM i
where eff_status = 'A'
PayDeductionsBalances Service

and trim(FIELDNAME) = 'DED_CLASS'


and effdt = (select max(effdt)
from PSFT88.PSXLATITEM si
where si.eff_status = 'A'
and trim(si.FIELDNAME) = 'DED_CLASS'
and si.fieldvalue = i.fieldvalue)

SQL for returning data from table:


select rowidtochar(db.rowid) as ID, EMPLID
,COMPANY
,BALANCE_YEAR,BALANCE_QTR,BALANCE_PERIOD
,PLAN_TYPE,BENEFIT_PLAN
,DEDCD,DED_CLASS
,DED_YTD,DED_QTD,DED_MTD
,BENEFIT_RCD_NBR
from PSFT88.PS_DEDUCTION_BAL

SQL for returning data from table with translations:


select rowidtochar(db.rowid) as ID, trim(EMPLID) as EMPLID
,trim(COMPANY) as COMPANY
,trim(BALANCE_YEAR) as BALANCE_YEAR
,trim(BALANCE_QTR) as BALANCE_QTR
,trim(BALANCE_PERIOD) as BALANCE_PERIOD
,db.PLAN_TYPE,db.BENEFIT_PLAN
,db.DEDCD,db.DED_CLASS
,DED_YTD,DED_QTD,DED_MTD
,BENEFIT_RCD_NBR
,trim(dt.descr)as dedcdDesc
,trim(pt.descr) as planTypeDesc
,trim(bp.descr) as benefitPlanDesc
,trim(dc.descr) as dedClassDesc
from PSFT88.PS_DEDUCTION_BAL db
left outer join (select PLAN_TYPE, DEDCD, EFFDT, DESCR
from PSFT88.PS_DEDUCTION_TBL pdt
where pdt.EFFDT = (select max(effdt)
from PSFT88.PS_DEDUCTION_TBL y
where y.plan_type = pdt.plan_type
and y.dedcd = pdt.dedcd)
)dt
on db.PLAN_TYPE = dt.PLAN_TYPE
and db.DEDCD = dt.DEDCD
left outer join PSFT88.PS_PLAN_TYPE_VW pt
on db.PLAN_TYPE = pt.PLAN_TYPE
left outer join (select PLAN_TYPE, BENEFIT_PLAN, DESCR
from PSFT88.PS_BENEF_PLAN_TBL bpt
where bpt.EFFDT = (select max(effdt)
from PSFT88.PS_BENEF_PLAN_TBL x
where x.plan_type = bpt.plan_type
PayDeductionsBalances Service

and x.BENEFIT_PLAN = bpt.BENEFIT_PLAN)


)bp
on db.PLAN_TYPE = bp.PLAN_TYPE
and db.BENEFIT_PLAN = bp.BENEFIT_PLAN
Left outer join (
select trim(i.fieldvalue) as fieldvalue,trim(i.xlatlongname) as descr
from PSFT88.PSXLATITEM i
where eff_status = 'A'
and trim(FIELDNAME) = 'DED_CLASS'
and effdt = (select max(effdt)
from PSFT88.PSXLATITEM si
where si.eff_status = 'A'
and trim(si.FIELDNAME) = 'DED_CLASS'
and si.fieldvalue = i.fieldvalue)

) dc
on trim(db.DED_CLASS) = dc.fieldvalue
where balance_year = '2017' and trim(emplid) = '100437887'

You might also like