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

ACRFPAYR.m

Go to the documentation of this file.
ACRFPAYR ;IHS/OIRM/DSD/THL,AEF - INTEREST PENALY REPORT;  [ 07/23/2002  2:22 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3**;NOV 05, 2001
 ;;
IPPR ;EP;TO SET UP PRINT OF INTEREST REPORT
 D IPEN
IPEXIT K ACRDATE,ACRBEGIN,ACREND,ACRFYDA,ACRBATDA,ACRSEQDA,ACRFY,ACRBATNO,ACRSEQNO,ACRQUIT,ACROUT,ACRFR,ACRTO,ACRRTN,ACRT1,ACRT2,ACRJ
 Q
IPEN W @IOF
 W !?10,"Interest Payment Report"
 S DIR(0)="NO^1000:9999"
 S DIR("A",1)="Report for"
 S DIR("A")="FISCAL YEAR..."
 S DIR("B")=$S($E(DT,4,5)<10:$E(DT,1,3)+1700,1:($E(DT,1,3)+1)+1700)
 W !!
 D DIR^ACRFDIC
 I $L(Y)'=4 S ACRQUIT="" Q
 S ACRFY=Y
 S ACRFYDA=$O(^AFSLAFP("B",Y,0))
 I 'ACRFYDA D  Q
 .W !!,"FISCAL YEAR ",Y," NOT FOUND."
 .D PAUSE^ACRFWARN
IDATES D DATES^ACRFDATE
 I '$G(ACRBEGIN) S ACRQUIT="" Q
 I '$G(ACREND) W !,"Both BEGINNING and ENDING dates required." G IDATES
IPAMT ;SPECIFY DOLLAR AMOUNT RANGE
 S DIR(0)="NOA^1:99999999:2"
 S DIR("A",1)="Interest"
 S DIR("A")="Amount From...: "
 S DIR("B")="1.00"
 D DIR^ACRFDIC
 I Y<1 S ACRQUIT="" Q
 S ACRFR=Y-1
 S DIR(0)="NOA^1:99999999:2"
 S DIR("A")="Interest"
 S DIR("A")="Amount To.....: "
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)
 I Y<1 D  K ACRQUIT,ACROUT G IPAMT
 S ACRTO=Y+1
 S (ZTRTN,ACRRTN)="IP^ACRFPAYR"
 S ZTDESC="Payment Management Interest Penalty Report"
 D ^ACRFZIS
 Q
IP ;EP;TO PRINT INTEREST PENALTY REPORT
 D IPH
 D IPDATA
 Q
IPH ;HEADER
 W @IOF
 W !?10,"INTEREST PENALTY REPORT"
 W !?10,"-----------------------"
 W !?10,"FISCAL YEAR: ",ACRFY
 W !?10,"REPORT FROM: "
 S Y=ACRBEGIN
 X ^DD("DD")
 W Y
 W !?10,"REPORT TO..: "
 S Y=ACREND
 X ^DD("DD")
 W Y
 W !?10,"REPORT DATE: "
 S Y=DT
 X ^DD("DD")
 W Y
L1 W !,"--------------------------------------------------------------------------------"
 Q
IPDATA ;FIND RECORDS TO INCLUDE
 N ACRDATE,ACROBJDA
 S ACROBJDA=$O(^AUTTOBJC("B","4319 ",0))
 Q:'ACROBJDA
 S (ACRT1,ACRT2,ACRJ)=0
 S ACRDATE=ACRBEGIN-1
 F  S ACRDATE=$O(^AFSLAFP(ACRFYDA,1,"E",ACRDATE)) Q:'ACRDATE!$D(ACRQUIT)!(ACRDATE>ACREND)  D
 .S ACRBATDA=0
 .F  S ACRBATDA=$O(^AFSLAFP(ACRFYDA,1,"E",ACRDATE,ACRBATDA)) Q:'ACRBATDA  D
 ..D IPGET
 D L1
 W !,?35,"TOTAL PAYMENTS: ",$J($FN(ACRT2,"P,",2),14)
 W !,?35,"TOTAL INTEREST: ",$J($FN(ACRT1,"P,",2),14)
 W !,?35,"TOTAL DOCUMENTS "
 W !,?35,"WITH INTEREST.: ",$J(ACRJ,13)
 D PAUSE^ACRFWARN
 Q
IPGET ;
 S ACRSEQDA=0
 F  S ACRSEQDA=$O(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA)) Q:'ACRSEQDA!$D(ACRQUIT)  I $P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,0)),U,8)=ACROBJDA,$P(^(0),U,11)>ACRFR,$P(^(0),U,11)<ACRTO D
 .S ACRBATNO=$P(^AFSLAFP(ACRFYDA,1,ACRBATDA,0),U)
 .N W,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))
 .S W=$G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA-1,0))
 .S:$P(X,U,20)'=$P(W,U,20)!($P(W,U,8)=ACROBJDA) W=""
 .D IPDISP
 .S ACRJ=ACRJ+1
 .I IOSL-8<$Y D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D IPH
 Q
