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

ACRFPR.m

Go to the documentation of this file.
ACRFPR ;IHS/DSD/THL,AEF - PAYROLL DATA; [ 09/23/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;
 ;UTILITY TO ENTER/EDIT PAYROLL DATA
 ;
EN D EXIT
 D EN1
EXIT K ACRCDATE,ACRODATE,ACRCANDA,ACRCAN,ACRFY,ACRQUIT,ACROUT,ACRCN,ACRPPN,ACRBY,ACRGP,ACRNE,ACROH,ACROP,ACRSSN,ACRCN,ACRDATE,ACRAU,ACRDOC,ACRDOCDA,ACRI,ACRJ,ACRLBDA,ACRMAX,ACRSS2,ACRSSDT,ACRX,ACRXX,ACRY
 K ^TMP("ACRPR",$J)
 Q
EN1 ;EDIT PERSONNEL DATA
 W @IOF
 W !?10,"PAYROLL DATA ENTRY UTILITY"
 S DIR(0)="FOA^6:6"
 S DIR("A")="Payroll Control NO.: "
 W !!
 D DIR^ACRFDIC
 I Y'?6N S ACRQUIT="" Q
 S ACRCN=Y
 S DIR(0)="NOA^1:52"
 S DIR("A")="Payroll Period.....: "
 D DIR^ACRFDIC
 I 'Y S ACRQUIT="" Q
 S ACRPPN=Y
 S DIR(0)="DOA^::E"
 S DIR("A")="GS Pay Period Ends.: "
 D DIR^ACRFDIC
 Q:Y'?7N
 S ACRCDATE=Y
 S DIR(0)="DOA^::E"
 S DIR("A")="CO Pay Period Ends.: "
 D DIR^ACRFDIC
 Q:Y'?7N
 S ACRODATE=Y
 S DIR(0)="NO^1000:9999"
 S DIR("A")="Fiscal Year........: "
 S DIR("B")=$S($E(ACRODATE,4,5)<10:$E(ACRODATE,1,3)+1700,1:($E(ACRODATE,1,3)+1)+1700)
 D DIR^ACRFDIC
 I Y'?4N S ACRQUIT="" Q
 S ACRFY=Y
 F  D CAN Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
CAN ;SELECT CAN NUMBER
 S DIC="^ACRLOCB("
 S DIC(0)="AEQZ"
 S DIC("A")="Payroll CAN........: "
 S DIC("S")="I $P($G(^ACRLOCB(+Y,""DT"")),U)=ACRFY"
 S D="DCAN"
 D IX^ACRFDIC
 I Y<1 S ACRQUIT="" Q
 S ACRLBDA=+Y
 S ACRCANDA=$P(^ACRLOCB(ACRLBDA,"DT"),U,9)
 S ACRCAN=$P(^AUTTCAN(ACRCANDA,0),U)
 D NEWPAY
 I '$O(^ACRAU("CAN",ACRCANDA,0)) D  Q
 .W !!,"No employees for this payroll CAN."
 .D PAUSE^ACRFWARN
 D DATA
 K ACRQUIT
 Q:$D(ACROUT)
 D PPSUM
 W !!,"NEXT"
 Q
DATA ;FIND EMPLOYEES AND EDIT PAYROLL INFO
 F  D D1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
D1 N ACRAUDA
 S (ACRAUDA,ACRJ)=0
 F  S ACRAUDA=$O(^ACRAU("CAN",ACRCANDA,ACRAUDA)) Q:'ACRAUDA  D
 .;S ACRAU=$P(^VA(200,ACRAUDA,0),U)  ;ACR*2.1*19.02 IM16848
 .S ACRAU=$$NAME2^ACRFUTL1(ACRAUDA)  ;ACR*2.1*19.02 IM16848
 .Q:ACRAU=""
 .S ACRSSN=$P($G(^VA(200,ACRAUDA,1)),U,9)
 .Q:ACRSSN=""
 .S ^TMP("ACRPR",$J,ACRSSN)=ACRAUDA_U_ACRAU
 Q:'$D(^TMP("ACRPR",$J))
 D EMPLIST
 Q:$D(ACRQUIT)
 D SELECT
 Q
EMPLIST D EMPLH
 K ACRSSN
 S ACRJ=0
 S ACRSSN=""
 F  S ACRSSN=$O(^TMP("ACRPR",$J,ACRSSN)) Q:ACRSSN=""!$D(ACRQUIT)  D
 .S ACRJ=ACRJ+1
 .S ACRSSN(ACRJ)=^TMP("ACRPR",$J,ACRSSN)_U_ACRSSN
 S ACRMAX=ACRJ
 S ACRJ=0
 S ACRSSN=""
 F  S ACRSSN=$O(^TMP("ACRPR",$J,ACRSSN)) Q:ACRSSN=""!$D(ACRQUIT)  D
 .S ACRJ=ACRJ+1
 .W !,ACRJ,?4,ACRSSN,?14,$E($P(ACRSSN(ACRJ),U,2),1,20)
 .K ACR,ACROH,ACROT,ACRBH
 .D EDATA:$D(ACRDOCDA)
 .I $G(ACR(1))]"" W ?35,$J($FN(ACR(1),"P",2),8),?44,$J(ACROH,3),?49,$J($FN(ACROT,"P",2),7),?58,$J(ACRBH,3),?62,$J($FN(ACR(1)+ACR(2),"P",2),10),?72,$J($FN(ACR(2),"P",2),7)
 .I IOSL-4<$Y D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D EMPLH
 Q
