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

PRSA8BNI.m

Go to the documentation of this file.
  1. PRSA8BNI ;WOIFO/JAH - Tour Hours vs 8B Norm Hrs Report ;7/9/08
  1. ;;4.0;PAID;**116,117**;Sep 21, 1995;Build 32
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. GETPP() ;prompt for pay period
  1. N DIC,X,Y,PPI,DTOUT
  1. S DIC="^PRST(458,",DIC(0)="AEQM",DIC("A")="Select PAY PERIOD: "
  1. W !
  1. D ^DIC
  1. S PPI=+Y
  1. I $D(DTOUT)!(+Y'>0) S PPI=0
  1. Q PPI
  1. NOTOURS() ;return true if user wants to see data from employees with
  1. ; no tour of duty set up yet
  1. ; otherwise return 0 or -1 for abort
  1. ;
  1. N DIR,DIRUT,Y
  1. S DIR(0)="Y"
  1. S DIR("B")="N"
  1. S DIR("A")="Include employees with no tour of duty entered"
  1. D ^DIR
  1. Q:$D(DIRUT) -1
  1. Q +Y
  1. ;
  1. NOTCARD() ;return true if user wants to see data from employees with
  1. ; no timecard on file, ie no entry for pp in 458
  1. ; otherwise return 0 or -1 for abort
  1. ;
  1. N DIR,DIRUT,Y
  1. S DIR(0)="Y"
  1. S DIR("B")="N"
  1. S DIR("A")="Include employees with no timecard on file"
  1. D ^DIR
  1. Q:$D(DIRUT) -1
  1. Q +Y
  1. SHONOTES() ;return true if user wants to see footnotes that describe
  1. ; the columns in the report at the end of the report
  1. ;
  1. N DIR,DIRUT,Y
  1. S DIR(0)="Y"
  1. S DIR("B")="N"
  1. S DIR("A")="Include report footnotes"
  1. D ^DIR
  1. Q:$D(DIRUT) -1
  1. Q +Y
  1. DAILYHRS() ;return true if user wants to see tour hours for each day
  1. ; otherwise return 0 or -1 for abort
  1. ;
  1. N DIR,DIRUT,Y
  1. S DIR(0)="Y"
  1. S DIR("B")="N"
  1. S DIR("A")="Include employees daily tour hours"
  1. D ^DIR
  1. Q:$D(DIRUT) -1
  1. Q +Y
  1. ;
  1. TRHDR ;
  1. W !!,?7,"Day",?12,"ToD #*",?19,"Tour Week 1",?34,"Hours*",?47,"ToD #*",?54,"Tour Week 2",?69,"Hours*"
  1. W !,?7,"---",?12,"-----",?19,"-----------",?34,"-----",?47,"-----",?54,"-----------",?69,"-----"
  1. Q
  1. EMPINFO(PRSENAME,PRSSN,HRS) ;
  1. W !!?2,PRSENAME,?26,PRSSN,?44,$P(HRS,U),?55,$P(HRS,U,2)
  1. I $G(DUZ(0))="@" W ?63,PRSIEN
  1. Q
  1. HDR(PG,TSTAMP,END,FORWHO,PPE,PPRANGE,OPT) ;
  1. S PG=PG+1
  1. W @IOF
  1. N H1,H2,B,OPTHDR
  1. S H1="VA TIME & ATTENDANCE REPORT "_FORWHO_"--"_TSTAMP
  1. S B=$E(" ",1,(IOM-$L(H1))\2-3-$L(PG))
  1. S OPTHDR=$S($G(OPT)>0:"Display Employee Tour Hours",1:"Tour Hrs Don't Match 8B Normal Hrs")
  1. S H2=OPTHDR_": PP "_PPE_" ("_PPRANGE_")"
  1. W !,?(IOM-$L(H1)\2),H1,B,"p",PG,!,?(IOM-$L(H2)\2),H2
  1. Q:END
  1. W !!,?2,"EMPLOYEE NAME",?26," SSN",?40,"8B NRM HRS ToD HRS*"
  1. I $G(DUZ(0))="@" W ?63,"IEN 450"
  1. W !?2,"======================",?26,"===========",?40,"========== ======="
  1. I $G(DUZ(0))="@" W " ======="
  1. Q
  1. ;
  1. RET(TSTAMP) ;
  1. I ($E(IOST,1,2)'="C-")!($D(ZTQUEUED)) D HDR(.PG,TSTAMP,0,FORWHO,PPE,PPRANGE) Q 0
  1. ;
  1. N OUT
  1. S OUT=$$ASK^PRSLIB00(1)
  1. I 'OUT D HDR(.PG,TSTAMP,0,FORWHO,PPE,PPRANGE)
  1. Q OUT
  1. GETHOURS(PPI,PRSIEN) ; Return TOUR HOURS AND NORMAL HOURS
  1. N MATCH,HRS,NH,ENT,ENTPTR,DFN,TH
  1. I $G(PPI)'>0!($G(PRSIEN)'>0) Q 1
  1. S MATCH=1
  1. S NH=-1
  1. S ENTPTR=$P($G(^PRST(458,PPI,"E",PRSIEN,0)),U,5)
  1. I ENTPTR'="" D
  1. . S ENT=$P($G(^PRST(457.5,ENTPTR,1)),U)
  1. . S NH=$E($G(^PRST(458,PPI,"E",PRSIEN,5)),26,27)
  1. . Q:NH="00"
  1. . I +NH'>0 S NH=$P($G(^PRSPC(PRSIEN,0)),U,50)
  1. I $G(ENT)="" S DFN=PRSIEN D ^PRSAENT
  1. I $G(ENT)'="",$E(ENT)'="D",($E(ENT,1,2)'="0D") D
  1. . D TOURHRS^PRSARC07(.HRS,PPI,PRSIEN)
  1. . S TH=($G(HRS("W1"))+$G(HRS("W2")))
  1. Q NH_U_TH
  1. ;
  1. REPDONE(OUT,TLECNT,TSTAMP,DAILYHRS,GRANDTOT) ; report done display page
  1. ;
  1. I TLECNT=0 D HDR(.PG,TSTAMP,1,FORWHO,PPE,PPRANGE) W !,"NO T&L UNITS WERE FOUND ASSIGNED TO YOU THAT COULD BE CHECKED." Q
  1. I 'OUT,$Y>(IOSL-24) S OUT=$$ASK^PRSLIB00(1) D HDR(.PG,TSTAMP,1,FORWHO,PPE,PPRANGE)
  1. I OUT W !!,"********REPORT ABORTED*********"
  1. E W !!,"REPORT COMPLETED. TOTAL MISMATCHES FOUND: ",GRANDTOT
  1. D FOOTNOTE(DAILYHRS)
  1. Q
  1. FOOTNOTE(DAILYHRS) ; display notes about the report
  1. W !,"================================================================="
  1. N TXT,I
  1. W !
  1. F I=1:1 S TXT=$P($T(ALLFT+I),";",3) Q:TXT="" W !,TXT
  1. I DAILYHRS D
  1. . F I=1:1 S TXT=$P($T(DAILYFT+I),";",3) Q:TXT="" W !,TXT
  1. Q
  1. ALLFT ;;
  1. ;; FOOTNOTES TO REPORT HEADINGS
  1. ;; ============================
  1. ;;*ToD HRS (Tour of Duty Hours) The total Tour of Duty hours that fall within the
  1. ;;-------- two week pay period, beginning midnight Saturday. Hours that cross
  1. ;; midnight from a tour that starts on the last day of a pay period will
  1. ;; appear on the following pay period.
  1. ;;.....................................................................
  1. DAILYFT ;;
  1. ;;*Hours (DAILY TOUR HOURS) This column contains actual tour hours that fall
  1. ;;------ on that day from the 24 hour period beginning at midnight. A two day
  1. ;; tour will contribute hours to each day the tour falls on. Hours
  1. ;; that cross midnight from a tour that starts on the last day of a pay
  1. ;; period will appear on the following pay period.
  1. ;;.....................................................................
  1. ;;*ToD # (Tour of Duty Number) The tour's entry number in the Tour
  1. ;;------ of Duty file (#457.1)
  1. ;;.....................................................................