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

ACRFPAY7.m

Go to the documentation of this file.
ACRFPAY7 ;IHS/OIRM/DSD/THL,AEF - CERTIFY AND EXPORT PAYMENT BATCH;  [ 09/23/2005  9:50 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,5,17,19**;NOV 05, 2001
 ;;
CASHREC ;EP;CASH RECONCILIAITON REPORT
 D CREXIT
 W !
 D ^ACRFDATE
 Q:$D(ACRQUIT)!$D(ACROUT)
 Q:'$G(ACRBEGIN)!'$G(ACREND)
 S (ACRRTN,ZTRTN)="CR^ACRFPAY7"
 S ZTDESC="CASH RECONCILATION REPORT"
 D ^ACRFZIS
CREXIT K ACR,ACRQUIT,ACROUT,ACRBEGIN,ACREND,ACRJ,ACRTOT,ACRSCHD,ACRFYDA,ACRBATDA,ACRSEQDA,ACR
 K ^TMP("ACRCR",$J)
 Q
CR ;EP;TO PRINT CASH RECONCILIATION REPORT
 D CR1
 D CREXIT
 Q
CR1 D CRHEAD
 S ACR=ACRBEGIN-.1
 F  S ACR=$O(^AFSLAFP("EXP",ACR)) Q:'ACR!(ACR>ACREND)  D
 .N X,Y,Z
 .S X=0
 .F  S X=$O(^AFSLAFP("EXP",ACR,X)) Q:'X  D
 ..S Y=0
 ..F  S Y=$O(^AFSLAFP("EXP",ACR,X,Y)) Q:'Y  D
 ...S Z=$$BATCH^ACRFPAYE(X,Y)                ;ACR*2.1*5.02
 ...Q:Z="G"   ;ACR*2.1*5.02
 ...S Z=$G(^AFSLAFP(X,1,Y,2))
 ...Q:$P(Z,U,6)=""
 ...S ^TMP("ACRCR",$J,$P(Z,U,6),X,Y)=""
 S (ACRTOT,ACRJ)=0
 S ACRSCHD=""
 F  S ACRSCHD=$O(^TMP("ACRCR",$J,ACRSCHD)) Q:ACRSCHD=""!$D(ACRQUIT)  D
 .S ACRFYDA=0
 .F  S ACRFYDA=$O(^TMP("ACRCR",$J,ACRSCHD,ACRFYDA)) Q:'ACRFYDA!$D(ACRQUIT)  D
 ..S ACRBATDA=0
 ..F  S ACRBATDA=$O(^TMP("ACRCR",$J,ACRSCHD,ACRFYDA,ACRBATDA)) Q:'ACRBATDA!$D(ACRQUIT)  D
 ...W !,ACRSCHD
 ...W ?14,$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,0)),U)
 ...S Y=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2)),U)
 ...X ^DD("DD")
 ...W ?24,Y
 ...S ACRJ=ACRJ+1
 ...S (ACRSEQDA,X)=0
 ...F  S ACRSEQDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA)) Q:'ACRSEQDA  D
 ....S Y=$$NET^ACRFSSU(ACRFYDA,ACRBATDA,ACRSEQDA)   ;ACR*2.1*5.02
 ....S X=X+Y
 ....S ACRTOT=ACRTOT+Y
 ...W ?64,$J($FN(X,"P,",2),15)
 ...I $Y+4>IOSL D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D CRHEAD
 W $$DASH^ACRFMENU
 W !,"TOTAL",?24,"COUNT: ",ACRJ,?64,$J($FN(ACRTOT,"P,",2),15)
 D PAUSE^ACRFWARN
 Q
CRHEAD ;CASH RECONCILIATION HEADER
 W @IOF
 W $$DASH^ACRFMENU
 W !?20,"Export listing for comparison with the"
 W !?20,"Treasury Confirmation Report"
 S Y=DT
 X ^DD("DD")
 W !?20,"Report Date.....: ",Y
 S Y=ACRBEGIN
 X ^DD("DD")
 W !?20,"Report Period FR: ",Y
 S Y=ACREND
 X ^DD("DD")
 W !?20,"Report Period TO: ",Y
 W $$DASH^ACRFMENU
 W !,"SCHEDULE",?14,"BATCH",?24,"EXPORT",?72,"NET"
 W !,"NUMBER",?14,"NUMBER",?24,"DATE",?72,"AMOUNT"
 W $$DASH^ACRFMENU
 Q
