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

ACRFVLK2.m

Go to the documentation of this file.
ACRFVLK2 ;IHS/OIRM/DSD/EFG - VENDOR FILE LOOKUP 2 ; [ 05/02/2007  10:56 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**20,21,22**;NOV 5, 2001
 ;
 ;    New routine ACR*2.1*20.14
 ;    Heavily rewritten for UFMS CORE Open Document vendor checks ACR*2.1*22.14 IM24159
 ;    Also to remedy error ACR*2.1*22.11c IM24263
 Q
PRINTMN ;EP - PRINT VENDORS MISSING REQ DATA BY NAME
 ;
 S STR="1100"                       ;ACTIVE,ERR MSG,NO DUNS,ETC
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(1100)"
 S ZTDESC="ACTIVE VENDORS WITH MISSING/BAD REQUIRED DATA BY NAME"
 D HFS("V^ACRFVLK3(1100)",STR)
 Q
 ;
PRINTIV ;EP - PRINT INACTIVE VENDORS BY NAME
 ;
 S STR="0000"                       ;INACTIVE,NO ERR MSG,NO DUNS,ETC)
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(""0000"")"
 S ZTDESC="PRINT INACTIVE VENDORS"
 D HFS("V^ACRFVLK3(""0000"")",STR)
 Q
 ;
PRINTMD ;EP - PRINT VENDORS MISSING OR BAD DUNS
 ;
 S STR="10D0"                       ;ACTIVE,NO ERR MSG, MISSING DUNS
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(""10D0"")"
 S ZTDESC="VENDORS MISSING DUNS BY NAME"
 D HFS("V^ACRFVLK3(""10D0"")",STR)
 Q
PRINTME ;EP - PRINT VENDORS MISSING OR BAD EIN
 ;
 S STR="10E0"                       ;ACTIVE,NO ERR MSG, MISSING EIN
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(""10E0"")"
 S ZTDESC="VENDORS MISSING EIN BY NAME"
 D HFS("V^ACRFVLK3(""10E0"")")
 Q
PRINTMZ ;EP - PRINT VENDORS WHOSE ZIP IS < 9
 ;
 S STR="10Z0"                      ;ACTIVE,NO ERR MSG, MISSING ZIP
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(""10Z0"")"
 S ZTDESC="VENDORS MISSING ZIP+4 BY NAME"
 D HFS("V^ACRFVLK3(""10Z0"")",STR)
 Q
 ;
PRINTAD ;EP - PRINT ACTIVE VENDORS WITH DUNS
 ;
 S STR="10D1"                      ;ACTIVE,NO ERR MSG, HAS DUNS
 S (ZTRTN,ACRRTN)="ADEZ^ACRFVLK3(""10D1"")"
 S ZTDESC="ACTIVE VENDORS WITH DUNS"
 D HFS("ADEZ^ACRFVLK3(""10D1"")",STR)
 Q
PRINTAE ;EP - PRINT ACTIVE VENDORS WITH EIN
 S STR="10E1"                      ;ACTIVE,NO ERR MSG, HAS EIN
 S (ZTRTN,ACRRTN)="ADEZ^ACRFVLK3(""10E1"")"
 S ZTDESC="ACTIVE VENDORS WITH EIN"
 D HFS("ADEZ^ACRFVLK3(""10E1"")",STR)
 Q
PRINTAV ;EP - PRINT ACTIVE VENDORS
 ;
 S STR="1000"                       ;ACTIVE,NO ERR MSG,NO DUNS ETC
 S ZTSAVE("STR")=""
 S (ZTRTN,ACRRTN)="V^ACRFVLK3(1000)"
 S ZTDESC="PRINT ACTIVE VENDORS"
 D HFS("V^ACRFVLK3(1000)",STR)
 Q
 ;
