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

ACRFPAY4.m

Go to the documentation of this file.
ACRFPAY4 ;IHS/OIRM/DSD/THL,AEF - CERTIFY AND EXPORT PAYMENT BATCH;  [ 07/22/2005  8:27 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**2,5,17**;NOV 05, 2001
 ;;
 Q
VS1 ;EP;TO SYNCRONIZE BETWEEN ARMS PAYEE AND 1166 AFP APPROVALS FOR
 ;PAYMENT ENTRY
 N ACRP0,ACRP11,ACRP14,ACRV0,ACRV11,ACRV14
 Q:'$G(ACRFYDA)!'$G(ACRBATDA)!'$G(ACRSEQDA)
 S ACRDOCDA=+$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,"ARMS"))
 S ACRSEQ0=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0))
 N ACRPVDA,ACRVDA
 S ACRPVDA=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0)),U,10)
 I $G(ACRDOCDA) D
 .D VENDOR^ACRFRR
 .S ACRVDA=$P($G(^ACRDOC(ACRDOCDA,5)),U,5)
 I '$G(ACRDOCDA) D VENDOR
 D VDATA
 D VS2
 Q
VDATA ;DISPLAY ARMS AND 1166 PAYEE DATA
 S ACRP0=$G(^AUTTVNDR(+ACRPVDA,0))
 S ACRP11=$G(^AUTTVNDR(+ACRPVDA,11))
 S ACRP14=$G(^AUTTVNDR(+ACRPVDA,14))
 S ACRV0=$G(^AUTTVNDR(+ACRVDA,0))
 S ACRV11=$G(^AUTTVNDR(+ACRVDA,11))
 S ACRV14=$G(^AUTTVNDR(+ACRVDA,14))
 W @IOF
 W !!,"ARMS PAYEE: ",$P(ACRV0,U),?50,"EIN: ",$P(ACRV11,U,13)
 W !?12,$P(ACRV14,U)
 W !?12,$P(ACRV14,U,2)
 W !?12,$P(ACRV14,U,3),", ",$P($G(^DIC(5,+$P(ACRV14,U,3),0)),U,2),"  ",$P(ACRV14,U,5)
 W !!,"1166 PAYEE: ",$P(ACRP0,U),?50,"EIN: ",$P(ACRP11,U,13)
 W !?12,$P(ACRP14,U)
 W !?12,$P(ACRP14,U,2)
 W !?12,$P(ACRP14,U,3),", ",$P($G(^DIC(5,+$P(ACRP14,U,3),0)),U,2),"  ",$P(ACRP14,U,5)
 W !!,"Payment Sequence NO. ",$P(ACRSEQ0,U)
 W !,"will now be updated with the new Payee information."
 W !
 D PAUSE^ACRFWARN
 Q
VS2 ;SYCHRONIZE BETWEEN ARMS AND 1166
 S DA=ACRSEQDA
 S DA(1)=ACRBATDA
 S DA(2)=ACRFYDA
 S DIE="^AFSLAFP("_DA(2)_",1,"_DA(1)_",1,"
 S X=ACRV11
 S DR="16////"_ACRVDA_";65////"_ACRVDA_";28////"_$P(ACRV14,U,6)_";29////"_$P(ACRV14,U)_";30////"_$P(ACRV14,U,3)_";31////"_$P($G(^DIC(5,+$P(ACRV14,U,4),0)),U,2)_";32////"_$P(ACRV14,U,5)_";33////"_$P(ACRV0,U)_";56////"_$P(X,U,2)_";58////"_$P(X,U)
 D DIE^ACRFDIC
 Q
VSYNC ;EP - REVIEW SELECTED PAYMENTS
 I ACRBTYP="T" D  Q
 .W !!,"This function is not applicable to Travel Batches."
 .D PAUSE^ACRFWARN
 N X
 S ACRXX=ACRY
 F ACRJ=1:1 S X=$P(ACRXX,",",ACRJ) Q:'X!'+$G(^TMP("ACRPAY",$J,+X))!$D(ACRQUIT)  S ACRSEQDA=+^TMP("ACRPAY",$J,X) D VS1 I $P(ACRXX,",",ACRJ+1) D NEXT^ACRFPAY
 K ACRQUIT
 Q
VENDOR ;SELECT VENDOR FOR PAYMENT
 S DIC="^AUTTVNDR("
 S DIC(0)="AEMQZ"
 S DIC("A")="Select VENDOR for this payment: "
 S:ACRPVDA DIC("B")=$P(^AUTTVNDR(ACRPVDA,0),U)
 D DIC^ACRFDIC
 I +Y<1 W !!,"You must select a vendor for this payment." G VENDOR
 S ACRVDA=+Y
 Q
REOPEN ;EP;TO REOPEN CLOSED BATCH
 F  D R1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
R1 S DIC="^AFSLAFP("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which FISCAL YEAR: "
 S DIC("B")=$S($E(DT,4,5)<10:$E(DT,1,3)+1700,1:($E(DT,1,3)+1)+1700)
 S DIC("S")="I $P(^(0),U)=X"
 W !
 D DIC^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 N ACRFYNO,ACRFYDA
 S ACRFYDA=+Y
 S ACRFYNO=$P(Y(0),U)
 F  D R11 Q:$D(ACRQUIT)!$D(ACROUT)
 Q
