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

ABPAPD7B.m

Go to the documentation of this file.
ABPAPD7B ;ALLOCATE UNAPPLIED PAYMENTS;[ 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
BEGIN ;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 ABPAI=0:0 D  Q:+ABPADOS=0
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F ABPAJ=0:0 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 ABPAK=0:0 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
 .Q
 ;PROCEDURE TO PROCESS UNASSIGNED DEDUCTIBLE TRANSACTIONS
 I +ABPA("UP","D")>0 S ABPADOS=0 D
 .F ABPAI=0:0 D  Q:+ABPA("UP","D")=0!(+ABPADOS=0)
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F ABPAJ=0:0 D  Q:+DA=0
 ...S DA=$O(ABPA("PP",ABPADOS,DA)) Q:+DA=0
 ...S ABPADATA=ABPA("PP",ABPADOS,DA),ABPACURB=+ABPADATA
 ...I ABPACURB'<ABPA("UP","D") D  Q
 ....S $P(ABPADATA,"^",4)=$P(ABPADATA,"^",4)+ABPA("UP","D")
 ....S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)+ABPA("UP","D")
 ....S $P(ABPADATA,"^")=$P(ABPADATA,"^")-ABPA("UP","D")
 ....S ABPACTOB=ABPACTOB-ABPA("UP","D"),ABPA("UP","D")=0
 ....S ABPA("PP",ABPADOS,DA)=ABPADATA
 ...S $P(ABPADATA,"^",4)=$P(ABPADATA,"^",4)+ABPACURB
 ...S $P(ABPADATA,"^",6)=$P(ABPADATA,"^",6)+ABPACURB
 ...S $P(ABPADATA,"^")=0,ABPA("UP","D")=ABPA("UP","D")-ABPACURB
 ...S ABPACTOB=ABPACTOB-ABPACURB,ABPA("PP",ABPADOS,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 ABPAI=0:0 D  Q:+ABPADOS=0
 ..S ABPADOS=$O(ABPA("PP",ABPADOS)) Q:+ABPADOS=0
 ..S DA=0 F ABPAJ=0:0 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 ABPAK=0:0 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
 Q