APPROP ;EP;FOR APPROPRIATION REPORTS
 D APPEXIT
 F  D APP1 Q:$D(ACRQUIT)!$D(ACROUT)
APPEXIT K ACROUT,ACRQUIT,ACR1,ACR1A,ACR2,ACR2A,ACRX,ACRXREF,ACRAPP,ACRFY,ACR,ACRDC,ACRFYDA,ACRBATDA,ACRSEQDA
 K ^TMP("ACRAPPRP",$J)
 Q
APP1 W @IOF
 W !!?10,"Appropriation Report"
 S DIR(0)="SO^1:Sort by Batch within Appropriation;2:Sort by Schedule within Appropriation;3:Sort by Appropriation within Schedule"
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!'Y S ACRQUIT="" Q
 I X=1 S ACR1="APPROPRIATION",ACR2="BATCH",ACRXREF="PROBAT"
 I X=2 S ACR1="APPROPRIATION",ACR2="SCHEDULE",ACRXREF="PROSCH"
 I X=3 S ACR1="SCHEDULE",ACR2="APPROPRIATION",ACRXREF="SCHPRO"
 K ACRFYDA,ACRBATDA,ACRSEQDA
 D FYBAT^ACRFPAY2
 Q:$D(ACROUT)
 I '$G(ACRBATDA) S (ACRBATNO,ACRBATDA)=""
 N ACRBATDX
 S ACRBATDX=ACRBATDA
 S ACRBATDA=ACRBATDA-1
 D APP
 Q:$D(ACRQUIT)   ;ACR*2.1*3.17
 S (ZTRTN,ACRRTN)="PAPP^ACRFPAY7"
 S ZTDESC="PAYMENT APPROPRIATION REPORT"
 D ^ACRFZIS
 Q
APP ;SELECT APPROPRIATION SORT RANGE
 S DIC="^AUTTPRO("
 S DIC(0)="AEMQZ"
 S DIC("A")="Report for which APPROPRIATION: "
 W !!,"Select an APPROPRIATION NO. to report for ONE Appropriation"
 W !,"Press <ENTER> to report for all APPROPRIATIONs."
 W !
 D DIC^ACRFDIC
 I X["^" S ACRQUIT="" Q
 S ACRAPP=$P(Y,U,2)
 I ACR1="APPROPRIATION" S ACR1A=ACRAPP
 E  S ACR1A=""
 S:ACRAPP]"" ACRAPP=$O(^AUTTPRO("B",ACRAPP),-1)
 Q
PAPP ;EP;TO PRINT APPROPRIATION REPORTS
 K ^TMP("ACRAPPRP",$J)
 D PAPPHEAD
 S ACRBATDA=0
 F  S ACRBATDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA)) Q:'ACRBATDA!(ACRBATDX&(ACRBATDA'=ACRBATDX))  D
 .N ACRBAT   ;ACR*2.1*5.02
 .S ACRBAT=$$BATCH^ACRFPAYE(ACRFYDA,ACRBATDA)   ;ACR*2.1*5.02
 .Q:ACRBAT="G"                                  ;ACR*2.1*5.02
 .Q:ACRBAT=""                                   ;ACR*2.1*5.02
 .S ACRSEQDA=0
 .F  S ACRSEQDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA)) Q:'ACRSEQDA  D
 ..N X,Y,Z
 ..S X=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,0)),U)
 ..S Y=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,1))
 ..S Z=$P(Y,U,21)
 ..Q:X=""!(Y="")!(Z="")                           ;ACR*2.1*5.02
 ..S Y=$$NET^ACRFSSU(ACRFYDA,ACRBATDA,ACRSEQDA)   ;ACR*2.1*5.02
 ..I ACR1="APPROPRIATION",ACR2="BATCH" S ACR1X=Z,ACR2X=X
 ..I ACR1="APPROPRIATION",ACR2="SCHEDULE" S ACR1X=Z,ACR2X=Y
 ..I ACR1="SCHEDULE",ACR2="APPROPRIATION" S ACR1X=Y,ACR2X=Z
 ..S ^TMP("ACRAPPRP",$J,ACR1X,ACR2X,ACRFYDA,ACRBATDA,ACRSEQDA)=""
 S ACR1X=""
 F  S ACR1X=$O(^TMP("ACRAPPRP",$J,ACR1X)) Q:ACR1X=""!$D(ACRQUIT)  D:ACR1X[ACR1A
 .W !!,"FISCAL YEAR",?15,": ",ACRFY
 .W !,ACR1,?15,": ",ACR1X
 .N ACR1TOT
 .S ACR1TOT=0
 .S ACR2X=""
 .F  S ACR2X=$O(^TMP("ACRAPPRP",$J,ACR1X,ACR2X)) Q:ACR2X=""!$D(ACRQUIT)  D
 ..W !,ACR2,?15,": ",ACR2X,!
 ..S ACRBATDA=0
 ..F  S ACRBATDA=$O(^TMP("ACRAPPRP",$J,ACR1X,ACR2X,ACRFYDA,ACRBATDA)) Q:'ACRBATDA!$D(ACRQUIT)  D
 ...S ACRBATNO=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,0)),U)
 ...S ACRSEQDA=0
 ...F  S ACRSEQDA=$O(^TMP("ACRAPPRP",$J,ACR1X,ACR2X,ACRFYDA,ACRBATDA,ACRSEQDA)) Q:'ACRSEQDA!$D(ACRQUIT)  D
 ....D PDISP
 ....I $Y+5>IOSL D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D PAPPHEAD:$O(^TMP("ACRAPPRP",$J,ACR1X,ACR2X,ACRFYDA,ACRBATDA,ACRSEQDA))
 ....I '$O(^TMP("ACRAPPRP",$J,ACR1X,ACR2X,ACRFYDA,ACRBATDA,ACRSEQDA)) D PAUSE^ACRFWARN
 ...D APPSUM^ACRFPAY8
 ..W $$DASH^ACRFMENU
 D PAUSE^ACRFWARN
 W @IOF
 K ^TMP("ACRAPPRP",$J)
 Q
