- ACRFUFMD ;IHS/OIRM/DSD/AEF - DRIVER TO CORE OPEN DOCUMENTS MATCH FOR UFMS [ 05/21/2007 9:44 AM ]
- ;;2.1;ADMIN RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
- ;LOOP THROUGH CORE OPEN DOCUMENT FILE AND FIND MATCH IN ARMS
- ;New routine ACR*2.1*22 UFMS
- ;
- EN ;EP;
- N I,ACRX
- W @IOF
- F I=1:1 S ACRX=$P($T(DESC+I),";",3) Q:ACRX["$$END" D
- .W !,ACRX
- .I $Y>(IOSL-6) D
- ..K ACROUT
- ..D PAUSE^ACRFWARN
- ..W @IOF
- .Q:$D(ACROUT)
- Q:$D(ACROUT)
- S DIR(0)="Y"
- S DIR("A")="Do you want to continue and generate the reports"
- S DIR("B")="NO"
- D ^DIR
- Q:'Y=1
- ;
- S ACRX="Please be patient while the files are created."
- D BMES^XPDUTL(ACRX)
- D EN^ACRFUFMZ
- Q
- ; *********************************************
- ;
- DESC ;----- ROUTINE DESCRIPTION
- ;;
- ;;This routine loops through the imported CORE Open Documents file entries and
- ;; attempts to match the CORE document number with ARMS documents in the FMS
- ;; Document, FMS Document History Record and the 1166 Approvals for Payment files
- ;; and sets various sub-files depending on the type of match. The sub-files can
- ;; be uploaded into Excel spreadsheet reports and are located in the ARMS default
- ;; directory where the ECS files are found (generally /usr/spool/afsdata).
- ;;
- ;;Contract Health ("CHS"), GovTrip ("GTRIP"), Payroll ("PAY") and Grant ("GR")
- ;; documents are not found in ARMS. The documents are listed in separate reports.
- ;;
- ;;When a document is found, the routine matches the CAN, Fiscal Year, and
- ;; Object Class Code supplied by CORE.
- ;;
- ;;When a match is found, the routine creates additional sub-files:
- ;; "ACRDOC" contains ARMS document data with Vendor information
- ;; "NOVNDR" contains ARMS document data for obligations without a Vendor
- ;; "TR" contains outstanding ARMS Travel documents including those without
- ;; a match to an ARMS document
- ;; "VNDR" contains an unique listing of all Vendors found in the matches
- ;; "ERR" contains every document that has a Vendor with errors found in the
- ;; IHS Vendor file
- ;; "NOHIT" contains CORE documents that could not be matched in any category
- ;; "NOMATCH" contains documents that were found in ARMS, but did not match
- ;; the criteria
- ;; "ITEMS" contains the obligation, payment, receiving report and invoice
- ;; information on the line item
- ;; "CEIN" contains ARMS Vendor numbers that do not match the CORE Vendor
- ;; "TOTALS" contains the total number of documents in each report
- ;;
- ;;$$END
- ;
- ; ************************************************
- AUDIT ;EP; SEARCH FOR VENDORS WITH ERROR AND FIX IF POSSIBLE
- ;
- K ^ACRZ("VEINCK")
- S (CORP,INDV,ACR,ERR)=0
- S ACRNODUP=1 ;SKIP DUPLICATE CHECK
- F S ACR=$O(^AUTTVNDR(ACR)) Q:'ACR D
- .I $$IDATE^ACRFUFMU(ACR) Q
- .S ACRERR=""
- .S OLD0=$G(^AUTTVNDR(ACR,0))
- .S OLD11=$G(^AUTTVNDR(ACR,11))
- .D NAMCHK^ACRFUFMU(ACR)
- .D DUNSCHK^ACRFUFMU(ACR)
- .D EINCHK^ACRFUFMU(ACR)
- .D SFX2
- .D BANK^ACRFUFMU(ACR)
- .S NEW0=$G(^AUTTVNDR(ACR,0))
- .S NEW11=$G(^AUTTVNDR(ACR,11))
- DIAG .I $D(^AUTTVNDR(DT)) D
- ..W !,$G(^AUTTVNDR(DT,0))
- .I OLD0'=NEW0 W !,ACR,?8,NEW0,!?20,ACRERR
- .I OLD11'=NEW11 W !,ACR,?8,NEW11,!?20,ACRERR
- Q
- ; *********************************
- SFX2 ;
- S ACRSFX=$$SFX^ACRFUFMU(ACR)
- Q:$L(ACRSFX)=2
- N HIT,I
- S HIT=0
- I $L(ACREIN)=10 D Q
- .I ACRSFX="" F I="00":"01" D Q:HIT
- ..I $L(I)=1 S I="0"_I
- ..I '$D(^AUTTVNDR("E",ACREIN_I)) D Q
- ...S DIE="^AUTTVNDR("
- ...S DA=X
- ...S DR="1102////"_I
- ...D DIE^ACRFDIC
- ...S HIT=1
- S ^ACRZ("VEINCK","ERR",ACR)=^AUTTVNDR(ACR,0)_U_ACREIN_ACRSFX_": "_ACRERR
- Q
- CLEAN ;FIX
- W !,ACR,?15,^AUTTVNDR(ACR,0)
- S DIE="^AUTTVNDR("
- S DA=ACR
- S DR=".05////@" ;REMOVE INACTIVE DATE
- D DIE^ACRFDIC
- W !?15,^AUTTVNDR(ACR,0)
- Q
- ACRFUFMD ;IHS/OIRM/DSD/AEF - DRIVER TO CORE OPEN DOCUMENTS MATCH FOR UFMS [ 05/21/2007 9:44 AM ]
- +1 ;;2.1;ADMIN RESOURCE MGMT SYSTEM;**22**;NOV 05, 2001
- +2 ;LOOP THROUGH CORE OPEN DOCUMENT FILE AND FIND MATCH IN ARMS
- +3 ;New routine ACR*2.1*22 UFMS
- +4 ;
- EN ;EP;
- +1 NEW I,ACRX
- +2 WRITE @IOF
- +3 FOR I=1:1
- SET ACRX=$PIECE($TEXT(DESC+I),";",3)
- IF ACRX["$$END"
- QUIT
- Begin DoDot:1
- +4 WRITE !,ACRX
- +5 IF $Y>(IOSL-6)
- Begin DoDot:2
- +6 KILL ACROUT
- +7 DO PAUSE^ACRFWARN
- +8 WRITE @IOF
- End DoDot:2
- +9 IF $DATA(ACROUT)
- QUIT
- End DoDot:1
- +10 IF $DATA(ACROUT)
- QUIT
- +11 SET DIR(0)="Y"
- +12 SET DIR("A")="Do you want to continue and generate the reports"
- +13 SET DIR("B")="NO"
- +14 DO ^DIR
- +15 IF 'Y=1
- QUIT
- +16 ;
- +17 SET ACRX="Please be patient while the files are created."
- +18 DO BMES^XPDUTL(ACRX)
- +19 DO EN^ACRFUFMZ
- +20 QUIT
- +21 ; *********************************************
- +22 ;
- DESC ;----- ROUTINE DESCRIPTION
- +1 ;;
- +2 ;;This routine loops through the imported CORE Open Documents file entries and
- +3 ;; attempts to match the CORE document number with ARMS documents in the FMS
- +4 ;; Document, FMS Document History Record and the 1166 Approvals for Payment files
- +5 ;; and sets various sub-files depending on the type of match. The sub-files can
- +6 ;; be uploaded into Excel spreadsheet reports and are located in the ARMS default
- +7 ;; directory where the ECS files are found (generally /usr/spool/afsdata).
- +8 ;;
- +9 ;;Contract Health ("CHS"), GovTrip ("GTRIP"), Payroll ("PAY") and Grant ("GR")
- +10 ;; documents are not found in ARMS. The documents are listed in separate reports.
- +11 ;;
- +12 ;;When a document is found, the routine matches the CAN, Fiscal Year, and
- +13 ;; Object Class Code supplied by CORE.
- +14 ;;
- +15 ;;When a match is found, the routine creates additional sub-files:
- +16 ;; "ACRDOC" contains ARMS document data with Vendor information
- +17 ;; "NOVNDR" contains ARMS document data for obligations without a Vendor
- +18 ;; "TR" contains outstanding ARMS Travel documents including those without
- +19 ;; a match to an ARMS document
- +20 ;; "VNDR" contains an unique listing of all Vendors found in the matches
- +21 ;; "ERR" contains every document that has a Vendor with errors found in the
- +22 ;; IHS Vendor file
- +23 ;; "NOHIT" contains CORE documents that could not be matched in any category
- +24 ;; "NOMATCH" contains documents that were found in ARMS, but did not match
- +25 ;; the criteria
- +26 ;; "ITEMS" contains the obligation, payment, receiving report and invoice
- +27 ;; information on the line item
- +28 ;; "CEIN" contains ARMS Vendor numbers that do not match the CORE Vendor
- +29 ;; "TOTALS" contains the total number of documents in each report
- +30 ;;
- +31 ;;$$END
- +32 ;
- +33 ; ************************************************
- AUDIT ;EP; SEARCH FOR VENDORS WITH ERROR AND FIX IF POSSIBLE
- +1 ;
- +2 KILL ^ACRZ("VEINCK")
- +3 SET (CORP,INDV,ACR,ERR)=0
- +4 ;SKIP DUPLICATE CHECK
- SET ACRNODUP=1
- +5 FOR
- SET ACR=$ORDER(^AUTTVNDR(ACR))
- IF 'ACR
- QUIT
- Begin DoDot:1
- +6 IF $$IDATE^ACRFUFMU(ACR)
- QUIT
- +7 SET ACRERR=""
- +8 SET OLD0=$GET(^AUTTVNDR(ACR,0))
- +9 SET OLD11=$GET(^AUTTVNDR(ACR,11))
- +10 DO NAMCHK^ACRFUFMU(ACR)
- +11 DO DUNSCHK^ACRFUFMU(ACR)
- +12 DO EINCHK^ACRFUFMU(ACR)
- +13 DO SFX2
- +14 DO BANK^ACRFUFMU(ACR)
- +15 SET NEW0=$GET(^AUTTVNDR(ACR,0))
- +16 SET NEW11=$GET(^AUTTVNDR(ACR,11))
- DIAG IF $DATA(^AUTTVNDR(DT))
- Begin DoDot:2
- +1 WRITE !,$GET(^AUTTVNDR(DT,0))
- End DoDot:2
- +2 IF OLD0'=NEW0
- WRITE !,ACR,?8,NEW0,!?20,ACRERR
- +3 IF OLD11'=NEW11
- WRITE !,ACR,?8,NEW11,!?20,ACRERR
- End DoDot:1
- +4 QUIT
- +5 ; *********************************
- SFX2 ;
- +1 SET ACRSFX=$$SFX^ACRFUFMU(ACR)
- +2 IF $LENGTH(ACRSFX)=2
- QUIT
- +3 NEW HIT,I
- +4 SET HIT=0
- +5 IF $LENGTH(ACREIN)=10
- Begin DoDot:1
- +6 IF ACRSFX=""
- FOR I="00":"01"
- Begin DoDot:2
- +7 IF $LENGTH(I)=1
- SET I="0"_I
- +8 IF '$DATA(^AUTTVNDR("E",ACREIN_I))
- Begin DoDot:3
- +9 SET DIE="^AUTTVNDR("
- +10 SET DA=X
- +11 SET DR="1102////"_I
- +12 DO DIE^ACRFDIC
- +13 SET HIT=1
- End DoDot:3
- QUIT
- End DoDot:2
- IF HIT
- QUIT
- End DoDot:1
- QUIT
- +14 SET ^ACRZ("VEINCK","ERR",ACR)=^AUTTVNDR(ACR,0)_U_ACREIN_ACRSFX_": "_ACRERR
- +15 QUIT
- CLEAN ;FIX
- +1 WRITE !,ACR,?15,^AUTTVNDR(ACR,0)
- +2 SET DIE="^AUTTVNDR("
- +3 SET DA=ACR
- +4 ;REMOVE INACTIVE DATE
- SET DR=".05////@"
- +5 DO DIE^ACRFDIC
- +6 WRITE !?15,^AUTTVNDR(ACR,0)
- +7 QUIT