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

ABPAPD7D.m

Go to the documentation of this file.
ABPAPD7D ;ALLOCATE UNAPPLIED DEDUCTIBLE REFUNDS;[ 07/25/91  11:53 AM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
 W !!,"<<< NOT AN ENTRY POINT - ACCESS DENIED >>>",!! Q
NONCOV ;ENTRY POINT
 ;PROCEDURE TO PROCESS UNASSIGNED NON-COVERED SERVICE TRANSACTIONS
 I +ABPA("UP","N")<0 S ABPA("N$")=ABPA("UP","N"),ABPATCNT=0 D
 .S ABPATBAL=ABPACTOB,ABPADOS=0 F  D  Q:+ABPADOS=0
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F  D  Q:+DA=0
 ...S DA=$O(ABPA("PP",ABPADOS,DA)) Q:+DA=0  S ABPATCNT=ABPATCNT+1
 ...S ABPADATA=ABPA("PP",ABPADOS,DA),ABPACURB=+ABPADATA
 ...I ABPATBAL>0 S ABPA("%")=ABPACURB/ABPATBAL
 ...E  S ABPA("%")=$P(^ABPVAO(ABPATDFN,1,DA,0),"^",7)/ABPACAMT
 ...S ABPA("$")=$J((ABPA("N$")*ABPA("%")),10,2)
 ...F  Q:$E(ABPA("$"),1)'=" "  S ABPA("$")=$E(ABPA("$"),2,99)
 ...I ABPATCNT=ABPACCNT S ABPA("$")=ABPA("UP","N")
 ...S $P(ABPADATA,"^",3)=$P(ABPADATA,"^",3)+ABPA("$")
 ...S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)+ABPA("$")
 ...S $P(ABPADATA,"^")=$P(ABPADATA,"^")-ABPA("$")
 ...S ABPA("UP","N")=ABPA("UP","N")-ABPA("$")
 ...S ABPACTOB=ABPACTOB-ABPA("$"),ABPA("PP",ABPADOS,DA)=ABPADATA
 ...I -ABPA("N$")>ABPA("NB") S ABPA("RBERR")=""
 Q
DEDUCT ;ENTRY POINT
 ;PROCEDURE TO PROCESS UNASSIGNED DEDUCTIBLE REFUND TRANSACTIONS
 I +ABPA("UP","D")<0 K ABPA("TPP") S ABPADOS=0 D
 .F  D  Q:+ABPADOS=0
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F  D  Q:+DA=0
 ...S DA=$O(ABPA("PP",ABPADOS,DA)) Q:+DA=0
 ...S ABPA("TPP",9999999-ABPADOS,999-DA)=""
 .I -ABPA("UP","D")>ABPA("DB") S ABPA("RBERR")=""
 .S ABPADOS=0,ABPATCNT=0 F  D  Q:+ABPA("UP","D")=0!(+ABPADOS=0)
 ..S ABPADOS=$O(ABPA("TPP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F  D  Q:+DA=0
 ...S DA=$O(ABPA("TPP",ABPADOS,DA)) Q:+DA=0
 ...S ABPADATA=ABPA("PP",9999999-ABPADOS,999-DA) S ABPATCNT=ABPATCNT+1
 ...S ABPACURB=+$P(ABPADATA,"^",4) I ABPACURB'>-ABPA("UP","D") D  Q
 ....S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)-ABPACURB
 ....S $P(ABPADATA,"^")=+ABPADATA+ABPACURB,ABPACTOB=ABPACTOB+ABPACURB
 ....S ABPA("UP","D")=ABPA("UP","D")+$P(ABPADATA,"^",4)
 ....S $P(ABPADATA,"^",4)=0 I ABPATCNT=ABPACCNT D
 .....S $P(ABPADATA,"^",4)=ABPA("UP","D")
 .....S $P(ABPADATA,"^")=+ABPADATA+ABPA("UP","D")
 .....S ABPACTOB=ABPACTOB+ABPA("UP","D")
 .....S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)-ABPA("UP","D")
 ....S ABPA("PP",9999999-ABPADOS,999-DA)=ABPADATA
 ...S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)+ABPA("UP","D")
 ...S $P(ABPADATA,"^")=$P(ABPADATA,"^")-ABPA("UP","D")
 ...S ABPACTOB=ABPACTOB-ABPA("UP","D")
 ...S $P(ABPADATA,"^",4)=$P(ABPADATA,"^",4)+ABPA("UP","D")
 ...S ABPA("UP","D")=0,ABPA("PP",9999999-ABPADOS,999-DA)=ABPADATA
 Q
 ;PROCEDURE TO PROCESS UNASSIGNED PAYMENT TRANSACTIONS
 I +ABPA("UP","S")<0 S ABPA("S$")=ABPA("UP","S"),ABPATCNT=0 D
 .S ABPATBAL=ABPACTOB,ABPADOS=0 F  D  Q:+ABPADOS=0
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F  D  Q:+DA=0
 ...S DA=$O(ABPA("PP",ABPADOS,DA)) Q:+DA=0  S ABPATCNT=ABPATCNT+1
 ...S ABPADATA=ABPA("PP",ABPADOS,DA),ABPACURB=+ABPADATA
 ...I ABPATBAL>0 S ABPA("%")=ABPACURB/ABPATBAL
 ...E  S ABPA("%")=$P(^ABPVAO(ABPATDFN,1,DA,0),"^",7)/ABPACAMT
 ...S ABPA("$")=$J((ABPA("S$")*ABPA("%")),10,2)
 ...F  Q:$E(ABPA("$"),1)'=" "  S ABPA("$")=$E(ABPA("$"),2,99)
 ...I ABPATCNT=ABPACCNT S ABPA("$")=ABPA("UP","S")
 ...S $P(ABPADATA,"^",5)=$P(ABPADATA,"^",5)+ABPA("$")
 ...S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)+ABPA("$")
 ...S $P(ABPADATA,"^")=$P(ABPADATA,"^")-ABPA("$")
 ...S ABPA("UP","S")=ABPA("UP","S")-ABPA("$")
 ...S ABPACTOB=ABPACTOB-ABPA("$"),ABPA("PP",ABPADOS,DA)=ABPADATA
 I -ABPA("S$")>ABPA("SB") S ABPA("RBERR")=""
 Q