PAPPHEAD ;HEADER FOR APPROPRIATION REPORT
 W @IOF
 S ACRDC=$G(ACRDC)+1
 W !?10,"Appropriation Report",?60,"PAGE ",ACRDC
 W !?10,"Report Date: "
 S Y=DT
 X ^DD("DD")
 W Y
 W !?10,"Sort by....: ",ACR1
 W !?10,"Then by....: ",ACR2
 W $$DASH^ACRFMENU
 Q
PDISP ;APPROPRIATION DISPLAY
 N X,Y,Z,XT
 S X=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0))
 S Y=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,1))
 S Z=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,2))
 S XT=$$NET^ACRFSSU(ACRFYDA,ACRBATDA,ACRSEQDA)   ;ACR*2.1*5.02
 S ACR1TOT=ACR1TOT+XT                            ;ACR*2.1*5.02
 W !,$P(X,U),?5,$P(X,U,20),?16,$P(X,U,5),?20,$P(X,U,21),?31,$P(X,U,6)   ;ACR*2.1*5.02
 W ?35,ACRBATNO,?42,$P(Y,U,11)                   ;ACR*2.1*5.02
 W ?50,$J($FN(XT,"P,",2),15)                     ;ACR*2.1*5.02
 W !?5,$P($G(^AUTTCAN(+$P(X,U,7),0)),U),?13,$P($G(^AUTTOBJC(+$P(X,U,8),0)),U),?18,$P(X,U,15),?20,$P(Y,U,19),?22,$P(X,U,17),?27,$P(X,U,18)
 I $P(X,U,10) W ?50,$P($G(^AUTTVNDR(+$P(X,U,10),0)),U)
 ;E  I $P(X,U,24) W ?50,$P($G(^VA(200,+$P(X,U,24),0)),U)  ;ACR*2.1*19.02 IM16848
 E  I $P(X,U,24) W ?50,$$NAME2^ACRFUTL1(+$P(X,U,24))  ;ACR*2.1*19.02 IM16848
 W !?5,$P(Z,U,14)
 Q