HFS(SUB,STR) ;LOCAL UTILITY TO OPEN DEVICE OR FILE
 K ACRHFS,ACRDIR,ACRFILE               ;ACR*2.1*21.04 IM22466
 S ACR("HFS")=""                       ;ACR*2.1*21.04 IM22466
 S ZTSAVE("STR")=""
 D ^ACRFZIS
 K ACR("HFS")
 I $D(ACRHFS) D
 .S ACRDIR=ZISH1
 .S ACRFILE=ZISH2
 .D @SUB
 .D PROCHFS
 Q
 ;
 I $D(ACRHFS)&($D(%FILE)) D  I 1
 .U %FILE
 .D CSV(HD1)
 .D:HD2]"" CSV(HD2)
 .W !
 E  D
 .W !!?80-$L(HD1)/2,HD1
 .I HD2]"" W !?80-$L(HD2)/2,HD2,!
 Q
 ;
WRT(NUM) ;EP - WRITE ALL DATA
 N ACR,ACRP,I,ACRTMP
 S ACRP=""
 F  S ACRP=$O(^TMP("ACR",$J,ACRP)) Q:ACRP=""!($D(ACROUT))  D
 .S ACR=$G(^TMP("ACR",$J,ACRP))
 .I $D(ACRHFS)&($D(%FILE)) D  Q              ;ACR*2.1*21.04 IM22466
 ..U %FILE
 ..D CSV(ACR)
 .I NUM=1 D
 ..W !,ACRP,?34,$P(ACR,U,2),?50,$P(ACR,U,3),?65,$P(ACR,U,4)  ;ACR*2.1*21.04 IM22466
 .I NUM=2 D
 ..W !,ACRP,?15,$P(ACR,U,2),?50,$P(ACR,U,3),?65,$P(ACR,U,4)
 .I $P(ACR,U,5)'="--" W !?10,$P(ACR,U,5)     ;NO EFT, DON'T WRITE LINE
 .I $L(ACR,U)>5 W ! F I=6:1:$L(ACR,U) D      ;WRITE ERRORS
 ..S ACRTMP=$P(ACR,U,I)
 ..W:ACRTMP]"" ACRTMP
 ..W:I'=$L(ACR,U) ",  "
 .I '$D(ACRHFS),$Y>(IOSL-4) D PAUSE^ACRFWARN W @IOF Q  ;ACR*2.1*21.04 IM22466
 I '$D(ACRHFS) D PAUSE^ACRFWARN W @IOF                 ;ACR*2.1*21.04 IM22466
 K ^TMP("ACR",$J)                                      ;ACR*2.1*21.04 IM22466
 Q
 ;*************************************************
CSV(REC) ;MAKE FLAT FILE COMMA SEPARATED VALUE STRING
 W !
 F I=1:1:$L(REC,U) D
 .S TMP=$P(REC,U,I)
 .W $C(34)                             ;WRITE " DOUBLE QUOTE
 .I $E(TMP)="0",$L(TMP)'=1 W $C(39)    ;WRITE ' SINGLE QUOTE IN FRONT OF ZERO
 .W TMP_$C(34)_$C(44)                  ;WRITE " DOUBLE QUOTE AND COMMA
 Q
 ;
PROCHFS ;EP - PROCESS HFS FILE  ACR*2.1*21.04 IM22466
 D CLOSE^ACRFZISH("")
 D HOME^%ZIS W !!,"File "_ACRFILE_" has been put into "_ACRDIR
 D PAUSE^ACRFWARN W @IOF
 Q
SUBHEAD(STR,NUM) ;EP - HEADING1  ACR*2.1*21.04 IM22466
 I $D(ACRHFS)&($D(%FILE)) D  Q
 .U %FILE
 .D CSV(STR)
 I NUM=1 D                          ;SORTED BY NAME
 .W !,$P(STR,U),?34,$P(STR,U,2),?50,$P(STR,U,3),?65,$P(STR,U,4)
 I NUM=2 D                          ;SORTED BY DUNS,EIN OR ZIP
 .W !,$P(STR,U),?15,$P(STR,U,2),?50,$P(STR,U,3),?65,$P(STR,U,4)
 W !?10,$P(STR,U,5)
 W ! F I=6:1:$L(STR,U) W ",  ",$P(STR,U,I)
 W !,"-------------------------------------------------------------------------------"
 Q