R11 S DA(1)=ACRFYDA
 S DIC="^AFSLAFP("_ACRFYDA_",1,"
 S DIC(0)="AEMQZ"
 S DIC("A")="REOPEN Which Batch: "
 S DIC("S")="I $P($G(^AFSLAFP(ACRFYDA,1,+Y,2)),U,3)=""C"""
 W !
 D DIC^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S ACRBATDA=+Y
 S ACRBATNO=$P(Y(0),U)
 S DA(1)=ACRFYDA
 S DA=ACRBATDA
 S DIR(0)="YO"
 S DIR("A",1)="Are you certain you want to RE"_$S(+$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2)):"-EXPORT",1:"OPEN")
 S DIR("A")="Batch NO: "_ACRBATNO_" from Fiscal Year "_ACRFYNO
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 D DHR
 W !!,"Batch NO: "_ACRBATNO_" from Fiscal Year "_ACRFYNO
 W !,$S(+$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2)):"Can now be RE-EXPORT'ed.",1:"Is now OPEN for further processing.")
 S DA(1)=ACRFYDA
 S DA=ACRBATDA
 S DIE="^AFSLAFP("_ACRFYDA_",1,"
 I +$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2)),$P($G(^(0)),U,5) S DR="5///@;7///@;4////"_$P($G(^(0)),U,5)
 E  S DR="4///@;5///@;6////O;7///@"
 D DIE^ACRFDIC
 Q
DHR ;ALLOW RE-CREATION OF DHR'S
 S DIR(0)="YO"
 S DIR("A")="Do you need to RE-CREATE the DHR's"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 S ACRSEQDA=0
 F  S ACRSEQDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA)) Q:'ACRSEQDA  D
 .S DA=ACRSEQDA
 .S DA(1)=ACRBATDA
 .S DA(2)=ACRFYDA
 .S DIE="^AFSLAFP("_DA(2)_",1,"_DA(1)_",1,"
 .S DR=".03///@"
 .D DIE^ACRFDIC
 Q