PBDISP ;EP;BATCH DISPLAY
 K ACRAPPN
 D PBHEAD
 S ACRSEQDA=0
 F  S ACRSEQDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA)) Q:'ACRSEQDA!$D(ACRQUIT)  D
 .N X
 .S X=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0))
 .Q:'$P(X,U,10)&'$P(X,U,24)
 .I $P(X,U,10) S X=$P($G(^AUTTVNDR($P(X,U,10),0)),U)
 .;E  S:$P(X,U,24) X=$P($G(^VA(200,$P(X,U,24),0)),U)  ;ACR*2.1*19.02 IM16848
 .E  S:$P(X,U,24) X=$$NAME2^ACRFUTL1($P(X,U,24))  ;ACR*2.1*19.02 IM16848
 .Q:X=""
 .S ^TMP("ACRPBAT",$J,ACRFYDA,ACRBATDA,X,ACRSEQDA)=""
 N ACRX
 S ACRX=""
 F  S ACRX=$O(^TMP("ACRPBAT",$J,ACRFYDA,ACRBATDA,ACRX)) Q:ACRX=""!$D(ACRQUIT)  D
 .S ACRSEQDA=0
 .F  S ACRSEQDA=$O(^TMP("ACRPBAT",$J,ACRFYDA,ACRBATDA,ACRX,ACRSEQDA)) Q:'ACRSEQDA!$D(ACRQUIT)  D PBD1
 D APPSUM^ACRFPAY8
 Q
PBD1 ;EP; TO DISPLAY BATCH PAYMENT SUMMARY
 N ACRACH,X,Y,Z
 S X=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0))
 S Y=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,1))
 S Z=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,2))
 W !,"DOCUMENT #: ",$P(X,U,5)," ",$P(X,U,20)
 W ?30,"CAN....: ",$P($G(^AUTTCAN(+$P(X,U,7),0)),U)
 W ?60,"OBJECT CODE: ",$P($G(^AUTTOBJC(+$P(X,U,8),0)),U)
 W !,"OTHER DOC.: ",$P(X,U,6)," ",$P(X,U,21)
 W ?30,"FORM #.: "
 W ?60,"FED/NONFED.: ",$P(X,U,15)
 I $P(X,U,10) D  I 1
 .W !,"PAYEE.....: "
 .W ?12,$P($G(^AUTTVNDR(+$P(X,U,10),0)),U)
 .W ?60,"EIN: ",$P($G(^AUTTVNDR(+$P(X,U,10),11)),U,13)
 .W !,"REMIT ADDR: "
 .W ?12,$P(X,U,28)
 .W !,"(PAYMENT",?12,$P(Y,U)," ",$P(Y,U,2),"  ",$P(Y,U,3)
 .W !,"RECORD)",?12,"ATTN: ",$P(X,U,25)
 .N ACRX,ACRY,ACRZ
 .S ACRX=$G(^AUTTVNDR(+$P(X,U,10),13))
 .S ACRY=$G(^AUTTVNDR(+$P(X,U,10),14))
 .S ACRZ=$G(^AUTTVNDR(+$P(X,U,10),19))
 .I $P(ACRZ,U)]"",$S($D(^XUSEC("ACRFZ EDIT EFT",DUZ)):1,$D(^XUSEC("ACRFZ VIEW EFT",DUZ)):1,1:0) W !?12,$P(ACRZ,U),"/",$P(ACRZ,U,2),"/",$P(ACRZ,U,3)
 .W !,"REMIT ADDR: "
 .W ?12,$P(ACRY,U)
 .W:$P(ACRY,U,2)]"" !?12,$P(ACRY,U,2)
 .W !,"(VENDOR",?12,$P(ACRY,U,3)," ",$P($G(^DIC(5,+$P(ACRY,U,4),0)),U,2),"  ",$P(ACRY,U,5)
 .W !,"FILE)",?12,"ATTN: ",$P(ACRY,U,6)
 .W !,"MAIL ADDR.: "
 .W ?12,$P(ACRX,U)
 .W:$P(ACRX,U,10)]"" !?12,$P(ACRX,U,10)
 .W !?12,$P(ACRX,U,2)," ",$P($G(^DIC(5,+$P(ACRX,U,3),0)),U,2),"  ",$P(ACRX,U,4)
 .W !?12,"ATTN: ",$P(ACRX,U,5)
 E  I $P(X,U,24) D
 .W !,"PAYEE.....: "
 .;W ?12,$P($G(^VA(200,+$P(X,U,24),0)),U)  ;ACR*2.1*19.02 IM16848
 .W ?12,$$NAME2^ACRFUTL1(+$P(X,U,24))  ;ACR*2.1*19.02 IM16848
 .S ACRZ=$G(^ACRAU(+$P(X,U,24),19))
 .I $P(ACRZ,U)]"",$S($D(^XUSEC("ACRFZ EDIT EFT",DUZ)):1,$D(^XUSEC("ACRFZ VIEW EFT",DUZ)):1,1:0) W !?12,$P(ACRZ,U),"/",$P(ACRZ,U,2),"/",$P(ACRZ,U,3)
 ;W !,"ACCT TECH.: ",$P($G(^VA(200,+$P(X,U,3),0)),U)  ;ACR*2.1*19.02 IM16848
 W !,"ACCT TECH.: ",$$NAME2^ACRFUTL1(+$P(X,U,3))  ;ACR*2.1*19.02 IM16848
 S ACRACH=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,2)),U,8)
 ;W !,$S(ACRACH="C"!(ACRACH="N"):"PAID FOR..: ",1:"ACH ADDEN.: ") ;ACR*2.1*17.05 IM17132 
 ;W:$P(Z,U,14)]"" $P(Z,U,14)," "              ;ACR*2.1*17.05 IM17132
 ;W:$L($P(Z,U,2))>1 $P(Z,U,2)                 ;ACR*2.1*17.05 IM17132
 I "NCG"[ACRACH W !,"PAID FOR..: ",$P(Z,U,14) ;ACR*2.1*17.05 IM17132
 I "AB"[ACRACH W !,"ACH ADDEN.: ",$P(Z,U,2)   ;ACR*2.1*17.05 IM17132
 S ACRBTYP=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,0)),U,4)
 N XT                                            ;ACR*2.1*5.02
 S XT=$$NET^ACRFSSU(ACRFYDA,ACRBATDA,ACRSEQDA)   ;ACR*2.1*5.02
 W !,"PAY AMOUNT: ",$J($FN(XT,"P,",2),15)        ;ACR*2.1*5.02
 W ?30,"FULL/PART: "
 ;W ?60,"INT SEQ.: ",$P(Y,U,5)               ;ACR*2.1*17.11 IM17514
 W ?59,"INT SEQ.: ",$P(Y,U,5)                ;ACR*2.1*17.11 IM17514
 W !,"TRANS CODE: ",$P(X,U,18)
 W ?30,"OTH TR CD: ",$P(X,U,19)
 ;W ?60,"INT $AMT: ",$P(Y,U,6)                 ;ACR*2.1*17.11 IM17514
 W ?59,"INT $AMT: ",$P(Y,U,6)                  ;ACR*2.1*17.11 IM17514
 W !,"SCHED NO..: ",$P(Y,U,11)
 W ?30,"PP-DUE...: "
 ;W ?60,"INT DOC.: ",$P(Y,U,8)                 ;ACR*2.1*17.11 IM17514
 W ?59,"INT DOC.: ",$P(Y,U,8)                  ;ACR*2.1*17.11 IM17514
 W !,"APPROPRTN.: ",$P(Y,U,21)
 W $$DASH^ACRFMENU
 I $Y+10>IOSL D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D PBHEAD:$O(^TMP("ACRPBAT",$J,ACRFYDA,ACRBATDA,ACRX,ACRSEQDA))!($O(^TMP("ACRPBAT",$J,ACRFYDA,ACRBATDA,ACRX))]"")
 Q
