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

ACRFTPAR.m

Go to the documentation of this file.
ACRFTPAR ;IHS/OIRM/DSD/THL,AEF - ENTER MULTIPLE PARTICIPANTS FOR GROUP TRAINING; [ 09/26/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;UTILITY TO MANAGE GROUP TRAINING PARTICIPANTS
EN N ACRLBDA,ACRCAN,ACROBJ
 D EXIT
 S ACRSSDA=$O(^ACRSS("J",ACRDOCDA,0))
 Q:'ACRSSDA
 S ACROBJO=$P($G(^ACRSS(ACRSSDA,0)),U,4)
 S ACRCANO=$P($G(^ACRSS(ACRSSDA,0)),U,5)
 Q:'ACROBJO!'ACRCANO
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACR,ACRQUIT,ACROUT,ACRTPDA,ACRDUZ,ACRJ,ACRTP0,ACRTP,ACRMAX,ACRPAGE,ACRCANX,ACROBJO,ACRCANO
 K ^TMP("ACRTP",$J)
 Q
EN1 ;
 D LIST
 D SELECT
 Q
LIST ;EP;TO LIST PARTICIPANTS FOR GROUP TRAINING
 Q:$D(ACRTPALL)
 K ^TMP("ACRTP",$J),ACR,ACRCANX
 S ACRPAGE=0
 D HEAD
 S ACRTPDA=0
 F  S ACRTPDA=$O(^ACRTPAR("C",ACRDOCDA,ACRTPDA)) Q:'ACRTPDA!$D(ACRQUIT)!$D(ACROUT)  D
 .S ACRTP0=$G(^ACRTPAR(+ACRTPDA,0))
 .Q:ACRTP0=""
 .Q:'$P(ACRTP0,U,2)!'$P(ACRTP0,U,3)
 .S ACRLBDA=$P(ACRTP0,U,3)
 .S ACRCAN=$P($G(^ACRLOCB(ACRLBDA,"DT")),U,9)
 .S ACRCAN=$P($G(^AUTTCAN(+ACRCAN,0)),U)
 .;S ACRTP=$P($G(^VA(200,+ACRTP0,0)),U)  ;ACR*2.1*19.02 IM16848
 .S ACRTP=$$NAME2^ACRFUTL1(+ACRTP0)  ;ACR*2.1*19.02 IM16848
 .Q:ACRTP=""
 .S ^TMP("ACRTP",$J,ACRCAN,ACRTP)=$P(ACRTP0,U,4,5)_U_ACRTPDA
 S ACRJ=0
 S ACRCAN=""
 F  S ACRCAN=$O(^TMP("ACRTP",$J,ACRCAN)) Q:ACRCAN=""!$D(ACRQUIT)!$D(ACROUT)  D
 .S ACRTP=""
 .F  S ACRTP=$O(^TMP("ACRTP",$J,ACRCAN,ACRTP)) Q:ACRTP=""!$D(ACROUT)  S ACRTP0=^(ACRTP) D
 ..S ACRJ=ACRJ+1
 ..S ACR(ACRJ)=$P(ACRTP0,U,3)
 ..Q:$D(ACRQUIT)
 ..I ACRCAN'=$G(ACRCANX) W !,ACRCAN S ACRCANX=ACRCAN
 ..E  W !
 ..W ?9,ACRJ,?14,ACRTP
 ..D SS
 .I $Y+4>IOSL D PAUSE^ACRFWARN,HEAD
 S ACRMAX=ACRJ
 I $D(ACRTPAR) D PAUSE^ACRFWARN K ACRTPAR
 Q
SS ;LIST CHARGES FOR INDIVIDUAL PARTICIPANT
 N J,X,Y
 S J(1)=$P(ACRTP0,U)
 S J(2)=$P(ACRTP0,U,2)
 F X=1,2 I J(X),$D(^ACRSS(J(X),"DT")) S Y=$P(^("DT"),U,4) D
 .W:X=1 ?46
 .W:X=2 ?60
 .W $J($FN(Y,"P,",2),12)
 Q
SELECT ;SELECT FUNCTION
 S DIR(0)="SO^1:Add Training Participants;2:Edit a Training Participant;3:DELETE a Training Participant;4:PRINT the Training Participant List"
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'$G(Y)
 I Y=1 D ADD S Y=1
 I Y=2 D EDIT S Y=2
 I Y=3 D DELETE S Y=3
 I Y=4 D PRINT S Y=4
 K ACRQUIT
 Q
ADD ;ADD PARTICIPANT TO GROUP TRAINING LIST
 F  D ADD1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
ADD1 W @IOF
 W !,"Add additional participants to TRAININ REQUEST ",$P(^ACRDOC(ACRDOCDA,0),U)
 D TRAINEE
 I '$G(ACRDUZ) S ACRQUIT="" Q
 I $D(^ACRTPAR("AC",ACRDOCDA,ACRDUZ)) D A1 Q
 D ACCOUNT
 I '$G(ACRLBDA)!'$G(ACRCANDA) S ACRQUIT="" Q
 D CERTAIN
 Q:$D(ACRQUIT)!$D(ACROUT)
A1 S ACRTPDA=$O(^ACRTPAR("AC",ACRDOCDA,ACRDUZ,0))
 Q:'ACRTPDA
 D E1
 Q
TRAINEE ;SELECT TRAINEE TO ADD, EDIT OR DELETE
 K ACRDUZ
 S DIC="^ACRAU("
 S DIC(0)="AEMQZ"
 S DIC("A")="Name of TRAINEE: "
 W !
 D DIC^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!($G(Y)<1) S ACRQUIT="" Q
 S ACRDUZ=+Y
 N X
 ;S X=$P($G(^VA(200,+Y,0)),U)  ;ACR*2.1*19.02 IM16848
 S X=$$NAME2^ACRFUTL1(+Y)  ;ACR*2.1*19.02 IM16848
 S ACRTP=$P($P(X,",",2)," ")_" "_$P(X,",")
 I $P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,2)=ACRDUZ D  Q
 .W !!,ACRTP," is the ATTENDEE of record for this 350"
 .W !,"and does not need to be added again."
 .K ACRDUZ
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 Q
ACCOUNT ;SELECT DEPARTMENT ACCOUNT TO WHICH TO CHARGE EXPENSES
 K ACRLBDA,ACRCANDA
 S ACRFY=$P($G(^ACRLOCB(+$P($G(^ACRDOC(+$G(ACRDOCDA),0)),U,6),"DT")),U)
 I '$D(^ACRLOCB("SEC",ACRDUZ)) D  Q
 .W !!,ACRTP," does not have access to any DEPARTMENT ACCOUNTS."
 .W !,$S($P($G(^VA(200,ACRDUZ,1)),U,2)="M":"He",$P($G(^(1)),U,2)="F":"She",1:"Attendee")
 .W " must have access to a DEPARTMENT ACCOUNT"
 .W !,"before one can be selected."
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 N X
 S X=0
 F  S X=$O(^ACRLOCB("SEC",ACRDUZ,X)) Q:'X!$D(ACRQUIT)  I $P($G(^ACRLOCB(X,"DT")),U)=ACRFY S ACRQUIT=""
 I '$D(ACRQUIT) D  Q
 .W !,ACRTP," must have access to a DEPARTMENT ACCOUNT"
 .W !,"from FISCAL YEAR ",ACRFY," before one can be selected."
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 E  K ACRQUIT
 S DIC="^ACRLOCB("
 S DIC(0)="AEQZ"
 S DIC("S")="I $D(^ACRLOCB(""SEC"",ACRDUZ,+Y)),$P($G(^ACRLOCB(+Y,""DT"")),U)=ACRFY"
 S D="DCAN"
 S DIC("A")="to COMMON ACCOUNTING NUMBER: "
 W !!,"Charge expenses for ",ACRTP
 D IX^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!($G(Y)<1)
 S ACRLBDA=+Y
 I '$D(^ACRLOCB("SEC",ACRDUZ,ACRLBDA)) D  Q
 .W !!,"Training Expenses for ",ACRTP
 .W !,"cannot be charged to this account."
 .D PAUSE^ACRFWARN
 .K ACRQUIT
 S ACRCANDA=$P($G(^ACRLOCB(+Y,"DT")),U,9)
 Q
