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

PRSAOTTR.m

Go to the documentation of this file.
  1. PRSAOTTR ;WCIOFO/JAH-LIST OVERTIME REQUESTS-8/18/98
  1. ;;4.0;PAID;**43**;Sep 21, 1995
  1. HDR ;
  1. S VALMHDR(1)="PP "_PRSRPPE_" Week "_PRSRWK_" Overtime Requests for "_PRSRNM
  1. Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  1. ;
  1. OTRQVW ;OVERTIME REQUESTS VIEW
  1. ; -- main entry point for PRSA VIEW OT REQ which is called by
  1. ; the PRSA VIEW OT REQ protocol on the PRSA OVERTIME WARNINGS
  1. ; List Template protocol menu.
  1. S PRSOUT=0
  1. ;
  1. K ^TMP("PRSAOTR",$J)
  1. N PRSRREC,PRSRIEN
  1. ;
  1. ;ask user to select an overtime warning. The requests on file
  1. ;associated with that warning will be displayed
  1. ;
  1. D PICKWARN
  1. ;
  1. Q:PRSOUT
  1. ;
  1. ; Call to List Manager to run PRSA OT VIEW REQ template
  1. D EN^VALM("PRSA VIEW OT REQ")
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  1. ;
  1. PICKWARN ;procedure asks for one entry on ot warnings list
  1. ; and gets the warnings data from the ot warnings file.
  1. ;
  1. ;allow selection of only one (1) of the items on the list.
  1. ;call returns VALMY() array subscripted by list item number.
  1. D EN^VALM2("","S")
  1. ;
  1. S PRSRREC="",PRSRREC=$O(VALMY(0))
  1. I $G(PRSRREC) D
  1. . ;Get ien for 458.6 that matches the list item.
  1. . S PRSRIEN=$G(^TMP("PRSAOTW",$J,PRSRREC)) ; Selected ot warn list num
  1. . S PRSRREC=$G(^PRST(458.6,PRSRIEN,0)) ; Data on ot warnings list item
  1. . S PRSRPPI=$P(PRSRREC,U,3) ; Pay period ien
  1. . S PRSRPPE=$P($G(^PRST(458,PRSRPPI,0)),U) ; External pp format
  1. . S PRSREMP=$P(PRSRREC,U,2) ; Employee 450 ien
  1. . S PRSRWK=$P(PRSRREC,U,4) ; Week 1 or 2 of pp
  1. . S PRSRNM=$P($G(^PRSPC(PRSREMP,0)),U) ; External emp name
  1. E S PRSOUT=1
  1. Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  1. ;
  1. INIT(PPI,PPE,WK,EMP) ;BUILD LIST OF OT REQUESTS FOR EMPLOYEE
  1. ;Input: PPI,PPE - pay period of concern. internal and external YY-PP
  1. ; WK - week (1) or week (2) of pay period
  1. ; EMP - employees internal entry number in file 450.
  1. ;
  1. ;local vars: D1 - 1st day of payperiod-returned by NX^PRSAPPU
  1. ; OTREC - a record containing 1 overtime request.
  1. ; START,STOP - 1st & last FM days of week (Sun,Sat)
  1. ;
  1. ; quit returning 0 if anything is missing.
  1. Q:$G(PPE)=""!$G(WK)=""!$G(EMP)="" 0
  1. ;
  1. ; Loop thru OT/CT requests file x-ref on requested work date &
  1. ; add employees OT requests within week to the list array.
  1. ;
  1. N D1,TOTALOT,START,STOP,OTREC,REQCNT
  1. ;
  1. ;get start and stop FM days for one week of the pay period.
  1. D WEEKRNG^PRSAOTT(PPE,WK,.START,.STOP)
  1. S (REQCNT,TOTALOT,VALMCNT)=0
  1. S D1=START-.1
  1. F S D1=$O(^PRST(458.2,"AD",EMP,D1)) Q:D1>STOP!(D1="") D
  1. . S OTREC=""
  1. . F S OTREC=$O(^PRST(458.2,"AD",EMP,D1,OTREC)) Q:OTREC="" D
  1. .. I $$OTREQ^PRSAOTT(OTREC) D
  1. ... S REQCNT=REQCNT+1
  1. ... D LISITEM(OTREC,REQCNT,.TOTALOT)
  1. I REQCNT=0 D
  1. . D SET^VALM10(1," NO REQUESTS FOUND")
  1. . S VALMCNT=1
  1. D SET^VALM10(REQCNT+VALMCNT+1,"----------------------------------------------")
  1. D SET^VALM10(REQCNT+VALMCNT+2,"Current requested overtime total: "_TOTALOT_" hrs.")
  1. ;
  1. ; set list manager counter of number of items in list including
  1. ; lines containing requests, total, and ----'s
  1. ;
  1. S VALMCNT=REQCNT+2+VALMCNT
  1. Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  1. ;
  1. LISITEM(IEN,COUNT,OTTOTAL) ;ADD A SINGLE ITEM TO VIEW OT REQ LIST
  1. N PRSSTAT,PRSHRS,PRSRQDT,OTREC,X
  1. ;
  1. ;Get data from OT requests file to build one (1) line in the
  1. ;list of one employee's ot requests for the week.
  1. ;
  1. S OTREC=$G(^PRST(458.2,IEN,0)) ; Ot/ct/ch requests file rec
  1. S PRSRQDT=$P(OTREC,U,3) ; Requested work date
  1. S PRSRQDT=$E($$FDATE^VALM1(PRSRQDT),1,12) ; External date
  1. S PRSHRS=$P(OTREC,U,6) ; # of hours requested
  1. ; Status of requests
  1. S PRSSTAT=$$EXTERNAL^DILFD(458.2,10,,$P(OTREC,U,8),)
  1. ;S PRSTL=$P(OTREC,U,9)
  1. ;
  1. ;Build one line (X) for list manager with an ot request.
  1. ; 3rd parameter is name of field on List Template
  1. ;
  1. S X=$$SETFLD^VALM1(COUNT,"","NUMBER")
  1. S X=$$SETFLD^VALM1(PRSHRS,X,"HRSREQ")
  1. S X=$$SETFLD^VALM1(PRSSTAT,X,"STATUS")
  1. S X=$$SETFLD^VALM1(PRSRQDT,X,"WORKDATE")
  1. ;
  1. ;add line built in X to the list
  1. ;
  1. D SET^VALM10(COUNT,X,COUNT)
  1. ;
  1. ;add OT hrs from this line to total OT requests for this list
  1. ;
  1. S OTTOTAL=PRSHRS+OTTOTAL
  1. ;
  1. ; save the ien of the record in the list global for easier
  1. ; reference to the acutal data.
  1. ;
  1. S ^TMP("PRSAOTR",$J,COUNT)=OTREC
  1. Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
  1. ;