ACRF16EN ;IHS/OIRM/DSD/AEF - PATCH 16 ENVIRONMENT CHECK ROUTINE [ 03/09/2005 3:52 PM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;**16**;NOV 05, 2001
;
EN ;EP -- MAIN ENTRY POINT
;
;CALL GENERIC EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT) ENVIRONMENT
;CHECK ROUTINE
;
; WHERE:
; ACRPCHN = PATCH NAME
; ACRPCHS = PREREQUISITE PATCH NUMBERS
; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE OUTPUT
; 1 = QUIT
;
K XPDQUIT
;
S ACRPCHN="ACR*2.1*16"
S ACRPCHS="1,2,3,4,5,6,7,8,12,13,14,15" ;CHANGE AS NEEDED
;
D EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT)
Q:+$G(XPDQUIT)=1
D CHKPAY
I +$G(XPDQUIT)=1 D BMES^XPDUTL("Installation of patch terminated.")
;
Q
;
CHKPAY ; Check payments made and batches cleared
I $D(^AFSHRCDS(6,"D")) D
. D BMES^XPDUTL("There are payments in a Finance Red Batch.")
. D MES^XPDUTL("Please notify the Finance Officer.")
. S XPDQUIT=1
D BATCHL
Q
;
BATCHL ;EP;LIST OPEN BATCHS DUE TODAY OR EARLIER
N J,X,Y,ACRFYDA,ACRBATDA
K ACR,ACRPAY
S ACRFYDA=0
F S ACRFYDA=$O(^AFSLAFP("K","O",ACRFYDA)) Q:'ACRFYDA D
.S ACRFY=$P(^AFSLAFP(ACRFYDA,0),U)
.S ACRBATDA=0
.F S ACRBATDA=$O(^AFSLAFP("K","O",ACRFYDA,ACRBATDA)) Q:'ACRBATDA D PAY
I $G(J)>0 D
. D BMES^XPDUTL("There are open batches in ARMS Payment Management.")
. D MES^XPDUTL("Please notify the Finance Officer.")
. S XPDQUIT=1
Q
;
PAY ;EP;SET LOCAL ACRPAY ARRAY
S X=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,0))
Q:$P(X,U)=""!'$P(X,U,2)!($P($P(X,U,2),".")>DT)
Q:('$D(ACREXP)&$P(X,U,5))!+$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2))
Q:$D(ACRCERT)&'$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,0))
S J=$G(J)+1
Q
ACRF16EN ;IHS/OIRM/DSD/AEF - PATCH 16 ENVIRONMENT CHECK ROUTINE [ 03/09/2005 3:52 PM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**16**;NOV 05, 2001
+2 ;
EN ;EP -- MAIN ENTRY POINT
+1 ;
+2 ;CALL GENERIC EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT) ENVIRONMENT
+3 ;CHECK ROUTINE
+4 ;
+5 ; WHERE:
+6 ; ACRPCHN = PATCH NAME
+7 ; ACRPCHS = PREREQUISITE PATCH NUMBERS
+8 ; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE OUTPUT
+9 ; 1 = QUIT
+10 ;
+11 KILL XPDQUIT
+12 ;
+13 SET ACRPCHN="ACR*2.1*16"
+14 ;CHANGE AS NEEDED
SET ACRPCHS="1,2,3,4,5,6,7,8,12,13,14,15"
+15 ;
+16 DO EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT)
+17 IF +$GET(XPDQUIT)=1
QUIT
+18 DO CHKPAY
+19 IF +$GET(XPDQUIT)=1
DO BMES^XPDUTL("Installation of patch terminated.")
+20 ;
+21 QUIT
+22 ;
CHKPAY ; Check payments made and batches cleared
+1 IF $DATA(^AFSHRCDS(6,"D"))
Begin DoDot:1
+2 DO BMES^XPDUTL("There are payments in a Finance Red Batch.")
+3 DO MES^XPDUTL("Please notify the Finance Officer.")
+4 SET XPDQUIT=1
End DoDot:1
+5 DO BATCHL
+6 QUIT
+7 ;
BATCHL ;EP;LIST OPEN BATCHS DUE TODAY OR EARLIER
+1 NEW J,X,Y,ACRFYDA,ACRBATDA
+2 KILL ACR,ACRPAY
+3 SET ACRFYDA=0
+4 FOR
SET ACRFYDA=$ORDER(^AFSLAFP("K","O",ACRFYDA))
IF 'ACRFYDA
QUIT
Begin DoDot:1
+5 SET ACRFY=$PIECE(^AFSLAFP(ACRFYDA,0),U)
+6 SET ACRBATDA=0
+7 FOR
SET ACRBATDA=$ORDER(^AFSLAFP("K","O",ACRFYDA,ACRBATDA))
IF 'ACRBATDA
QUIT
DO PAY
End DoDot:1
+8 IF $GET(J)>0
Begin DoDot:1
+9 DO BMES^XPDUTL("There are open batches in ARMS Payment Management.")
+10 DO MES^XPDUTL("Please notify the Finance Officer.")
+11 SET XPDQUIT=1
End DoDot:1
+12 QUIT
+13 ;
PAY ;EP;SET LOCAL ACRPAY ARRAY
+1 SET X=$GET(^AFSLAFP(ACRFYDA,1,ACRBATDA,0))
+2 IF $PIECE(X,U)=""!'$PIECE(X,U,2)!($PIECE($PIECE(X,U,2),".")>DT)
QUIT
+3 IF ('$DATA(ACREXP)&$PIECE(X,U,5))!+$GET(^AFSLAFP(ACRFYDA,1,ACRBATDA,2))
QUIT
+4 IF $DATA(ACRCERT)&'$ORDER(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,0))
QUIT
+5 SET J=$GET(J)+1
+6 QUIT