Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRSRUTL

PRSRUTL.m

Go to the documentation of this file.
  1. PRSRUTL ;HISC/JH,WCIOFO/JAH-UTILITY FOR PAID ADDIM. REPORTS ;10/16/97
  1. ;;4.0;PAID;**2,16,24**;Sep 21, 1995
  1. CHKTLE ;CHECK IF SELECTED EMP. IS ASSIGNED TO USER
  1. S (STFSW,TL)=0 F S TL=$O(TLE(TL)) Q:TL'>0 D Q:STFSW
  1. . S TL(1)=0 F S TL(1)=$O(TLE(TL,TL(1))) Q:TL(1)'>0 D Q:STFSW
  1. .. I $P(TLE(TL,TL(1)),U)=D0 S NAM=$P(TLE(TL,TL(1)),U,2),STFSW=1 Q
  1. .. Q
  1. . Q
  1. W:'STFSW !?2,$C(7),"EMPLOYEE NOT ASSIGNED TO THAT T&L.",!
  1. Q
  1. QUERY N DA,I,X W @IOF,!!,"T&L's Assigned to you.",! S DA=0 F S DA=$O(TLE(DA)) Q:DA'>0 D
  1. . D:$Y>(IOSL-4) RTN W !?2,$P(TLE(DA),U)
  1. . Q
  1. Q
  1. RTN R !!,"Press Enter/Return to continue. ",X:DTIME Q:'$T
  1. Q
  1. STAFF(X) ;This utility will pass back an employees' STATION (if no duty station) ^ STATION_"."_DUTY STATION (if duty station) ^ ORGANIZATION ^
  1. ; SERVICE ^ TITLE '
  1. ;Input - D STAFF^PRSRUTL(.veriable), whereas 'veriable' is the
  1. ; employees Duz No.
  1. ;Output - variable = 'station_"."_duty station^T&L^organization^service^title'
  1. N STA,TLE,COS,COSORG,DTX,DA,ORG Q:X'>0 S STA=$P($G(^PRSPC(X,0)),"^",7),TLE=$P($G(^(0)),U,8),COSORG=$P(^(0),"^",49),DTY=$P($G(^(1)),U,42),Y=$P($G(^(0)),U,17) I Y'="" D OST^PRSDUTIL
  1. I TLE'="" S DA=0,DA=$O(^PRST(455.5,"B",TLE,0)),TLE=$P($G(^PRST(455.5,DA,0)),U,2)
  1. S COS=$S(COSORG'="":$E(COSORG,1,4),1:""),ORG=$S(COSORG'="":$E(COSORG,5,8),1:"")
  1. I ORG'="" S ORG=$O(^PRSP(454,1,"ORG","B",COS_":"_ORG,"")),ORG=$P(^PRSP(454,1,"ORG",ORG,0),"^",2),ORG=$P(^PRSP(454.1,ORG,0),"^")
  1. S X=$S(DTY'="":STA_"."_DTY,1:STA)_U_DA_U_TLE_U_Y_U_ORG Q
  1. DTY(DTY) ;This utility will pass back an employees 'duty station'.
  1. ;Input - D DTY^PRSRUTL(.variable), whereas 'variable' is the
  1. ; employees' Duz No.
  1. ;Output - variable = employees' duty station.
  1. S DTY=$P($G(^PRSPC(DTY,1)),U,42) Q
  1. UPPER(X) ;Convert contents in x to upper case.
  1. Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  1. CKSTOP S:$$S^%ZTLOAD ZTSTOP=1 Q
  1. ST D HOME^%ZIS Q
  1. DUZ S PRSRDUZ="",SSN=$P($G(^VA(200,DUZ,1)),"^",9) I SSN'="" S PRSRDUZ=$O(^PRSPC("SSN",SSN,0))
  1. I 'PRSRDUZ W !!,*7,"Your SSN was not found in Employee File!"
  1. I SSN="" W !!,*7,"Your SSN was not found in the New Person File!"
  1. Q
  1. CCORG(EMP0NODE) ;pass employees 0 node from file 450 EMP0NODE
  1. ;function returns employees cost center organization
  1. ; description (dx) from file 454.1. returns code if no dx.
  1. ; added in patch 16 by John Heiges
  1. ; EMP0NODE = the employee data from the zero node in file 450
  1. ;
  1. ; get piece 49 (field 458 in file 450, employees cost center/organiz)
  1. S COSORG=$P(EMP0NODE,"^",49)
  1. S COS=$S(COSORG'="":$E(COSORG,1,4),1:"")
  1. S ORG=$S(COSORG'="":$E(COSORG,5,8),1:"")
  1. I ORG'="" D
  1. . ;look up ccoc description. If no dx, just display ccoc.
  1. . N ORGDX
  1. . S ORGDX=$O(^PRSP(454,1,"ORG","B",COS_":"_ORG,""))
  1. . ;ptr 2 ccoc description
  1. . I ORGDX'="" S ORGDX=$P($G(^PRSP(454,1,"ORG",ORGDX,0)),"^",2)
  1. . I ORGDX'="" S ORG=$P(^PRSP(454.1,ORGDX,0),"^")
  1. . E S ORG=COS_":"_ORG
  1. Q ORG
  1. CCORGBUL(CODE,RPTDUZ,REPORT,EMP) ;
  1. ;This routine is invoked when the cost center organization code
  1. ;description is missing during the running of the EMPLOYEE LEAVE USED
  1. ;and the EMPLOYEE LEAVE PATTERN report. It sends a bulleting to
  1. ;the PAD mail group asking them to fix it.
  1. ;
  1. ;EMP = the employee who's leave is being looked at in the report
  1. ;CODE = cost center/organization code
  1. ;RPTDUZ = person who is running the report.
  1. ;REPORT : 1 = EMPLOYEE LEAVE USED, 0 = EMPLOYEE LEAVE PATTERN
  1. ;
  1. N TXT,I,XMDUZ,XMB,XMY,XMDUZ
  1. S XMY("G.PAD@"_^XMB("NETNAME"))=""
  1. S XMDUZ="DHCP PAID PACKAGE"
  1. S XMB="PRS UPDATE CCORG"
  1. S XMB(1)=CODE,XMB(2)=$P($G(^PRSPC(RPTDUZ,0)),"^",1)
  1. I REPORT>0 S XMB(3)="``Employee Leave Requested''"
  1. S XMB(4)=EMP
  1. E S XMB(3)="``Employee Leave Pattern''"
  1. D ^XMB
  1. Q