ABPACMRP ;CLOSE THE MONTHLY REPORTING PERIOD; [ 07/04/91 7:43 AM ]
;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
K ABPA("HD") S ABPA("HD",1)=ABPATLE
S ABPA("HD",2)="Close the Monthly Reporting Period" D ^ABPAHD
S Y=$E(DT,1,3),X=$E(DT,4,5) I +X'=1 S X=X-1 S:X<10 X=0_X S Y=Y_X_"00"
E S Y=(Y-1)_1200
S ABPA("DT")=Y X ^DD("DD")
I $D(^ABPAFAC(DUZ(2),1,ABPA("DT"),0))=1 D Q
.K ABPAMESS
.S ABPAMESS="The '"_Y_"' reporting period has already been closed."
.S ABPAMESS(2)="... Press any key to continue ..." D PAUSE^ABPAMAIN
K DIR S DIR(0)="YA",DIR("A",1)="CLOSE THE '"_Y_"' REPORTING PERIOD!"
S DIR("A")=" ARE YOU SURE? " W !!!,*7 D ^DIR
I Y D
.I $D(^ABPAFAC(DUZ(2),1,0))=0 D
..S ^ABPAFAC(DUZ(2),1,0)="^9002270.08D^^0"
.K DIC S DIC="^ABPAFAC("_DUZ(2)_",1,",DA(1)=DUZ(2),DIC(0)="L"
.S X=ABPA("DT") W ! D ^DIC W !!,"All done!"
.K ABPAMESS D PAUSE^ABPAMAIN
K X,Y,ABPA("DT"),DIC,DA
Q
;
CHECK ;ENTRY POINT - CHECK FOR CLOSED REPORTING PERIOD
K CLOSED S CLOSED=1
S Y=$E(DT,1,3),X=$E(DT,4,5) I +X'=1 S Y=Y_0_(X-1)_"00"
E S Y=(Y-1)_1200
S ABPA("DT")=Y X ^DD("DD")
I $D(^ABPAFAC(DUZ(2),1,ABPA("DT"),0))=1 Q
E D S CLOSED=0
.K ABPAMESS S ABPAMESS="POSTING DENIED - The '" W *7
.S ABPAMESS=ABPAMESS_Y_"' reporting period has not been closed."
.S ABPAMESS(2)="... Press any key to continue ..." D PAUSE^ABPAMAIN
ABPACMRP ;CLOSE THE MONTHLY REPORTING PERIOD; [ 07/04/91 7:43 AM ]
+1 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
+2 KILL ABPA("HD")
SET ABPA("HD",1)=ABPATLE
+3 SET ABPA("HD",2)="Close the Monthly Reporting Period"
DO ^ABPAHD
+4 SET Y=$EXTRACT(DT,1,3)
SET X=$EXTRACT(DT,4,5)
IF +X'=1
SET X=X-1
IF X<10
SET X=0_X
SET Y=Y_X_"00"
+5 IF '$TEST
SET Y=(Y-1)_1200
+6 SET ABPA("DT")=Y
XECUTE ^DD("DD")
+7 IF $DATA(^ABPAFAC(DUZ(2),1,ABPA("DT"),0))=1
Begin DoDot:1
+8 KILL ABPAMESS
+9 SET ABPAMESS="The '"_Y_"' reporting period has already been closed."
+10 SET ABPAMESS(2)="... Press any key to continue ..."
DO PAUSE^ABPAMAIN
End DoDot:1
QUIT
+11 KILL DIR
SET DIR(0)="YA"
SET DIR("A",1)="CLOSE THE '"_Y_"' REPORTING PERIOD!"
+12 SET DIR("A")=" ARE YOU SURE? "
WRITE !!!,*7
DO ^DIR
+13 IF Y
Begin DoDot:1
+14 IF $DATA(^ABPAFAC(DUZ(2),1,0))=0
Begin DoDot:2
+15 SET ^ABPAFAC(DUZ(2),1,0)="^9002270.08D^^0"
End DoDot:2
+16 KILL DIC
SET DIC="^ABPAFAC("_DUZ(2)_",1,"
SET DA(1)=DUZ(2)
SET DIC(0)="L"
+17 SET X=ABPA("DT")
WRITE !
DO ^DIC
WRITE !!,"All done!"
+18 KILL ABPAMESS
DO PAUSE^ABPAMAIN
End DoDot:1
+19 KILL X,Y,ABPA("DT"),DIC,DA
+20 QUIT
+21 ;
CHECK ;ENTRY POINT - CHECK FOR CLOSED REPORTING PERIOD
+1 KILL CLOSED
SET CLOSED=1
+2 SET Y=$EXTRACT(DT,1,3)
SET X=$EXTRACT(DT,4,5)
IF +X'=1
SET Y=Y_0_(X-1)_"00"
+3 IF '$TEST
SET Y=(Y-1)_1200
+4 SET ABPA("DT")=Y
XECUTE ^DD("DD")
+5 IF $DATA(^ABPAFAC(DUZ(2),1,ABPA("DT"),0))=1
QUIT
+6 IF '$TEST
Begin DoDot:1
+7 KILL ABPAMESS
SET ABPAMESS="POSTING DENIED - The '"
WRITE *7
+8 SET ABPAMESS=ABPAMESS_Y_"' reporting period has not been closed."
+9 SET ABPAMESS(2)="... Press any key to continue ..."
DO PAUSE^ABPAMAIN
End DoDot:1
SET CLOSED=0