EDATA ;FIND EMPLYEE PAYROLL INFO FOR THE PAY PERIOD
 S ACRAUDA=+ACRSSN(ACRJ)
 N ACRSSDA,ACRJ
 S (ACRSSDA,ACRJ)=0
 F  S ACRSSDA=$O(^ACRSS("PR",ACRFY,ACRCN,ACRAUDA,ACRSSDA)) Q:'ACRSSDA  D
 .S ACRJ=ACRJ+1
 .S ACRSSDT=$G(^ACRSS(ACRSSDA,"DT"))
 .S ACRSS2=$G(^ACRSS(ACRSSDA,2))
 .I ACRJ=1 S ACR(1)=$P(ACRSSDT,U,4),ACROH=$P(ACRSS2,U,7),ACROT=$P(ACRSS2,U,8),ACRBH=$P(ACRSS2,U,9)
 .I ACRJ=2 S ACR(2)=$P(ACRSSDT,U,4)
 Q
EMPLH ;EMPLOYEE LIST HEAD
 D PPSUM
 D PPCAN
 W !!,?35,"GROSS",?44,"OVERTIME",?58,"BASE",?63,"NET",?72,"FRINGE"
 W !,"NO.",?4,"SSN",?14,"EMPLOYEE",?35,"PAY",?44,"HRS",?49,"PAY",?58,"HRS",?63,"EXPEND",?72,"BENEFITS"
 W !,"---",?4,"---------",?14,"--------------------",?35,"--------",?44,"----",?49,"-------",?58,"----",?63,"--------",?72,"-------"
 Q
PPSUM ;PAYPERIOD SUMMARY
 W @IOF
 W !?4,"Payroll Control NO.: ",ACRCN
 W !?4,"Payroll Period.....: ",ACRPPN
 W !?4,"Pay Period Ends....: "
 F Y=ACRCDATE,ACRODATE X ^DD("DD") W Y,?$X+3
 W !?4,"Fiscal Year........: ",ACRFY
 Q
PPCAN ;PAY PERIOD CAN
 W !?4,"Payroll CAN........: ",ACRCAN
 Q
SELECT ;SELECT TYPE OF ACTION AND EMPLOYEES
 S DIR(0)="SO^1:EDIT Existing Payroll entry;2:ADD New Payroll entry;3:REMOVE Payroll entry"
 S DIR("A")="Which One"
 W !
 D DIR^ACRFDIC
 I Y<1 S ACRQUIT="" Q
 I Y=1 D EDIT Q
 I Y=2 D ADD Q
 I Y=3 D REMOVE Q
 Q
PDAT ;EP;TO REVIEW EMPLOYEE DATA
 Q
