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

ACRFVEN.m

Go to the documentation of this file.
ACRFVEN ;OIRM/IHS/DSD/AEF - EXTRINSIC FUNCTION TO RETURN VENDOR LAST EXPORT DATE [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;
EN(EIN) ;EP -- EXTRINSIC FUNCTION MAIN ENTRY POINT
 ;
 ;      EIN = VENDOR IEN
 ;
 I EIN="" Q EIN
 N BAT,FY,LAST,SEQ,VEN
 K ^TMP("ACRZ",$J)
 S VEN=EIN
 S FY=0 F  S FY=$O(^AFSLAFP("E",VEN,FY)) Q:'FY  D
 . S BAT=0 F  S BAT=$O(^AFSLAFP("E",VEN,FY,BAT)) Q:'BAT  D
 . . S SEQ=0 F  S SEQ=$O(^AFSLAFP("E",VEN,FY,BAT,SEQ)) Q:'SEQ  D ONE
 I '$D(^TMP("ACRF",$J,VEN)) Q ""
 S LAST=$O(^TMP("ACRF",$J,VEN,0))
 I LAST S LAST=$P(^TMP("ACRF",$J,VEN,LAST,0),U,2)
 K ^TMP("ACRZ",$J)
 Q LAST
 Q
ONE ;----- SETS DATA FOR ONE SEQUENCE NUMBER ENTRY
 ;
 N EXP
 S EXP=$P($G(^AFSLAFP(FY,1,BAT,2)),U)
 I EXP'="" D
 . S ^TMP("ACRF",$J,VEN,9999999-EXP,0)=VEN_U_EXP
 Q
ADD(D0) ;EP -- RETURNS ADDRESS VARIABLES IN ADD ARRAY
 ;
 ;      D0 = VENDOR FILE IEN
 ;
 N DATA,CNT,STATE
 K ADD
 S CNT=0
 S DATA=$G(^AUTTVNDR(D0,14))
 S STATE=$P(DATA,U,4)
 I STATE S STATE=$P($G(^DIC(5,STATE,0)),U,2)
 I $P(DATA,U)'="" S CNT=CNT+1 S ADD(CNT)=$P(DATA,U)
 I $P(DATA,U,2)'="" S CNT=CNT+1 S ADD(CNT)=$P(DATA,U,2)
 I ($P(DATA,U,3)="")&(STATE="")&($P(DATA,U,5)="") Q
 S CNT=CNT+1
 S ADD(CNT)=$P(DATA,U,3)_", "_STATE_"  "_$P(DATA,U,5)
 Q