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

PRCAFN1.m

Go to the documentation of this file.
  1. PRCAFN1 ;WASH-ISC@ALTOONA,PA/LDB-Functions to return AR data ;8/12/93 10:36 AM
  1. V ;;4.5;Accounts Receivable;**48**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;;
  1. EN(TRAN) ;Input is transaction number
  1. ;Variable returned = internal number of debtor^internal bill number
  1. N X,Y
  1. S Y=$P($G(^PRCA(433,+TRAN,0)),"^",2) G NULL:'Y
  1. S X=$P($G(^PRCA(430,+Y,0)),"^",9) G NULL:'X
  1. S $P(X,"^",2)=Y
  1. Q X
  1. ;
  1. NULL ;Either no bill or debtor
  1. S X=""
  1. Q X
  1. ;
  1. ;
  1. CAT(Y) ;Input: Internal Bill #
  1. ;Return: Category #^Category name^Category Type or -1
  1. ;
  1. I Y>0 S Y=$S('$D(Y)#2:-1,Y="":-1,1:$G(^PRCA(430.2,+$P($G(^PRCA(430,Y,0)),"^",2),0))) S:Y="" Y=-1 S:Y'=-1 Y=$P(Y,"^",7)_"^"_$P(Y,"^")_"^"_$P(Y,"^",6)
  1. Q Y
  1. ;
  1. ;Return: Amount of payments on receivable
  1. N AMT,X
  1. S AMT=0
  1. I 'Y!(Y<0)!('$D(^PRCA(430,Y,0))) S Y="ERROR" G PAIDQ
  1. S X="" F S X=$O(^PRCA(433,"C",+Y,X)) Q:'X D
  1. .S X(1)=$G(^PRCA(433,+X,1))
  1. .S X(2)=$P(X(1),"^",2)
  1. .I "^2^34^"[("^"_X(2)_"^") S AMT=AMT+$P(X(1),"^",5)
  1. S Y=AMT
  1. PAIDQ Q Y