EDIT ;
 D WHICH
 Q:'$G(ACRXX)
 N ACRJ
 F ACRJ=1:1 S ACRX=$P(ACRXX,",",ACRJ) Q:'ACRX  I $D(ACRSSN(ACRX)) S ACRAUDA=+ACRSSN(ACRX) D E1
 Q
E1 ;EDIT EACH ENTRY
 Q:'$G(ACRAUDA)
 ;W !!,"Edit existing data for: ",$P($G(^VA(200,ACRAUDA,0)),U)  ;ACR*2.1*19.02 IM16848
 W !!,"Edit existing data for: ",$$NAME2^ACRFUTL1(ACRAUDA)  ;ACR*2.1*19.02 IM16848
 W !,"       For Fiscal Year: ",ACRFY," Pay Period: ",ACRPPN," Control NO.: ",ACRCN
 N ACRJ,ACRSSDA
 S (ACRSSDA,ACRJ)=0
 F  S ACRSSDA=$O(^ACRSS("PR",ACRFY,ACRCN,ACRAUDA,ACRSSDA)) Q:'ACRSSDA  D
 .S ACRJ=ACRJ+1
 .S DA=ACRSSDA
 .S DIE="^ACRSS("
 .I ACRJ=1 S DR="12GROSS PAY...........;36T;37T;38T"
 .E  S DR="12BENEFITS............"
 .D DIE^ACRFDIC
 .D E11
 Q
E11 S DA=ACRSSDA
 S DIE="^ACRSS("
 S DR="18////"_$P(^ACRSS(ACRSSDA,"DT"),U,4)_";16.1////"_$P(^("DT"),U,4)
 D DIE^ACRFDIC
 Q
WHICH S DIR(0)="LOA^1:"_ACRMAX
 S DIR("A")="Which one(s): "
 W !
 D DIR^ACRFDIC
 Q:'+Y
 S ACRXX=Y
 Q
REMOVE D WHICH
 Q:'$G(ACRXX)
 S DIR(0)="YO"
 S DIR("A")="Are you certain you want to"
 S DIR("A")="REMOVE entr"_$S($P(ACRXX,",",2):"ies",1:"y")_" "_ACRXX
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 N ACRJ
 F ACRJ=1:1 S ACRX=$P(ACRXX,",",ACRJ) Q:'ACRX  D R1
 Q
R1 ;REMOVE ENTRIES
 N ACRSSDA
 S ACRSSDA=0
 F  S ACRSSDA=$O(^ACRSS("PR",ACRFY,ACRCN,ACRAUDA,ACRSSDA)) Q:'ACRSSDA  D
 .S DA=ACRSSDA
 .S DIK="^ACRSS("
 .D DIK^ACRFDIC
 Q
ADD ;
 S ACRI=0
 F  S ACRI=$O(ACRSSN(ACRI)) Q:'ACRI!$D(ACRQUIT)  D
 .S ACRAUDA=+ACRSSN(ACRI)
 .Q:'ACRAUDA
 .Q:$O(^ACRSS("PR",ACRFY,ACRCN,ACRAUDA,0))
 .D NEW
 K ACRQUIT
 Q
NEW ;
 S ACRAU=ACRSSN(ACRI)
 S ACRAUDA=+ACRAU
 S ACRDATE=$P(^ACRAU(ACRAUDA,1),U,3)
 I ACRDATE="CO" S ACRDATE=ACRODATE
 E  S ACRDATE=ACRCDATE
 D PPSUM
 D PPCAN
 ;W !!,"PAYROLL DATA FOR: ",@ACRON,$P(^VA(200,ACRAUDA,0),U),@ACROF,!  ;ACR*2.1*19.02 IM16848
 W !!,"PAYROLL DATA FOR: ",@ACRON,$$NAME2^ACRFUTL1(ACRAUDA),@ACROF,!  ;ACR*2.1*19.02 IM16848
 S DIR(0)="NOA^0:99999.99:2"
 S DIR("A")="GROSS PAY.....: "
 D DIR^ACRFDIC
 Q:Y<1
 S ACR(1)=Y
 S DIR(0)="NOA^0:80"
 S DIR("A")="OVERTIME HOURS: "
 D DIR^ACRFDIC
 S ACROH=Y
 S DIR(0)="NOA^0:9999.99:2"
 S DIR("A")="OVERTIME PAY..: "
 D DIR^ACRFDIC
 S ACROT=Y
 S DIR(0)="NOA^0:80"
 S DIR("A")="BASE HOURS....: "
 S DIR("B")=$S($P($G(^ACRAU(+$G(ACRAUDA),1)),U,3)="CO":160,1:80)
 D DIR^ACRFDIC
 S ACRBH=Y
 Q:Y<1
 S DIR(0)="NOA^0:99999.99:2"
 S DIR("A")="NET EXPEND....: "
 D DIR^ACRFDIC
 S ACR(2)=Y
 Q:Y<1
 D CONFIRM
 I $D(ACRQUIT) K ACRQUIT Q
 F ACRJ=1,2 D FILE
 Q