CLOSEB ;EP;CLOSE A BATCH
 D VALCHK^ACRFPAY5
 Q:$D(ACRQUIT)
 S DIR(0)="YO"
 S DIR("A")="Are you certain you want to "_$S('$D(ACRCERT)#2:"CLOSE",1:"CERTIFY")_" this batch"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:+Y'=1
 I $D(ACRCERT)#2 D ^ACRFESIG Q:$D(ACRQUIT)
 S DA=ACRBATDA
 S DA(1)=ACRFYDA
 S DIE="^AFSLAFP("_ACRFYDA_",1,"
 S DR=$S('$D(ACRCERT)#2:"",1:"4////"_DT_";2////"_DUZ_";")_"6////C"
 D DIE^ACRFDIC
 I $D(ACRCERT)#2,'$P(^AFSLAFP(ACRFYDA,1,ACRBATDA,0),U,5) D  Q
 .W !!,"The CERTIFICATION was not applied to BATCH ",ACRBATNO
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 I '$D(ACRCERT)#2,$P(^AFSLAFP(ACRFYDA,1,ACRBATDA,2),U,3)'="C" D  Q
 .W !!,"BATCH NO. ",ACRBATNO," could not be closed."
 .W !,"Someone else may be editing it at this time."
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 Q:$D(ACRQUIT)
 W !!,ACRBATNO," has now been ",$S('$D(ACRCERT)#2:"CLOSED",1:"CERTIFIED"),"."
 D PAIDUP^ACRFPAID
 D PAUSE^ACRFWARN
 S ACRQUIT=""
 Q
DELETE ;EP;DELETE A PAYMENT
 I '$G(ACRMAX) D  Q
 .W !!,"There are no payments to delete."
 .D PAUSE^ACRFWARN
 S DIR(0)="LO^1:"_ACRMAX
 S DIR("A")="DELETE Which PAYMENT(s)"
 W !
 D DIR^ACRFDIC
 I '+Y S ACRQUIT="" Q
 S ACRXX=ACRY
 S DIR("A",1)="Are you ABSOLUTELY CERTAIN you want to DELETE"
 S DIR("A")="payment(s) "_$E(ACRY,1,$L(ACRY)-1)_" from this batch"
 S DIR(0)="YO"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I +Y'=1 S ACRQUIT="" Q
 F ACRJ=1:1 S X=$P(ACRXX,",",ACRJ) Q:'X!'+$G(^TMP("ACRPAY",$J,+X))!$D(ACRQUIT)  S ACRSEQDA=+^TMP("ACRPAY",$J,X) D
 .S DA=ACRSEQDA
 .S DA(1)=ACRBATDA
 .S DA(2)=ACRFYDA
 .S DIK="^AFSLAFP("_DA(2)_",1,"_DA(1)_",1,"
 .D DIK^ACRFDIC
 .I '$D(ACRFY) D                        ;ACR*2.1*5.12
 ..S ACRFY=+^AFSLAFP(ACRFYDA,0)         ;ACR*2.1*5.12
 . D KP^ACRFODOC(ACRFY,ACRDOC,ACRBATNO,$P(ACR0,U)) ;OPEN DOCUMENT INTERFACE
 K ACRQUIT
 Q
ADD ;EP;ADD A NEW BATCH
 N ACRFYDA,ACRFY
 D FY
 Q:$D(ACRQUIT)
 S ACRFYDA=$O(^AFSLAFP("B",ACRFY,0))
 I 'ACRFYDA D  Q:'ACRFYDA
 .S X=ACRFY
 .S DIC="^AFSLAFP("
 .S DIC(0)="L"
 .D FILE^ACRFDIC
 .S ACRFYDA=+Y
 S DIR(0)="FO^6:6^I X?6N"
 S DIR("A")="Batch Number..."
 D DIR^ACRFDIC
 I X'?6UN S ACRQUIT="" Q
 S ACRBATNO=X
 D BNCHK
 Q:$D(ACRQUIT)
 I '$D(ACRBATNO) G ADD
 S DIR(0)="SOA^1:VENDOR Payment;2:TRAVEL Payment"
 S DIR("A")="Batch Type.....: "
 D DIR^ACRFDIC
 I '+Y S ACRQUIT="" Q
 S ACRBTYP=$S(+Y=1:"V",1:"T")
 ;S DIR(0)="SOA^1:ACH-Grouped;2:ACH NON-Grouped;3:Check-Grouped;4:NO-Check (DHR-ONLY);5:Check-Not Grouped" ;ACR*2.1*2.1;ACR*2.1*17.13 IM17827
 S DIR(0)="SOA^2:ACH NON-Grouped;3:Check-Grouped;4:NO-Check (DHR-ONLY);5:Check-Not Grouped" ;ACR*2.1*2.1;ACR*2.1*17.13 IM17827
 S DIR("A")="Type of Payment: "
 D DIR^ACRFDIC
 I '+Y S ACRQUIT="" Q
 ;S ACRACH=$S(+Y=1:"A",+Y=2:"B",+Y=3:"C",+Y=5:"N",1:"G")   ;ACR*2.1*17.13 IM17827
 S ACRACH=$S(+Y=1:"B",+Y=2:"B",+Y=3:"C",+Y=5:"N",1:"G")    ;ACR*2.1*17.13 IM17827
 W !!?10,"FISCAL YEAR.: ",ACRFY
 W !?10,"BATCH NUMBER: ",ACRBATNO
 W !?10,"BATCH TYPE..: ",$S(ACRBTYP="V":"Vendor Payment",1:"Travel Payment")
 ;W !?10,"PAYMENT TYPE: ",$S("AD"[ACRACH:"ACH Grouped","BE"[ACRACH:"ACH NON-Grouped","CF"[ACRACH:"Check-Grouped","NO"[ACRACH:"Check-Not Grouped",ACRACH="G":"NO-Check (DHR-ONLY)",1:"") ;ACR*2.1*2.1;ACR*2.1*17.13 IM17827
 W !?10,"PAYMENT TYPE: ",$S("BE"[ACRACH:"ACH NON-Grouped","CF"[ACRACH:"Check-Grouped","NO"[ACRACH:"Check-Not Grouped",ACRACH="G":"NO-Check (DHR-ONLY)",1:"") ;ACR*2.1*2.1;ACR*2.1*17.13 IM17827
 S DIR(0)="YO"
 S DIR("A")="Create NEW BATCH"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I +Y'=1 S ACRQUIT="" Q
 S X=ACRBATNO
 S DA(1)=ACRFYDA
 S DIC="^AFSLAFP("_ACRFYDA_",1,"
 S:'$D(^AFSLAFP(ACRFYDA,1,0)) ^(0)="^9002325.01"
 S DIC(0)="L"
 S DIC("DR")=".04////"_$G(ACRBTYP)_";1////"_DT_";6////O;8////"_DUZ_";22////"_ACRACH
 D FILE^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S (ACRBATDA,DA)=+Y
 S DA(1)=ACRFYDA
 S DIE=9002325
 S DDSFILE(1)=9002325.01
 S DR="[ACR BATCH]"
 D DDS^ACRFDIC
 D AP^ACRFPAY
 Q
BNCHK ;BATCH NUMBER CHECK TO ENSURE NO DUPLICATE NUMBERS
 I $D(^AFSLAFP("L",ACRBATNO,ACRFYDA)) D
 .W !!,"Batch NO. ",@ACRON,ACRBATNO,@ACROF," has already been used."
 .W !,"Please select another batch number."
 .D PAUSE^ACRFWARN
 .K ACRBATNO
 Q
FY ;EP;
 S DIR(0)="NO^1000:9999"
 S DIR("B")=$S($E(DT,4,5)>9:($E(DT,1,3)+1)+1700,1:$E(DT,1,3)+1700)
 S DIR("A")="Fiscal Year...."
 W !
 D DIR^ACRFDIC
 I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S ACRQUIT=""
 Q:$D(ACRQUIT)
 S ACRFY=X
 Q