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

AFSLCKSQ.m

Go to the documentation of this file.
AFSLCKSQ ;IHS/OIRM/DSD/JLG - CK PAYMENTS;  [ 09/26/2005  5:04 PM ]
 ;;3.0t1;1166 APPROVALS FOR PAYMENT;**19**;AUG 31, 2005
 ;Modified for Y2k compliance    IHS/DSD/JLG/HJT  1/27/1999
 ;Original JDM
 ;Payment record edit - part 1
 ;
 ;User input of a 2 digit FY has been changed to 4 digits at tag NDEYR
 ;
EN1 ; EP; ENTRY POINT FOR CALLING ROUTINES
 S AFSLZROS="0000000000"
 D ^XBCLS
 W !,"We must do the following checks on the payment batch(es):"
 W !!,"1 ... Check all payments if corrupt or not recorded in the document."
 W !,"2 ... Check all payments for PAY NAME vs. PAY-ID"
 W !,"3 ... List and verify 'hash' totals for each batch."
 W !,"4 ... Check each batch for blank/incomplete payments.",!
 R !,"NOW PRESS RETURN TO BEGIN",AFSLRTNX:300
 D ^XBCLS
 D CRTSETUP^AFSLCRTS
 I '$D(AFSLDDX) S AFSLDDX=""
 S DY=2
 S DX=28
 X XY
 W @AFSLRVON,"1166 AFP DATA ENTRY",@AFSLRVOF
 S DY=3
 S DX=21
 X XY
 W @AFSLRVON,"PAYMENT RECORD CHECK PROCESS",@AFSLRVOF
 S DY=23
 S DX=23
 X XY
 W AFSLDDX
 H 2
 S AFSLDDX=""
NDE ;
 S AFSLNXT="E"
 I AFSLNXT="" S AFSLNXT="Q"
 I $E(AFSLNXT,1)'="E" G ENDIT
 S AFSLANSD="E"
