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

ABMDUB.m

Go to the documentation of this file.
ABMDUB ; IHS/ASDST/DMJ - COMPUTE UNCOLLECTED BALANCE ;
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
START ;START HERE
 S DA(1)=0 F  S DA(1)=$O(^ABMDBILL(DUZ(2),DA(1))) Q:'DA(1)  D RC
 K ABM,ABMTOT Q
RC ;RECALCULATE UNOBLIGATED BALANCE FIELD FOR ONE BILL
 S ABM("BILLED")=+$P($G(^ABMDBILL(DUZ(2),DA(1),2)),U)
 F I=2,3,4,6 S ABMTOT(I)=0
 S DA=0 F  S DA=$O(^ABMDBILL(DUZ(2),DA(1),3,DA)) Q:'DA  D
 .F I=2,3,4,6 S ABM(I)=$P(^ABMDBILL(DUZ(2),DA(1),3,DA,0),"^",I),ABMTOT(I)=ABMTOT(I)+ABM(I)
 S ABM("UB")=ABM("BILLED")-ABMTOT(2)-ABMTOT(3)-ABMTOT(4)-ABMTOT(6)
 S ABM("UB")=$J(ABM("UB"),1,2)
 S DIE="^ABMDBILL(DUZ(2),",DA=DA(1),DR=".25////"_ABM("UB") D ^DIE
 Q