IPDISP ;DISPLAY EACH INTEREST PENALTY
 W !!,"FY......: ",ACRFY,?22,"BATCH NO.: ",ACRBATNO
 W !,"DOCUMENT: ",$P(W,U,20),?22,"REF CODE.: ",$P(W,U,5),?41,"SEQ. NO.: ",$P(W,U),?57,"GRS. PMT: ",$J($FN($P(W,U,11),"P,",2),10)
 W !,"DOCUMENT: ",$P(X,U,20),?22,"REF CODE.: ",$P(X,U,6),?41,"SEQ. NO.: ",$P(X,U),?57,"INT. PMT: ",$J($FN($P(X,U,11),"P,",2),10)
 W !,"VENDOR..: ",$E($P($G(^AUTTVNDR(+$P(X,U,10),0)),U),1,20)
 W !,"PAID FOR: ",$P(X,U,14)
 W !,"CAN.....: ",$P($G(^AUTTCAN(+$P(X,U,7),0)),U),?22,"OBJECT CD: ",$P($G(^AUTTOBJC(+$P(X,U,8),0)),U),?41,"FED CODE: ",$P(X,U,15),?57,"PIG-P/F.: ",$P(Y,U,19),?71,"WKLD: ",$P(X,U,17)
 S ACRT1=ACRT1+$P(X,U,11)
 S ACRT2=ACRT2+$P(W,U,11)
 Q
CENTER(X) ;CENTER HEADER INFO
 W !?80-$L(X)/2,X
 Q
PORR ;EP;TO SETUP PRINT OF THE PURCHASE ORDER OR RECEIVING REPORT
 N ACRXX,ACRXXX
 K ACRQUIT
 D WHICHP^ACRFPAY6
 Q:$D(ACRQUIT)
 S ACRXX=ACRY
 I ACRBTYP="T" S ACRXXX=4 D ZIS Q
 S DIR(0)="SO^1:Purchase Order;2:Receiving Report;3:PO and Receiving Report"
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 Q:+Y<1
 S ACRXXX=Y
 I ACRXXX>1 D RRNO
 D ZIS
 Q
ZIS ;SELECT OUTPUT DEVICE
 S:'$D(ZTRTN) (ZTRTN,ACRRTN)="PORR1^ACRFPAYR"
 S:'$D(ZTDESC) ZTDESC="Print payment source document"
 D ^ACRFZIS
 Q
PORR1 ;EP;TO PRINT PO AND/OR RECEIVING REPORT
 N X,ACRJ,ACRSEQDA,ACRDOCDA,ACRRRNO
 F ACRJ=1:1 S X=$P(ACRXX,",",ACRJ) Q:'X  D:+$G(^TMP("ACRPAY",$J,X))
 .D SETDOC
 .Q:'ACRDOCDA
 .I ACRXXX=4 D PO Q
 .I ACRXXX=1 D PO Q
 .I ACRXXX=2 D RR Q
 .D PO
 .D RR
 Q
PO D ^ACRFQ
 Q
RR S ACRRRNO=$G(ACRRR(X))
 Q:'ACRRRNO
 S ACRREFX=499
 D ^ACRFQ
 Q
SETDOC ;
 S ACRSEQDA=+^TMP("ACRPAY",$J,X)
 Q:'ACRSEQDA
 S ACRDOCDA=$P($G(^AFSLAFP(ACRFYDA,1,ACRBATDA,1,ACRSEQDA,"ARMS")),U) ;ACR*2.1*3.2
 Q:'ACRDOCDA
 D SETDOC^ACRFEA1
 S ACRREFDA=$P(^ACRDOC(ACRDOCDA,0),U,13)
 S (ACRREF,ACRREFX)=$P($G(^AUTTDOCR(+ACRREFDA,0)),U)
 Q
RRNO ;SELECT RECEIVING REPORT NUMBER FOR EACH DOCUMENT
 N ACRX,ACRJ,ACRSEQDA,ACRDOCDA
 F ACRJ=1:1 S ACRX=$P(ACRXX,",",ACRJ) Q:'ACRX  D:+$G(^TMP("ACRPAY",$J,ACRX))
 .S X=ACRX
 .D SETDOC
 .Q:'$G(ACRDOCDA)
 .D RRNO^ACRFRRPT
 .Q:'$G(ACRRRNO)
 .S ACRRR(ACRX)=ACRRRNO
 Q