FILE S X=ACRJ
 S DIC="^ACRSS("
 S DIC(0)="L"
 S ACROBJDA=1
 S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";.04////"_ACROBJDA_";.05////"_ACRCANDA_";.06////"_ACRLBDA_";.13////"_ACRFY_";.17////"_ACRAUDA_";.2////"_ACRDOCDA_";1////"_ACRCN_";5////"_ACRPPN_";10////1;11///EA;15.3////"_ACRDATE
 I ACRJ=1 S DIC("DR")=DIC("DR")_";12////"_ACR(1)_";18////"_ACR(1)_";16.1////"_ACR(1)_";36////"_ACROH_";37////"_ACROT_";38////"_ACRBH
 I ACRJ=2 S ACRX=ACR(2)-ACR(1) S DIC("DR")=DIC("DR")_";12////"_ACRX_";18////"_ACRX_";16.1////"_ACRX
 D FILE^ACRFDIC
 S ACRSSDA=+Y
 Q
CONFIRM ;CONFIRM PAYROLL DATA
 S DIR(0)="YO"
 S DIR("A")="File PAYROLL DATA"
 S DIR("B")="YES"
 W !
 D DIR^ACRFDIC
 S:Y'=1 ACRQUIT=""
 Q
NEWPAY ;CREATE PAY ENTRY FOR NEW PAY PERIOD AND NEW DEPARTMENT ACCOUNT
 S ACRDOC=ACRFY_"-"_ACRCN
 S ACRDOCDA=$O(^ACRDOC("B",ACRDOC,0))
 Q:ACRDOCDA
 K ACRDOCDA
 S X=ACRDOC
 S DIC="^ACRDOC("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRCN_";.03////"_DT_";.04////18;.06////"_ACRLBDA_";.13////60;.14////"_ACRFY_"-"_ACRCN_";130080////"_ACRCDATE_";130090////"_ACRODATE
 D FILE^ACRFDIC
 I Y<1 G NEWPAY
 S ACRDOCDA=+Y
PN1 S X=ACRDOCDA
 S DIC="^ACROBL("
 S DIC(0)="L"
 S DIC("DR")=".03////"_ACRLBDA_".05////"_DUZ_";.06////"_DT_";.1////60;1////"_ACRDOCDA_";120////SALARIES FOR FY: "_ACRFY_";121////CONTROL NO.: "_ACRCN_", PAY PERIOD: "_ACRPPN
 D FILE^ACRFDIC
 I Y<1 G PN1
 Q
PINFO ;EP;TO ENTER PERSONNEL INFO
 F  D PI1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT,ACROUT
 Q
PI1 S DIC="^ACRAU("
 S DIC(0)="AEMQZ"
 S DIC("A")="Employee's Name.....: "
 D PIH
 D DIC^ACRFDIC
 I Y<1 S ACRQUIT="" Q
 S DA=+Y
 S DIE="^ACRAU("
 S DR="[ACR PERSONNEL INFO]"
 D DDS^ACRFDIC
 I $D(ACRSCREN) K ACRSCREN D DIE^ACRFDIC
 Q
PIH W @IOF
 W !?20,"Enter Employee Personnel Information",!!
 Q