ACRFUFMR ;IHS/OIRM/DSD/AEF - UTILITY STANDALONE TO READ OPEN DOCUMENTS FROM CORE FOR UFMS [ 05/16/2007 9:44 AM ]
;;2.1;ADMIN RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
;NEW ROUTINE ACR*2.1*22 UFMS
;
;*************************************************************
READ ;EP;READ CONTENTS OF UNIX CORE FILES INTO ^ACRZ GLOBALS
;
; ACRFN = ARMS/CORE FILENAME -- Docs##.txt ; ## = Accounting point
;
N ACRDIR,X,%DEV,ACRSTR,ACRI,ACRFN,ACRFAP
N P1,P2,P3,P4,P5,P6,P7,P8,P9,ACRQUIT
S ACRFAP=$P(^AUTTACPT($P(^ACRSYS(1,"DT1"),U,13),0),U)
I ACRFAP=65 S ACRFAP="65-94" ;MODIFY FOR HQ/NP
S ACRFN="Docs"_ACRFAP_".txt"
S ACRDIR=$$ARMSDIR^ACRFSYS(1)
I ACRDIR["/usr/ACR/" S ACRDIR="/usr/ACR/"
D HFS^ACRFZISH(ACRDIR,ACRFN,"R",.%DEV)
Q:$G(%DEV)']""
K ^ACRZ("ACRCORE")
U %DEV
S (ACRI,ACRQUIT)=0
F R X:DTIME D I ACRQUIT>4 Q ;DIRECT READ OF UNIX FLAT FILE
. S ACRSTR=$$STR(X)
. Q:ACRSTR=0
. S ACRI=ACRI+1
. S ^ACRZ("ACRCORE",ACRI)=ACRSTR
;
D CLOSE^%ZISH("FILE")
S ^ACRZ("ACRCORE")=$$NOW^ACRFUTL ;DATE AND TIME STAMP
S ^ACRZ("ACRCORE","TOTAL")=ACRI ;NUMBER OF RECORDS
;
D EN^ACRFUFMZ
Q
;
;*************************************************************
STR(X) ; PARSING STRING
;40,AP,6007002300 ,2005,J40DU05,252Z,13292,100,1860777569A1
I X="" D Q 0 ;SET QUIT CONDITION IF NULL
.S ACRQUIT=ACRQUIT+1 ;IF IT FINDS FIVE NULL LINES, MUST BE EOF
S P7=$P(X,",",7) ;DOL AMT
I P7=0!(P7="") Q 0 ;SKIP ZERO DOLLAR AMOUNTS
S P1=$P(X,",",1) ;AP
S P2=$P(X,",",2) ;DOC-TYPE
S P3=$E($P(X,",",3),1,10) ;DOCUMENT
S P4=$P(X,",",4) ;FY
S P5=$P(X,",",5) ;CAN
S P6=$P(X,",",6) ;OCC
S P8=$P(X,",",8) ;REF CODE
S P9=$P(X,",",9) ;VENDOR EIN
S STR=P1_U_P2_U_P3_U_P4_U_P5_U_P6_U_P7_U_P8_U_P9
Q STR
;*************************************************************
; BEGIN REPORT FILE CREATION
;*************************************************************
ENW ;EP; ENTRY POINT FOR RECORDS GENERATED BY ^ACRFUFMZ
;
N ACRNODE,ACRTOT,ACRTOTAL,ACRSITE,ACRCNT,ACRRPTOT,I,ACRCORE,ACRMTCH,TRCNT
S ACRSITEN=$P($G(^AUTTAREA(+$G(^ACRSYS(1,0)),0)),U) ;SITE NAME
K ACRARY
;CREATE FILE NAME
S ACRSITE=$E(ACRSITEN,1,3)
S:ACRSITE="NAT" ACRSITE="HQ"
S ACRTAIL=".csv" ; USE COMMA SEPARTED VALUE FORMAT
S ACRPFX=ACRSITE_"_CORE_OPEN_"
S (ACRTOT,ACRRPTOT,TRCNT)=0
;
;LOOP THROUGH NODES TO CREATE REPORT FILES
F ACRNODE="ITEMS","ACRDOC","VNDR","NOHIT","NOMATCH","NOVNDR","ERR","TR","PAY","GTRIP","CHS","GR","CEIN" D
.S ACRFILE=ACRPFX_ACRNODE_ACRTAIL
.D WRITE(ACRNODE,ACRFILE)
;
S ACRCORE=$G(^ACRZ("ACRCORE","TOTAL")) ;NUMBER OF RECORDS IN CORE FILE
S ACRMTCH=0
F I="ACRDOC","NOVNDR","TR" D ;TOTAL ALL ARMS MATCHES
.S ACRMTCH=ACRMTCH+$G(^ACRZ(I,"TOTAL"))
S ACRMTCH=ACRMTCH-TRCNT ;SUBTRACT NUMBER OF NO HIT/MATCH TRAVEL
S ACRSTR=ACRSITEN_U_ACRCORE_U_ACRMTCH
;
F I="TOTALS","ACRDOC","NOVNDR","VNDR","ERR","NOHIT","NOMATCH","TR","PAY","GTRIP","CHS","GR" D
.S ACRSTR=ACRSTR_U_$G(^ACRZ(I,"TOTAL")) ;CREATE 'TOTALS' SUMMARY STRING
.Q:I="ERR"
.Q:I="VNDR"
.S:I'="TOTALS" ACRRPTOT=ACRRPTOT+^ACRZ(I,"TOTAL") ;TOTAL NUMBER IN REPORTS
;
S ACRSTR=ACRSTR_U_ACRRPTOT
S ^ACRZ("TOTALS")=ACRSTR
S ACRFILE=ACRPFX_"TOTALS"_ACRTAIL
D WRITE("TOTALS",ACRFILE)
I IOST'["C-" Q ;TASKED JOB
U 0
S RAY=0
F S RAY=$O(ACRARY(RAY)) Q:RAY="" D
.W !,ACRARY(RAY)
W !!,"CORE OPEN DOCUMENT FILE IMPORTED ",$G(^ACRZ("ACRCORE"))
W !,"TOTAL RECORDS FROM CORE FILE = ",ACRCORE
W !,"TOTAL RECORDS IN REPORT FILES = ",ACRRPTOT
W !?10,"TOTAL MATCHED DOCUMENTS = ",ACRMTCH
W !?10,"TOTAL VENDORS IN MATCHED FILES = ",^ACRZ("VNDR","TOTAL")
W !?10,"TOTAL MATCHED DOCUMENTS WITH VENDOR ERRORS = ",^ACRZ("ERR","TOTAL")
D PAUSE^ACRFWARN
Q
;
;*************************************************************
WRITE(ACRNODE,ACRFILE) ;----- WRITE ^ACRZ(ACRNODE GLOBAL TO UNIX FILE
;
N %DEV,ACR,ACRDIR,I,ACRI,ACRD,ACRN,ACRSTR,ACRFY
K ACRARY(ACRNODE)
S ACRSTR=""
S ACRDIR=$$ARMSDIR^ACRFSYS(1)
D HFS^ACRFZISH(ACRDIR,.ACRFILE,"W",.%DEV)
Q:'$D(%DEV)
U %DEV
D @(ACRNODE_"H") ;WRITE HEADING
I ACRNODE="TOTALS" D Q ;SINGLE STRING ONLY
.S ACRSTR=^ACRZ(ACRNODE)
.D CNT
.S ACRARY(ACRNODE)=ACRCNT_" records have been put into file "_ACRDIR_ACRFILE
.D CLOSE^%ZISH("FILE")
S ACRCNT=0
S ACRD=""
F S ACRD=$O(^ACRZ(ACRNODE,ACRD)) Q:ACRD="" D
.Q:ACRD="TOTAL"
.S ACRSTR=$G(^ACRZ(ACRNODE,ACRD))
.I ACRNODE="ACRDOC"!(ACRNODE="VNDR")!(ACRNODE="ERR") D
..S ACRSTR=$P(ACRSTR,U,3,99) ;STRIP AP/VIEN FROM REPORTS
.I ACRNODE="ITEMS" D Q ;LOOP THRU MULTIPLE ITEMS
..S NUM=0
..F S NUM=$O(^ACRZ(ACRNODE,ACRD,NUM)) Q:'NUM D
...S ACRSTR=""
...F I=1:1:3 S ACRSTR=ACRSTR_$G(^ACRZ(ACRNODE,ACRD,NUM,I))_U
...D CNT
.D CNT
W !,$C(34)_"TOTAL = "_ACRCNT_$C(34)
S ACRARY(ACRNODE)=ACRCNT_" records have been put into file "_ACRDIR_ACRFILE
D CLOSE^%ZISH("FILE")
S ACRTOT=ACRTOT+ACRCNT
Q
;*************************************************
CNT ;
W !
F I=1:1:$L(ACRSTR,U) D
.S TMP=$P(ACRSTR,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
I ACRNODE="TR",$E(ACRSTR,1,3)="NO " S TRCNT=TRCNT+1 ;COUNT NO HIT/MATCH TRAVEL
S ACRCNT=ACRCNT+1
Q
;
;*************************************************************
TRH ;TRAVEL DOCUMENTS
NOMATCHH ;HEADING; DOCUMENT HIT BUT NO MATCH WITH CORE
NOVNDRH ;HEADING; MATCHED DOCUMENTS WITH NO VENDOR
W $C(34)_"NAME"_$C(34)
W $C(44)_$C(34)_"REQUISITION"_$C(34)
W $C(44)_$C(34)_"DATE OF DOCUMENT/TRANSMISSION"_$C(34)
W $C(44)_$C(34)_"IDENTIFIER/INVOICE"_$C(34)
D COREH
I ACRNODE'="NOMATCH" D
.W $C(44)_$C(34)_"ARMS RR STATUS"_$C(34)
.W $C(44)_$C(34)_"ARMS INVOICE STATUS"_$C(34)
Q
;
;*************************************************************
ACRDOCH ;HEADING; MATCHED DOCUMENTS WITH VENDOR AND ERROR FLAG
VNDRH ;HEADING; MATCHED DOCUMENT VENDORS WITH ERRORS
ERRH ;HEADING; VENDOR ERRORS WITH DOCUMENTS TO FLAT FILE
W $C(34)_"VENDOR NAME"_$C(34)
W $C(44)_$C(34)_"VENDOR EIN"_$C(34)
W $C(44)_$C(34)_"SUFFIX"_$C(34)
W $C(44)_$C(34)_"ARMS REQUISITION"_$C(34)
W $C(44)_$C(34)_"DATE OF DOCUMENT/TRANSMISSION"_$C(34)
W $C(44)_$C(34)_"IDENTIFIER/INVOICE"_$C(34)
D COREH
W $C(44)_$C(34)_"ARMS RR STATUS"_$C(34)
W $C(44)_$C(34)_"ARMS INVOICE STATUS"_$C(34)
W $C(44)_$C(34)_"VENDOR ERRORS"_$C(34)
Q
;
;*************************************************************
NOHITH ;WRITE NO HITS WITH CORE FILE HEADINGS FOR FLAT FILE
GRH ;GRANT DOCUMENTS
NOTRH ;TRAVEL WITHOUT A HIT (NON-GTRIP)
CHSH ;CHS DOCUMENTS
GTRIPH ;GOVTRIP DOCUMENTS
PAYH ;PAY ROLL ENTRIES IN CORE FILE
CEINH ;CORE/ARMS VENDOR CHECK
W $C(34)_"NAME"_$C(34)
COREH ;WRITE ALL CORE RECORDS HEADINGS FOR FLAT FILE
W:ACRNODE'="ITEMS" $C(44)
W $C(34)_"ACCOUNTING POINT"_$C(34)
W $C(44)_$C(34)_"CORE DOC-TYPE"_$C(34)
W $C(44)_$C(34)_"CORE DOCUMENT"_$C(34)
W $C(44)_$C(34)_"FISCAL YEAR"_$C(34)
W $C(44)_$C(34)_"CAN"_$C(34)
W $C(44)_$C(34)_"OCC"_$C(34)
W $C(44)_$C(34)_"CORE DOLLAR AMOUNT"_$C(34)
W $C(44)_$C(34)_"CORE REFERENCE CODE"_$C(34)
W $C(44)_$C(34)_"CORE VENDOR EIN"_$C(34)
Q
TOTALSH ;WRITE SUMMARY TOTALS
W $C(34)_"AREA OFFICE SITE"_$C(34)
W $C(44)_$C(34)_"RECORDS FROM CORE (ACRCORE)"_$C(34)
W $C(44)_$C(34)_"ARMS DOCUMENTS MATCHED WITH OPEN CORE RECORDS"_$C(34)
W $C(44)_$C(34)_"TOTAL UNDISBURSED AMOUNT"_$C(34)
W $C(44)_$C(34)_"MATCHED WITH VENDORS (ACRDOC)"_$C(34)
W $C(44)_$C(34)_"MATCHED WITH NO VENDOR (NOVNDR)"_$C(34)
W $C(44)_$C(34)_"UNIQUE MATCHED DOCUMENT VENDORS (VNDR)"_$C(34)
W $C(44)_$C(34)_"MATCHED RECORDS WITH VENDOR ERRORS (ERR)"_$C(34)
W $C(44)_$C(34)_"RECORDS WITH NO MATCHING DOC # (NOHIT)"_$C(34)
W $C(44)_$C(34)_"RECORDS WITH MATCHING DOC # AND NO MATCH ON CAN, OCC, FY (NOMATCH)"_$C(34)
W $C(44)_$C(34)_"ALL ARMS TRAVEL DOCUMENTS"_$C(34)
W $C(44)_$C(34)_"NO HIT PAYROLL RECORDS (PAY)"_$C(34)
W $C(44)_$C(34)_"NO HIT GOVTRIP DOCUMENTS"_$C(34)
W $C(44)_$C(34)_"NO HIT CHS DOCUMENTS"_$C(34)
W $C(44)_$C(34)_"NO HIT GRANT DOCUMENT"_$C(34)
W $C(44)_$C(34)_"RECORDS IN REPORTS"_$C(34)
Q
ITEMSH ;WRITE HEADINGS FOR LINE ITEMS
D COREH
1 W $C(44)_$C(34)_"ITEM NUMBER IN DOCUMENT"_$C(34)
W $C(44)_$C(34)_"UNIT OF ISSUE"_$C(34)
W $C(44)_$C(34)_"QUANTITY"_$C(34)
W $C(44)_$C(34)_"UNIT COST"_$C(34)
W $C(44)_$C(34)_"ESTIMATED COST"_$C(34)
W $C(44)_$C(34)_"QUANTITY RECEIVED"_$C(34)
W $C(44)_$C(34)_"QUANTITY ACCEPTED"_$C(34)
W $C(44)_$C(34)_"QUANTITY DUE IN"_$C(34)
W $C(44)_$C(34)_"RR QUANTITY RECEIVED"_$C(34)
W $C(44)_$C(34)_"RR QUANTITY ACCEPTED"_$C(34)
W $C(44)_$C(34)_"RR INVOICE QUANTITY"_$C(34)
W $C(44)_$C(34)_"AMOUNT PAID"_$C(34)
W $C(44)_$C(34)_"ARMS RR STATUS"_$C(34)
W $C(44)_$C(34)_"ARMS INVOICE STATUS"_$C(34)
;
2 W $C(44)_$C(34)_"LINE DESCRIPTION"_$C(34)
W $C(44)_$C(34)_"KEYWORD"_$C(34)
W $C(44)_$C(34)_"STANDARD ITEM NUMBER"_$C(34)
3 ;
W $C(44)_$C(34)_"ITEM DESCRIPTION"_$C(34)
W $C(44)_$C(34)_"CAN 'BILL TO' LOCATION"_$C(34)
W $C(44)_$C(34)_"CAN 'SHIP TO' LOCATION"_$C(34)
W $C(44)_$C(34)_"DEPARTMENT LOCATION"_$C(34)
W $C(44)_$C(34)_"DEPARTMENT LOCATION CODE NAME"_$C(34)
W $C(44)_$C(34)_"CAN LOCATION"_$C(34)
W $C(44)_$C(34)_"CAN LOCATION CODE NAME"_$C(34)
;
Q
ACRFUFMR ;IHS/OIRM/DSD/AEF - UTILITY STANDALONE TO READ OPEN DOCUMENTS FROM CORE FOR UFMS [ 05/16/2007 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
+2 ;NEW ROUTINE ACR*2.1*22 UFMS
+3 ;
+4 ;*************************************************************
READ ;EP;READ CONTENTS OF UNIX CORE FILES INTO ^ACRZ GLOBALS
+1 ;
+2 ; ACRFN = ARMS/CORE FILENAME -- Docs##.txt ; ## = Accounting point
+3 ;
+4 NEW ACRDIR,X,%DEV,ACRSTR,ACRI,ACRFN,ACRFAP
+5 NEW P1,P2,P3,P4,P5,P6,P7,P8,P9,ACRQUIT
+6 SET ACRFAP=$PIECE(^AUTTACPT($PIECE(^ACRSYS(1,"DT1"),U,13),0),U)
+7 ;MODIFY FOR HQ/NP
IF ACRFAP=65
SET ACRFAP="65-94"
+8 SET ACRFN="Docs"_ACRFAP_".txt"
+9 SET ACRDIR=$$ARMSDIR^ACRFSYS(1)
+10 IF ACRDIR["/usr/ACR/"
SET ACRDIR="/usr/ACR/"
+11 DO HFS^ACRFZISH(ACRDIR,ACRFN,"R",.%DEV)
+12 IF $GET(%DEV)']""
QUIT
+13 KILL ^ACRZ("ACRCORE")
+14 USE %DEV
+15 SET (ACRI,ACRQUIT)=0
+16 ;DIRECT READ OF UNIX FLAT FILE
FOR
READ X:DTIME
Begin DoDot:1
+17 SET ACRSTR=$$STR(X)
+18 IF ACRSTR=0
QUIT
+19 SET ACRI=ACRI+1
+20 SET ^ACRZ("ACRCORE",ACRI)=ACRSTR
End DoDot:1
IF ACRQUIT>4
QUIT
+21 ;
+22 DO CLOSE^%ZISH("FILE")
+23 ;DATE AND TIME STAMP
SET ^ACRZ("ACRCORE")=$$NOW^ACRFUTL
+24 ;NUMBER OF RECORDS
SET ^ACRZ("ACRCORE","TOTAL")=ACRI
+25 ;
+26 DO EN^ACRFUFMZ
+27 QUIT
+28 ;
+29 ;*************************************************************
STR(X) ; PARSING STRING
+1 ;40,AP,6007002300 ,2005,J40DU05,252Z,13292,100,1860777569A1
+2 ;SET QUIT CONDITION IF NULL
IF X=""
Begin DoDot:1
+3 ;IF IT FINDS FIVE NULL LINES, MUST BE EOF
SET ACRQUIT=ACRQUIT+1
End DoDot:1
QUIT 0
+4 ;DOL AMT
SET P7=$PIECE(X,",",7)
+5 ;SKIP ZERO DOLLAR AMOUNTS
IF P7=0!(P7="")
QUIT 0
+6 ;AP
SET P1=$PIECE(X,",",1)
+7 ;DOC-TYPE
SET P2=$PIECE(X,",",2)
+8 ;DOCUMENT
SET P3=$EXTRACT($PIECE(X,",",3),1,10)
+9 ;FY
SET P4=$PIECE(X,",",4)
+10 ;CAN
SET P5=$PIECE(X,",",5)
+11 ;OCC
SET P6=$PIECE(X,",",6)
+12 ;REF CODE
SET P8=$PIECE(X,",",8)
+13 ;VENDOR EIN
SET P9=$PIECE(X,",",9)
+14 SET STR=P1_U_P2_U_P3_U_P4_U_P5_U_P6_U_P7_U_P8_U_P9
+15 QUIT STR
+16 ;*************************************************************
+17 ; BEGIN REPORT FILE CREATION
+18 ;*************************************************************
ENW ;EP; ENTRY POINT FOR RECORDS GENERATED BY ^ACRFUFMZ
+1 ;
+2 NEW ACRNODE,ACRTOT,ACRTOTAL,ACRSITE,ACRCNT,ACRRPTOT,I,ACRCORE,ACRMTCH,TRCNT
+3 ;SITE NAME
SET ACRSITEN=$PIECE($GET(^AUTTAREA(+$GET(^ACRSYS(1,0)),0)),U)
+4 KILL ACRARY
+5 ;CREATE FILE NAME
+6 SET ACRSITE=$EXTRACT(ACRSITEN,1,3)
+7 IF ACRSITE="NAT"
SET ACRSITE="HQ"
+8 ; USE COMMA SEPARTED VALUE FORMAT
SET ACRTAIL=".csv"
+9 SET ACRPFX=ACRSITE_"_CORE_OPEN_"
+10 SET (ACRTOT,ACRRPTOT,TRCNT)=0
+11 ;
+12 ;LOOP THROUGH NODES TO CREATE REPORT FILES
+13 FOR ACRNODE="ITEMS","ACRDOC","VNDR","NOHIT","NOMATCH","NOVNDR","ERR","TR","PAY","GTRIP","CHS","GR","CEIN"
Begin DoDot:1
+14 SET ACRFILE=ACRPFX_ACRNODE_ACRTAIL
+15 DO WRITE(ACRNODE,ACRFILE)
End DoDot:1
+16 ;
+17 ;NUMBER OF RECORDS IN CORE FILE
SET ACRCORE=$GET(^ACRZ("ACRCORE","TOTAL"))
+18 SET ACRMTCH=0
+19 ;TOTAL ALL ARMS MATCHES
FOR I="ACRDOC","NOVNDR","TR"
Begin DoDot:1
+20 SET ACRMTCH=ACRMTCH+$GET(^ACRZ(I,"TOTAL"))
End DoDot:1
+21 ;SUBTRACT NUMBER OF NO HIT/MATCH TRAVEL
SET ACRMTCH=ACRMTCH-TRCNT
+22 SET ACRSTR=ACRSITEN_U_ACRCORE_U_ACRMTCH
+23 ;
+24 FOR I="TOTALS","ACRDOC","NOVNDR","VNDR","ERR","NOHIT","NOMATCH","TR","PAY","GTRIP","CHS","GR"
Begin DoDot:1
+25 ;CREATE 'TOTALS' SUMMARY STRING
SET ACRSTR=ACRSTR_U_$GET(^ACRZ(I,"TOTAL"))
+26 IF I="ERR"
QUIT
+27 IF I="VNDR"
QUIT
+28 ;TOTAL NUMBER IN REPORTS
IF I'="TOTALS"
SET ACRRPTOT=ACRRPTOT+^ACRZ(I,"TOTAL")
End DoDot:1
+29 ;
+30 SET ACRSTR=ACRSTR_U_ACRRPTOT
+31 SET ^ACRZ("TOTALS")=ACRSTR
+32 SET ACRFILE=ACRPFX_"TOTALS"_ACRTAIL
+33 DO WRITE("TOTALS",ACRFILE)
+34 ;TASKED JOB
IF IOST'["C-"
QUIT
+35 USE 0
+36 SET RAY=0
+37 FOR
SET RAY=$ORDER(ACRARY(RAY))
IF RAY=""
QUIT
Begin DoDot:1
+38 WRITE !,ACRARY(RAY)
End DoDot:1
+39 WRITE !!,"CORE OPEN DOCUMENT FILE IMPORTED ",$GET(^ACRZ("ACRCORE"))
+40 WRITE !,"TOTAL RECORDS FROM CORE FILE = ",ACRCORE
+41 WRITE !,"TOTAL RECORDS IN REPORT FILES = ",ACRRPTOT
+42 WRITE !?10,"TOTAL MATCHED DOCUMENTS = ",ACRMTCH
+43 WRITE !?10,"TOTAL VENDORS IN MATCHED FILES = ",^ACRZ("VNDR","TOTAL")
+44 WRITE !?10,"TOTAL MATCHED DOCUMENTS WITH VENDOR ERRORS = ",^ACRZ("ERR","TOTAL")
+45 DO PAUSE^ACRFWARN
+46 QUIT
+47 ;
+48 ;*************************************************************
WRITE(ACRNODE,ACRFILE) ;----- WRITE ^ACRZ(ACRNODE GLOBAL TO UNIX FILE
+1 ;
+2 NEW %DEV,ACR,ACRDIR,I,ACRI,ACRD,ACRN,ACRSTR,ACRFY
+3 KILL ACRARY(ACRNODE)
+4 SET ACRSTR=""
+5 SET ACRDIR=$$ARMSDIR^ACRFSYS(1)
+6 DO HFS^ACRFZISH(ACRDIR,.ACRFILE,"W",.%DEV)
+7 IF '$DATA(%DEV)
QUIT
+8 USE %DEV
+9 ;WRITE HEADING
DO @(ACRNODE_"H")
+10 ;SINGLE STRING ONLY
IF ACRNODE="TOTALS"
Begin DoDot:1
+11 SET ACRSTR=^ACRZ(ACRNODE)
+12 DO CNT
+13 SET ACRARY(ACRNODE)=ACRCNT_" records have been put into file "_ACRDIR_ACRFILE
+14 DO CLOSE^%ZISH("FILE")
End DoDot:1
QUIT
+15 SET ACRCNT=0
+16 SET ACRD=""
+17 FOR
SET ACRD=$ORDER(^ACRZ(ACRNODE,ACRD))
IF ACRD=""
QUIT
Begin DoDot:1
+18 IF ACRD="TOTAL"
QUIT
+19 SET ACRSTR=$GET(^ACRZ(ACRNODE,ACRD))
+20 IF ACRNODE="ACRDOC"!(ACRNODE="VNDR")!(ACRNODE="ERR")
Begin DoDot:2
+21 ;STRIP AP/VIEN FROM REPORTS
SET ACRSTR=$PIECE(ACRSTR,U,3,99)
End DoDot:2
+22 ;LOOP THRU MULTIPLE ITEMS
IF ACRNODE="ITEMS"
Begin DoDot:2
+23 SET NUM=0
+24 FOR
SET NUM=$ORDER(^ACRZ(ACRNODE,ACRD,NUM))
IF 'NUM
QUIT
Begin DoDot:3
+25 SET ACRSTR=""
+26 FOR I=1:1:3
SET ACRSTR=ACRSTR_$GET(^ACRZ(ACRNODE,ACRD,NUM,I))_U
+27 DO CNT
End DoDot:3
End DoDot:2
QUIT
+28 DO CNT
End DoDot:1
+29 WRITE !,$CHAR(34)_"TOTAL = "_ACRCNT_$CHAR(34)
+30 SET ACRARY(ACRNODE)=ACRCNT_" records have been put into file "_ACRDIR_ACRFILE
+31 DO CLOSE^%ZISH("FILE")
+32 SET ACRTOT=ACRTOT+ACRCNT
+33 QUIT
+34 ;*************************************************
CNT ;
+1 WRITE !
+2 FOR I=1:1:$LENGTH(ACRSTR,U)
Begin DoDot:1
+3 SET TMP=$PIECE(ACRSTR,U,I)
+4 ;WRITE " DOUBLE QUOTE
WRITE $CHAR(34)
+5 ;WRITE ' SINGLE QUOTE IN FRONT OF ZERO
IF $EXTRACT(TMP)="0"
IF $LENGTH(TMP)'=1
WRITE $CHAR(39)
+6 ;WRITE " DOUBLE QUOTE AND COMMA
WRITE TMP_$CHAR(34)_$CHAR(44)
End DoDot:1
+7 ;COUNT NO HIT/MATCH TRAVEL
IF ACRNODE="TR"
IF $EXTRACT(ACRSTR,1,3)="NO "
SET TRCNT=TRCNT+1
+8 SET ACRCNT=ACRCNT+1
+9 QUIT
+10 ;
+11 ;*************************************************************
TRH ;TRAVEL DOCUMENTS
NOMATCHH ;HEADING; DOCUMENT HIT BUT NO MATCH WITH CORE
NOVNDRH ;HEADING; MATCHED DOCUMENTS WITH NO VENDOR
+1 WRITE $CHAR(34)_"NAME"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"REQUISITION"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"DATE OF DOCUMENT/TRANSMISSION"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"IDENTIFIER/INVOICE"_$CHAR(34)
+5 DO COREH
+6 IF ACRNODE'="NOMATCH"
Begin DoDot:1
+7 WRITE $CHAR(44)_$CHAR(34)_"ARMS RR STATUS"_$CHAR(34)
+8 WRITE $CHAR(44)_$CHAR(34)_"ARMS INVOICE STATUS"_$CHAR(34)
End DoDot:1
+9 QUIT
+10 ;
+11 ;*************************************************************
ACRDOCH ;HEADING; MATCHED DOCUMENTS WITH VENDOR AND ERROR FLAG
VNDRH ;HEADING; MATCHED DOCUMENT VENDORS WITH ERRORS
ERRH ;HEADING; VENDOR ERRORS WITH DOCUMENTS TO FLAT FILE
+1 WRITE $CHAR(34)_"VENDOR NAME"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"VENDOR EIN"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"SUFFIX"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"ARMS REQUISITION"_$CHAR(34)
+5 WRITE $CHAR(44)_$CHAR(34)_"DATE OF DOCUMENT/TRANSMISSION"_$CHAR(34)
+6 WRITE $CHAR(44)_$CHAR(34)_"IDENTIFIER/INVOICE"_$CHAR(34)
+7 DO COREH
+8 WRITE $CHAR(44)_$CHAR(34)_"ARMS RR STATUS"_$CHAR(34)
+9 WRITE $CHAR(44)_$CHAR(34)_"ARMS INVOICE STATUS"_$CHAR(34)
+10 WRITE $CHAR(44)_$CHAR(34)_"VENDOR ERRORS"_$CHAR(34)
+11 QUIT
+12 ;
+13 ;*************************************************************
NOHITH ;WRITE NO HITS WITH CORE FILE HEADINGS FOR FLAT FILE
GRH ;GRANT DOCUMENTS
NOTRH ;TRAVEL WITHOUT A HIT (NON-GTRIP)
CHSH ;CHS DOCUMENTS
GTRIPH ;GOVTRIP DOCUMENTS
PAYH ;PAY ROLL ENTRIES IN CORE FILE
CEINH ;CORE/ARMS VENDOR CHECK
+1 WRITE $CHAR(34)_"NAME"_$CHAR(34)
COREH ;WRITE ALL CORE RECORDS HEADINGS FOR FLAT FILE
+1 IF ACRNODE'="ITEMS"
WRITE $CHAR(44)
+2 WRITE $CHAR(34)_"ACCOUNTING POINT"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"CORE DOC-TYPE"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"CORE DOCUMENT"_$CHAR(34)
+5 WRITE $CHAR(44)_$CHAR(34)_"FISCAL YEAR"_$CHAR(34)
+6 WRITE $CHAR(44)_$CHAR(34)_"CAN"_$CHAR(34)
+7 WRITE $CHAR(44)_$CHAR(34)_"OCC"_$CHAR(34)
+8 WRITE $CHAR(44)_$CHAR(34)_"CORE DOLLAR AMOUNT"_$CHAR(34)
+9 WRITE $CHAR(44)_$CHAR(34)_"CORE REFERENCE CODE"_$CHAR(34)
+10 WRITE $CHAR(44)_$CHAR(34)_"CORE VENDOR EIN"_$CHAR(34)
+11 QUIT
TOTALSH ;WRITE SUMMARY TOTALS
+1 WRITE $CHAR(34)_"AREA OFFICE SITE"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"RECORDS FROM CORE (ACRCORE)"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"ARMS DOCUMENTS MATCHED WITH OPEN CORE RECORDS"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"TOTAL UNDISBURSED AMOUNT"_$CHAR(34)
+5 WRITE $CHAR(44)_$CHAR(34)_"MATCHED WITH VENDORS (ACRDOC)"_$CHAR(34)
+6 WRITE $CHAR(44)_$CHAR(34)_"MATCHED WITH NO VENDOR (NOVNDR)"_$CHAR(34)
+7 WRITE $CHAR(44)_$CHAR(34)_"UNIQUE MATCHED DOCUMENT VENDORS (VNDR)"_$CHAR(34)
+8 WRITE $CHAR(44)_$CHAR(34)_"MATCHED RECORDS WITH VENDOR ERRORS (ERR)"_$CHAR(34)
+9 WRITE $CHAR(44)_$CHAR(34)_"RECORDS WITH NO MATCHING DOC # (NOHIT)"_$CHAR(34)
+10 WRITE $CHAR(44)_$CHAR(34)_"RECORDS WITH MATCHING DOC # AND NO MATCH ON CAN, OCC, FY (NOMATCH)"_$CHAR(34)
+11 WRITE $CHAR(44)_$CHAR(34)_"ALL ARMS TRAVEL DOCUMENTS"_$CHAR(34)
+12 WRITE $CHAR(44)_$CHAR(34)_"NO HIT PAYROLL RECORDS (PAY)"_$CHAR(34)
+13 WRITE $CHAR(44)_$CHAR(34)_"NO HIT GOVTRIP DOCUMENTS"_$CHAR(34)
+14 WRITE $CHAR(44)_$CHAR(34)_"NO HIT CHS DOCUMENTS"_$CHAR(34)
+15 WRITE $CHAR(44)_$CHAR(34)_"NO HIT GRANT DOCUMENT"_$CHAR(34)
+16 WRITE $CHAR(44)_$CHAR(34)_"RECORDS IN REPORTS"_$CHAR(34)
+17 QUIT
ITEMSH ;WRITE HEADINGS FOR LINE ITEMS
+1 DO COREH
1 WRITE $CHAR(44)_$CHAR(34)_"ITEM NUMBER IN DOCUMENT"_$CHAR(34)
+1 WRITE $CHAR(44)_$CHAR(34)_"UNIT OF ISSUE"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"QUANTITY"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"UNIT COST"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"ESTIMATED COST"_$CHAR(34)
+5 WRITE $CHAR(44)_$CHAR(34)_"QUANTITY RECEIVED"_$CHAR(34)
+6 WRITE $CHAR(44)_$CHAR(34)_"QUANTITY ACCEPTED"_$CHAR(34)
+7 WRITE $CHAR(44)_$CHAR(34)_"QUANTITY DUE IN"_$CHAR(34)
+8 WRITE $CHAR(44)_$CHAR(34)_"RR QUANTITY RECEIVED"_$CHAR(34)
+9 WRITE $CHAR(44)_$CHAR(34)_"RR QUANTITY ACCEPTED"_$CHAR(34)
+10 WRITE $CHAR(44)_$CHAR(34)_"RR INVOICE QUANTITY"_$CHAR(34)
+11 WRITE $CHAR(44)_$CHAR(34)_"AMOUNT PAID"_$CHAR(34)
+12 WRITE $CHAR(44)_$CHAR(34)_"ARMS RR STATUS"_$CHAR(34)
+13 WRITE $CHAR(44)_$CHAR(34)_"ARMS INVOICE STATUS"_$CHAR(34)
+14 ;
2 WRITE $CHAR(44)_$CHAR(34)_"LINE DESCRIPTION"_$CHAR(34)
+1 WRITE $CHAR(44)_$CHAR(34)_"KEYWORD"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"STANDARD ITEM NUMBER"_$CHAR(34)
3 ;
+1 WRITE $CHAR(44)_$CHAR(34)_"ITEM DESCRIPTION"_$CHAR(34)
+2 WRITE $CHAR(44)_$CHAR(34)_"CAN 'BILL TO' LOCATION"_$CHAR(34)
+3 WRITE $CHAR(44)_$CHAR(34)_"CAN 'SHIP TO' LOCATION"_$CHAR(34)
+4 WRITE $CHAR(44)_$CHAR(34)_"DEPARTMENT LOCATION"_$CHAR(34)
+5 WRITE $CHAR(44)_$CHAR(34)_"DEPARTMENT LOCATION CODE NAME"_$CHAR(34)
+6 WRITE $CHAR(44)_$CHAR(34)_"CAN LOCATION"_$CHAR(34)
+7 WRITE $CHAR(44)_$CHAR(34)_"CAN LOCATION CODE NAME"_$CHAR(34)
+8 ;
+9 QUIT