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

ABPABRC0.m

Go to the documentation of this file.
ABPABRC0 ;AUTO PAYMENT BATCH RE-CALCULATION;[ 07/14/91  9:11 AM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
 ;PROCEDURE TO CALCULATE CURRENT PAYMENT CATEGORY AMOUNTS
 W !! D WAIT^DICD W !!,"Re-calculating the BATCH SUMMARIES"
 S (S,D,N,P,R,DA(2))=0,ABPABDT=+ABPABDFN F I=0:0 D  Q:+DA(2)=0
 .S DA(2)=$O(^ABPVAO("BD",ABPABDT,DA(2))) Q:+DA(2)=0
 .S DA(1)=0 F I=0:0 D  Q:+DA(1)=0
 ..S DA(1)=$O(^ABPVAO("BD",ABPABDT,DA(2),DA(1))) Q:+DA(1)=0
 ..Q:$D(^ABPVAO(DA(2),"P",DA(1),0))'=1
 ..S ABPACHK("NUM")=$P(^(0),"^",6)
 ..S DA=0 F I=0:0 D  Q:+DA=0
 ...S DA=$O(^ABPVAO(DA(2),"P",DA(1),"A",DA)) Q:+DA=0
 ...Q:$D(^ABPVAO(DA(2),"P",DA(1),"A",DA,0))'=1
 ...I +$P(^(0),"^")<0 I ABPACHK("NUM")']"" D  Q
 ....S R=R+(+^ABPVAO(DA(2),"P",DA(1),"A",DA,0)*-1)
 ...S ABPATYP=$P(^(0),"^",2) Q:ABPATYP']""  Q:"SNDP"'[ABPATYP
 ...Q:ABPATYP="S"&(+^(0)>0)&(ABPACHK("NUM")']"")
 ...S @ABPATYP=@ABPATYP+(+^(0)) W "."
 S $P(^ABPAPBAT(ABPABDFN,0),"^",2)=+S
 S $P(^ABPAPBAT(ABPABDFN,0),"^",4)=+N
 S $P(^ABPAPBAT(ABPABDFN,0),"^",3)=+D
 S $P(^ABPAPBAT(ABPABDFN,0),"^",11)=+P
 S $P(^ABPAPBAT(ABPABDFN,0),"^",14)=+R
 K DIC,X,Y,S,D,N,DA,I,P,R,ABPABDT,ABPATYP,ABPACHK("NUM")
 Q
CLOSE ;ENTRY POINT
 ;PROCEDURE TO CHECK BALANCE OF THE PAYMENT BATCH
 K P F ABPAJ=2,10,12,13 S P(ABPAJ)=$P(^ABPAPBAT(ABPABDFN,0),"^",ABPAJ)
 I ((P(10)+P(13))-(P(12)+P(2)))=0 D
 .W !,"The current balance of this batch is $ 0.00"
 .K DIR S DIR(0)="Y",DIR("A")="DO YOU WANT TO CLOSE THIS BATCH"
 .S DIR("B")="YES" W *7 D ^DIR I Y D  W " ... Batch Closed!" Q
 ..S $P(^ABPAPBAT(ABPABDFN,0),"^",5)="C"
 ..S $P(^ABPAPBAT(ABPABDFN,0),"^",8)=DT
 ..S ^ABPAPBAT("AC",DT,ABPABDFN)=""
 ..S $P(^ABPAPBAT(ABPABDFN,0),"^",9)=DUZ
 .W " ... Not Closed!"