NDEYR ;
 S AFSLSQNO="0000"
 S DY=23
 S DX=23
 X XY
 W "                                "
 S DY=9
 S DX=8
 X XY
 ;Begin Y2k fix    IHS/DSD/HJT  1/27/1999
 ;W "FISCAL YR: **"
 W "FISCAL YR: ****"   ;Need 4 *'s to designate 4 yr date  HJT 1/27/99
 ;End Y2k fix   
 S DX=19
 ;Begin Y2K fix  ;IHS/DSD/JLG 12/28/98
 ;This code has been changed to request a 4 digit year.
 ;After tag LOOK rtn AFSLYRLU is called which stores AFSLFYR as the
 ;.01 field of 9002325 which is being changed to 4 digit year
 ;S AFSLCHRS=2
 S AFSLCHRS=4    ;Y2000
 X XY
 D READCHRS^AFSLSRDR
 S AFSLFYR=AFSLVOUT
 I AFSLFYR["^" S AFSLANSD="Q" G ENDIT
 I AFSLFYR["?" D  G NDEYR
 .S DX=26
 .X XY
 .;W @AFSLRVON,"ENTER A 2 DIGIT YR UNDER WHICH BATCH IS FILED ",@AFSLRVOF
 .W @AFSLRVON,"ENTER A 4 DIGIT YR UNDER WHICH BATCH IS FILED ",@AFSLRVOF   ;Y2000
 .H 3
 .X XY
 .W "                                                       "
 ;I $L(AFSLFYR)<2 D  G NDEYR
 I $L(AFSLFYR)<4 D  G NDEYR   ;Y2000
 .S DX=26
 .X XY
 .W @AFSLRVON,"ENTER 4 DIGIT YR UNDER WHICH BATCH IS FILED ",@AFSLRVOF   ;Y2000
 .;W @AFSLRVON,"ENTER 2 DIGIT YR UNDER WHICH BATCH IS FILED ",@AFSLRVOF
 .;End Y2K fix
 .H 3
 .X XY
 .W "                                                   "
 S DX=19
 X XY
 W @AFSLRVON,AFSLFYR,@AFSLRVOF
 S DY=9
 S DX=24
 X XY
 W "    BATCH: ******"
 S DX=35
 S AFSLCHRS=6
 X XY
 D READCHRS^AFSLSRDR
 S AFSLSCHD=AFSLVOUT
 I AFSLSCHD["^" S AFSLANSD="Q" G ENDIT
 S AFSLLNTH=$L(AFSLSCHD),AFSLZLTH=6-AFSLLNTH
 I AFSLZLTH<0 D
 .S AFSLZFIL=$E($$ZERO^AFSLUTLM(50),1,AFSLZLTH)
 .S AFSLSCHD=AFSLZFIL_AFSLSCHD
 S DX=35
 X XY
 W @AFSLRVON,AFSLSCHD,@AFSLRVOF
 S AFSLSCHE=AFSLSCHD
 I AFSLSCHE["^" S AFSLANSD="Q" G ENDIT
 S AFSLLNTH=$L(AFSLSCHE)
 S AFSLZLTH=6-AFSLLNTH
 I AFSLZLTH<0 D
 .S AFSLZFIL=$E($$ZERO^AFSLUTLM(50),1,AFSLZLTH)
 .S AFSLSCHE=AFSLZFIL_AFSLSCHE
 I AFSLSQNO["^" S AFSLANSD="Q" G ENDIT
 S AFSLLNTH=$L(AFSLSQNO)
 S AFSLZLTH=4-AFSLLNTH
 I AFSLZLTH>0 D
 .S AFSLZFIL=$E($$ZERO^AFSLUTLM(50),1,AFSLZLTH)
 .S AFSLSQNO=AFSLZFIL_AFSLSQNO
 S DX=75
 X XY
 W @AFSLRVON,AFSLSQNO,@AFSLRVOF
LOOPS ;
 I AFSLANSD="Q" QUIT
 S AFSLSQNO="0000"
 S AFSLSQNO="0000"
 Q:AFSLANSD="Q"
 D PMTLOOP
 I $G(AFSLANSD)="Q" K AFSLANSD Q
 Q
PMTLOOP ;
 S AFSLSQNO=$E($$ZERO^AFSLUTLM(4),1,4-$L(AFSLSQNO))_AFSLSQNO
LOOK ;
 D ^AFSLYRLU
 I Y="-1" S AFSLDDX="INVALID FISCAL YR                  " G EN1
 D ^AFSLSCLU
 I Y="-1" S AFSLDDX="INVALID BATCH                      " G EN1
PMTLOOP2 ; 
 Q:'$O(^AFSLAFP(AFSLYNOD,1,AFSLSNOD,1,"B",AFSLSQNO))
 S AFSLSQNO=$O(^AFSLAFP(AFSLYNOD,1,AFSLSNOD,1,"B",AFSLSQNO))
 S DY=9
 S DX=75
 X XY
 W @AFSLRVON,AFSLSQNO,@AFSLRVOF
 D ^AFSLSQLU
 I Y="-1" S AFSLDDX="INVALID SEQUENCE                   " G EN1
 S $P(AFSLNZRO,U,30)=""
CKSEQ ;EIN
 S AFSLEINO=$P(AFSLNZRO,U,10)
 I AFSLEINO="" S AFSLPEIN="" G CKSEQ1
 I '$D(^AUTTVNDR(AFSLEINO,11)) G CKSEQ2
 S AFSLPEIN=$P(^AUTTVNDR(AFSLEINO,11),U,1)
 S AFSLPSFX=$P(^AUTTVNDR(AFSLEINO,11),U,2)
 S AFSLVEIN=AFSLPEIN_AFSLPSFX
CKSEQ1 ;SSN
 S AFSLSSNO=$P(AFSLNZRO,U,24)
 I AFSLSSNO="" S AFSLSSN="" G CKSEQ1A
 I '$D(^VA(200,AFSLSSNO,0)) S AFSLSSN="" G CKSEQ1A
 ;S AFSLSSN=$P(^VA(200,AFSLSSNO,0),U,1)  ;ACR*2.1*19.02 IM16848
 S AFSLSSN=$$NAME2^ACRFUTL1(AFSLSSNO)  ;ACR*2.1*19.02 IM16848
CKSEQ1A ;PAY NAME
 I '$D(AFSLNOD1) D
 .S AFSLHERR=1
 .S DY=17
 .S DX=12
 .X XY
 .W @AFSLRVON,"THIS PAYMENT RECORD IS CORRUPTED.  DELETE IT & RE-ENTER.",@AFSLRVOF D PRESS S AFSLNOD1="^^^^^^^^^^^^^^^^^^^^"
 S AFSLPNAM=$P(AFSLNOD1,U,4)
CKSEQ1B ;PAY-ID 
 S AFSLPID=$P(AFSLNOD1,U,22)
CKSEQ2 ;
 S DY=11
 S DX=13
 X XY
 W "FOUND FYR: ",AFSLFYR,"     BATCH: ",AFSLSCHD,"    SEQUENCE: ",AFSLSQNO
 S AFSLCAN=""
 S AFSLOBJ=""
 S AFSLPTY=""
 S AFSLDTY=""
 S DY=13,DX=6
 X XY
 W "DOC REF: ",$P(AFSLNZRO,U,5)
 S DX=45
 X XY
 W "DOCUMENT: ",$P(AFSLNZRO,U,20)
 S DY=14,DX=6
 X XY
 W "OTH REF: ",$P(AFSLNZRO,U,6)
 S DX=45
 X XY
 W "OTH DOC#: ",$P(AFSLNZRO,U,21)
 S AFSLCAN=$P(AFSLNZRO,U,7)
 I AFSLCAN'="" S AFSLCAN=$P(^AUTTCAN(AFSLCAN,0),U,1)
 S AFSLOBJ=$P(AFSLNZRO,U,8)
 I AFSLOBJ'="" S AFSLOBJ=$P(^AUTTOBJC(AFSLOBJ,0),U,1)
 S DY=15,DX=6
 X XY
 W "CAN NUM: ",AFSLCAN
 S DX=45
 X XY
 W "OBJ CLAS: ",AFSLOBJ
 S AFSLPTY=$P(AFSLNZRO,U,22),AFSLTYPE=AFSLPTY
 I AFSLPTY'="" S AFSLPTY=$P(^AFSLPTYP(AFSLPTY,0),U,2)
 S AFSLPTYP=AFSLPTY
 S AFSLDTY=$P(AFSLNZRO,U,9)
 S DY=16,DX=6
 X XY
 W "DOC TYP: ",AFSLDTY
 S DX=26
 X XY
 W "AMOUNT: ",$P(AFSLNZRO,U,11)
 S DX=45
 X XY
 W "PAY TYPE: ",AFSLPTY
CKPYX ;
 I '$D(AFSLVEIN) S AFSLVEIN=""
 S DY=19,DX=8
 X XY
 F M=1:1:32 W " "
 S DX=44
 X XY
 F M=1:1:12 W " "
 S DX=66
 X XY
 F M=1:1:12 W " "
 S DY=20,DX=66
 X XY
 F M=1:1:12 W " "
 S DY=19,DX=2
 X XY
 W "NAME: ",AFSLPNAM
 S DX=40
 X XY
 W "ID: ",AFSLPID
 S DX=58
 X XY
 W "VN-EIN: ",AFSLVEIN
 S DY=20,DX=58
 X XY
 W "TV-SSN: ",AFSLSSN
 S AFSLDELX="N"
 I '$D(AFSLNOD1)!('$D(AFSLNZRO)) D  Q
 .S AFSLHERR=1
 .S DY=17,DX=12
 .X XY
 .W @AFSLRVON,"THIS PAYMENT RECORD IS CORRUPTED.  DELETE IT & RE-ENTER.",@AFSLRVOF
 .D PRESS
 I $P(AFSLNOD1,U,15)="" D  Q
 .S AFSLHERR=1
 .S DY=17,DX=12
 .X XY
 .W @AFSLRVON,"THIS PAYMENT NOT RECORDED IN DOCUMENT. DELETE IT & RE-ENTER.",@AFSLRVOF
 .D PRESS
 I $P(AFSLNZRO,U,27)="D" D  Q
 .S AFSLHERR=1
 .S DY=17,DX=12
 .X XY
 .W @AFSLRVON,"***** MARKED BY C.O. TO BE WITHHELD FROM EXPORT *****",@AFSLRVOF
 .D PRESS
 I AFSLVEIN="" G PMTLOOP2
 S X=AFSLPNAM
 D ^AFSLPYCR
 G PMTLOOP2
 Q
ENDIT ;
 D ENDIT^AFSLKEDT
 QUIT
PRESS ;
 S DY=23,DX=2
 X XY
 W @AFSLRVON,"PRESS RETURN",@AFSLRVOF R AFSLRTNX:300
 S DX=2
 X XY
 W "            "
 K AFSLDDX
 S DY=17,DX=12
 X XY W "                                                                    "
 Q