PBAT ;EP;TO PRINT BATCH PAYMENT LISTING
 D PBEXIT
 F  D PB1 Q:$D(ACRQUIT)!$D(ACROUT)
PBEXIT K ACROUT,ACRQUIT,ACR1,ACR1A,ACR2,ACR2A,ACRX,ACRXREF,ACRAPP,ACRFY,ACR,ACRDC,ACRFYDA,ACRBATDA,ACRSEQDA
 Q
PB1 W @IOF
 W !!?10,"Batch Payment Listing"
 K ACRFYDA,ACRBATDA,ACRSEQDA
 D FYBAT^ACRFPAY2
 I '$G(ACRFYDA)!'$G(ACRBATDA) S ACRQUIT="" Q
 Q:'$G(ACRBATDA)
 S (ZTRTN,ACRRTN)="PBDISP^ACRFPAY7"
 S ZTDESC="BATCH PAYMENT LISTING"
 D ^ACRFZIS
 Q
PBHEAD ;EP;HEADER
 W @IOF
 S ACRDC=$G(ACRDC)+1
 W !?10,"Batch Payment Listing",?60,"PAGE: ",ACRDC
 W !?10,"Report Date: "
 S Y=DT
 X ^DD("DD")
 W Y
 W !?10,"Fiscal Year: ",$P(^AFSLAFP(ACRFYDA,0),U)
 W !?10,"Batch......: ",ACRBATNO
 W $$DASH^ACRFMENU
 Q