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

ABPAGPB.m

Go to the documentation of this file.
ABPAGPB ;PVT-INS PAYMENT ENTRY (START); [ 03/10/91  4:22 PM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
BATDT K DIC,ABPABDT S DIC("A")="Select PAYMENT BATCH DATE: "
 S DIC="^ABPAPBAT(",DIC(0)="AEQZ" W !! D ^DIC
 I +Y<0 Q
 I +$P(Y,U,3)>0 D
 .S ^ABPAPBAT(+Y,0)=^ABPAPBAT(+Y,0)_"^0^0^0^O^"_DUZ_"^"_DT
 .K DIK,DA S DIK="^ABPAPBAT(",DA=+Y D IX^DIK
 I ABPAOPT(7)="Y" G OWN
MULTI S LBATDT=9999999-(+Y),LBATDT=$O(^ABPAPBAT("AD",DUZ,LBATDT))
 K ERRFLG I +LBATDT>0 D
 .S ABPABDFN=9999999-LBATDT
 .I $D(^ABPAPBAT(ABPABDFN,0))=0 S ERRFLG=1 Q
 .I $P(^ABPAPBAT(ABPABDFN,0),"^",5)'="C" S ERRFLG=2 Q
 I $D(ERRFLG)=1 D  Q
 .I +ERRFLG=1 D
 ..W *7,!!?5,"<<< GLOBAL ERROR DETECTED - PLEASE CONTACT YOUR "
 ..W "SYSTEM MANAGER >>>" H 3
 .I +ERRFLG=2 D
 ..W *7,!!?13,"<<< BATCH DATE *** ",+$E(ABPABDFN,4,5)_"/"
 ..W +$E(ABPABDFN,6,7)_"/"_+$E(ABPABDFN,2,3)," *** IS NOT CLOSED >>>"
 ..H 2 W !!?25,"NEW BATCH NOT ALLOWED" H 2
 .I +$P(Y,"^",3)>0 I +$P(^ABPAPBAT(+Y,0),"^",6)=+DUZ D
 ..K DIK,DA S DIK="^ABPAPBAT(",DA=+Y D ^DIK
OWN I ABPAOPT(8)="Y" G OPEN
 I $P(^ABPAPBAT(+Y,0),"^",6)'=DUZ D  G BATDT
 .W *7,!!?15,"<<< BATCH DOESN'T BELONG TO YOU -- CANNOT ACCESS >>>"
OPEN I $P(^ABPAPBAT(+Y,0),"^",5)="C" D  G BATDT
 .W *7,!!?15,"<<< BATCH CLOSED - NO CHANGES ALLOWED >>>"
LOCK L ^ABPAPBAT(+Y,0):3 I '$T D  G BATDT
 .W *7,!!?15,"<<< BATCH ALREADY IN USE - CANNOT ACCESS >>>"
SET S ABPABDT=+$E(+Y,4,5)_"/"_+$E(+Y,6,7)_"/"_+$E(+Y,2,3)
 S ABPABDFN=+Y
 Q