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

RCJIBFN2.m

Go to the documentation of this file.
  1. RCJIBFN2 ;WASH-ISC@ALTOONA,PA/NYB-FUNC. CALLS FOR JOINT IB/AR ;10/12/95 8:34 AM ; 7/19/96 1:38 PM
  1. V ;;4.5;Accounts Receivable;**15,50,59,69,63**;Mar 20, 1995
  1. TRAN(RCTYNO) ;Pass IFN from 430.3 - returns the transaction type from file 430.3
  1. N TRAN
  1. I '$G(RCTYNO) S TRAN="" G TRANQ
  1. S TRAN=$P($G(^PRCA(430.3,RCTYNO,0)),"^")
  1. TRANQ Q TRAN
  1. ;
  1. STNO(RCTYNO) ;Pass IFN for 430.3 - returns pieces of the 0 node 430.3 where
  1. ;$P1=Name,$P2=Abbreviation,$P3=Status Number
  1. N SNDE,STNO,STRG
  1. I '$G(RCTYNO) S STRG="" G STNOQ
  1. S SNDE=$G(^PRCA(430.3,+RCTYNO,0)) I SNDE="" S STRG="" G STNOQ
  1. S STRG=$P($G(SNDE),"^")_"^"_$P($G(SNDE),"^",2)_"^"_$P($G(SNDE),"^",3)
  1. STNOQ Q STRG
  1. ;
  1. STAT(BN) ;Pass in IFN for 430 - returns the IFN for status file 430.3
  1. N STAT
  1. I '$G(BN) S STAT="" G STATQ
  1. S STAT=+$P($G(^PRCA(430,BN,0)),"^",8)
  1. STATQ Q STAT
  1. ;
  1. TRN(BN) ;Pass in IFN for 430 - returns ^TMP array with all transaction
  1. ;for a bill where I is the transaction number in 433 and
  1. ;$P1=Transaction Number,$P2=Transaction Date,$P3=Transaction Type
  1. ;$P4=Transaction Amount,$P5=Amount Due after transaction applied
  1. ;(Current Balance),$P6=Transaction Comment
  1. ;Caller must kill ^TMP array
  1. N BAL,CAT,I,N1,N8,TAMT,TTY
  1. I '$G(BN) G TRNQ
  1. K ^TMP("RCJIB",$J)
  1. S CAT=$$CAT^PRCAFN(BN)
  1. S BAL=+$P($$BILL(BN),"^")
  1. S I=0 F S I=$O(^PRCA(433,"C",BN,I)) Q:'I D
  1. .S N1=$G(^PRCA(433,I,1)),TTY=$P($G(N1),"^",2)
  1. .S TAMT=$P($G(N1),"^",5)
  1. .I ",2,8,9,10,11,14,19,47,34,35,29,"[(","_TTY_",") I TAMT'<0 S TAMT=-TAMT
  1. .I ",2,8,9,10,11,14,19,47,34,35,29,"'[(","_TTY_",") I TAMT<0 S TAMT=-TAMT
  1. .S N8=$G(^PRCA(433,I,8))
  1. .I +CAT=33,TTY=1 I TAMT<0 S TAMT=-TAMT
  1. .I +CAT=33,TTY=35 I TAMT>0 S TAMT=-TAMT
  1. .I TTY>2,(TTY<7)!(TTY=25) S TAMT=0
  1. .S BAL=BAL+TAMT
  1. .S ^TMP("RCJIB",$J,I)=$P($G(^PRCA(433,I,0)),"^")_"^"_$P($G(N1),"^")_"^"_$P($G(N1),"^",2)_"^"_$P($G(N1),"^",5)_"^"_BAL_"^"_$P($G(N8),"^",6)
  1. .Q
  1. TRNQ Q
  1. ;
  1. BILL(BN) ;Pass in IFN for 430 - Returns pieces of the 0 node of 430
  1. ;and pieces of calculated from file 433 where
  1. ;$P1=Orginal Amount,$P2=Current Status,$P3=Current Balance
  1. ;$P4=Total Collected,$P5=% Collected
  1. N BAL,BN0,CST,I,PAY,PER,STRG,TP
  1. I '$G(BN) S STRG="" G BILLQ
  1. S BN0=$G(^PRCA(430,BN,0)) I '$G(BN0) S STRG="" G BILLQ
  1. S CST=$P($G(BN0),"^",8)
  1. S BAL=$G(^PRCA(430,BN,7)),BAL=$P(BAL,"^")+$P(BAL,"^",2)+$P(BAL,"^",3)+$P(BAL,"^",4)+$P(BAL,"^",5)
  1. I CST=26 S BAL=0
  1. I '$G(BN) S STRG="" G TRNQ
  1. S (I,TP)=0 F S I=$O(^PRCA(433,"C",BN,I)) Q:'I D
  1. .S PAY=$P($G(^PRCA(433,I,1)),"^",2)
  1. .I $G(PAY)=2!($G(PAY)=34) S TP=TP+$P($G(^PRCA(433,I,1)),"^",5)
  1. .Q
  1. S PER="" I '$P($G(BN0),"^",3)=0 S PER=TP/($P($G(BN0),"^",3))*100
  1. S STRG=$P($G(BN0),"^",3)_"^"_CST_"^"_BAL_"^"_TP_"^"_PER
  1. BILLQ Q STRG
  1. ;
  1. BCOM(BN) ;Pass in IFN for 430 - Returns COM where $P1=Person who audited and
  1. ;$P2=Date audited and COM array where COM(I) is the audit comments
  1. ;Caller must kill COM ARRAY
  1. N FL,I
  1. I '$G(BN) S COM="" G BCOMQ
  1. S COM="",(FL,I)=0 F S I=$O(^PRCA(430,BN,10,I)) Q:I="" D
  1. .S FL=1,COM(I)=$P($G(^PRCA(430,BN,10,I,0)),"^")
  1. .Q
  1. I FL S COM=$P($G(^PRCA(430,BN,9)),"^")_"^"_$P($G(^PRCA(430,BN,9)),"^",3)
  1. BCOMQ Q
  1. ;
  1. DIQ(DA,DR,RCDIQ) ;Return File 430 data from Fileman
  1. ;DA - IEN, DR - File 430 fields, RCDIQ - Array name
  1. N D0,DIC,DIQ,DIQ2
  1. I ($G(^PRCA(430,DA,0))="")!(DR="")!(RCDIQ="") G DIQQ
  1. S DIQ(0)="IE",DIC="^PRCA(430,",DIQ=RCDIQ
  1. D EN^DIQ1
  1. DIQQ Q
  1. ;
  1. ;RCJIBFN2