CERTAIN ;CONFIRM ADDITION OF TRAINEE
 S DIR(0)="YO"
 S DIR("A")=ACRTP_" to this TRAINING REQUEST"
 S DIR("A",1)="Are you CERTAIN you want to add"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!($G(Y)'=1) S ACRQUIT="" Q
FILE ;FILE NEW ATTENDEE
 S X=ACRDUZ
 S DIC="^ACRTPAR("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRLBDA
 D FILE^ACRFDIC
 S ACRTPDA=+Y
 F ACRX=1,2 D
 .S X=ACRX
 .S DIC="^ACRSS("
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";.04////"_ACROBJO_";.05////"_ACRCANDA_";.06////"_ACRLBDA_";5////"_$S(X=1:"Tuition & Fees",1:"Books & Other")
 .D FILE^ACRFDIC
 .S DA=ACRTPDA
 .S DIE="^ACRTPAR("
 .S DR=$S(ACRX=1:".04",1:".05")_"////"_+Y
 .D DIE^ACRFDIC
 Q:$P($G(^ACRAU(ACRDUZ,1)),U,14)
 S DA=ACRTPDA
 S DIE="^ACRTPAR("
 S DR=".06T;.07T;.08T"
 D DIE^ACRFDIC
 Q
EDIT ;EDIT PARTICIPATN CURRENTLY ON GROUP TRAINING LIST
 I ACRMAX=1 S Y=1 D E0 Q
 S DIR(0)="LO^1:"_ACRMAX
 S DIR("A")="Which TRAINEE(S)"
 W !
 D DIR^ACRFDIC
E0 Q:$D(ACRQUIT)!$D(ACROUT)!(+$G(Y)<1)
 S ACRXX=Y
 N ACRJ,ACRYY
 F ACRJ=1:1 S ACRYY=$P(ACRXX,",",ACRJ) Q:'ACRYY  D
 .S ACRTPDA=ACR(ACRYY)
 .D E1
 Q
E1 S ACRTP0=$G(^ACRTPAR(+ACRTPDA,0))
 N X
 S X=+ACRTP0
 ;S X=$P($G(^VA(200,+X,0)),U)  ;ACR*2.1*19.02 IM16848
 S X=$$NAME2^ACRFUTL1(+X)  ;ACR*2.1*19.02 IM16848
 S X=$P($P(X,",",2)," ")_" "_$P(X,",")
 W !!,"Training Expenses for: ",X
 F ACRX=4,5 D
 .S DA=$P(ACRTP0,U,ACRX)
 .Q:'DA
 .S DIE="^ACRSS("
 .S DR="13"_$S(ACRX=4:"Tuition & Fees......",1:"Books & Other.......")
 .D DIE^ACRFDIC
 Q
DELETE ;DELETE PARTICIPANT FROM GROUP TRAINING LIST
 I ACRMAX=1 S ACRTPDA=ACR(1) D D1 Q
 S DIR(0)="LO^1:"_ACRMAX
 S DIR("A")="Which TRAINEE"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!($G(Y)<1) S ACRQUIT="" Q
 S ACRXX=Y
 N ACRJ,ACRYY
 F ACRJ=1:1 S ACRYY=$P(ACRXX,",",ACRJ) Q:'ACRYY  D
 .S ACRTPDA=ACR(ACRYY)
 .D D1
 Q
D1 S ACRTP0=$G(^ACRTPAR(+ACRTPDA,0))
 N X
 S X=+ACRTP0
 ;S X=$P($G(^VA(200,+X,0)),U)  ;ACR*2.1*19.02 IM16848
 S X=$$NAME2^ACRFUTL1(+X)  ;ACR*2.1*19.02 IM16848
 S ACRTP=$P($P(X,",",2)," ")_" "_$P(X,",")
 S DIR(0)="YO"
 S DIR("A")=ACRTP_" from this TRAINING REQUEST"
 S DIR("A",1)="Are you CERTAIN you want to DELETE"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!($G(Y)'=1) K ACRQUIT Q
 F ACRX=4,5 D
 .S DA=$P(ACRTP0,U,ACRX)
 .Q:'DA
 .S DIK="^ACRSS("
 .D DIK^ACRFDIC
 S DA=ACRTPDA
 S DIK="^ACRTPAR("
 D DIK^ACRFDIC
 Q
PRINT ;EP;TO PRINT LIST OF PARTICIPANTS IN GROUP TRAINING
 S ACRTPAR=""
 I '$G(ACRDOCDA) D
 .S ACRREFX=148
 .D EN1^ACRFTO
 Q:'$G(ACRDOCDA)
 S ACRRTN="LIST^ACRFTPAR"
 S ZTRTN=ACRRTN
 S ZTDESC="PRINT TRAINING PARTICIPANT LIST FOR "_$P(^ACRDOC(ACRDOCDA,0),U)
 S ZTDTH=""
 D ^ACRFZIS
 K ACRTPAR
 Q
 W @IOF
 W !?9,"Training Participants for Document: ",$P(^ACRDOC(ACRDOCDA,0),U)
 W !?9,"Date List Printed: "
 S Y=DT
 X ^DD("DD")
 W Y
 W ?55,"PAGE: "
 S ACRPAGE=$G(ACRPAGE)+1
 W ACRPAGE
 W !!,"CHARGED"
 W ?46,"Tuition"
 W ?60,"Books & Other"
 W !,"TO CAN"
 W ?9,"NO."
 W ?14,"ATTENDEE"
 W ?46,"& Fees"
 W ?60,"Expenses"
 W !,"-------"
 W ?9,"---"
 W ?14,"------------------------------"
 W ?46,"------------"
 W ?60,"------------"
 Q
YES ;EP;TO INDICATE IF TRAINING IS FOR GROUP TRAINING
 I $D(^ACRTPAR("C",ACRDOCDA)) D EN Q
 S DIR(0)="YO"
 S DIR("A",1)="Is Training request "_$P(^ACRDOC(ACRDOCDA,0),U)
 S DIR("A")="a request for GROUP TRAINING"
 S DIR("B")="NO"
 W @IOF
 W !
 D DIR^ACRFDIC
 Q:$G(Y)'=1
 D EN
 Q