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

ACRFPAPV.m

Go to the documentation of this file.
ACRFPAPV ;IHS/OIRM/DSD/THL,AEF - PRINT APPROVALS ON REQUESTS;  [ 10/27/2006   4:15 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**14,19,21**;NOV 05, 2001
 ;;ROUTINE TO PRINT APPROVALS AND TO DISPLAY STATUS OF A REQUEST
EN ;EP;
 Q:$D(ACROUT)
 I "^116^204^103^349^326^210^"[(U_ACRREFX_U),'$D(^ACRSS("J",ACRDOCDA)) D CONSOL^ACRFPAP1 Q
 N ACRX,ACRY,ACRJ,D0
 S:$D(ACRDOCDA) D0=ACRDOCDA
 D EN1
 I $E(IOST,1,2)="C-",'$D(ACRREF)!$D(ACRCOMP)!$D(ACRPRT)!$D(ACRPO)!$D(ACRREV)!$D(ACRCSI) D PAUSE^ACRFWARN
EXIT K ACRZ,Y,ACRCT,ACRSTATS
 Q
EN1 N ACRPHEAD
 S (ACRPHEAD,ACRX)=0
 I $P(^ACRDOC(ACRDOCDA,0),U,19) N ACRREFX S ACRREFX=116
 S ACRREFDA=$O(^AUTTDOCR("B",$S(ACRREF'=210:ACRREFX,1:ACRREF),0))
 I ACRREF=210,$D(ACRREQST)!(ACRREFX=116) D
 .S ACRREFDA=$O(^AUTTDOCR("B",116,0))
 .S ACRREFX=116
 I '$D(ACRORIGF) D
 .F  S ACRX=$O(^ACRAPVS("AB",D0,ACRX)) Q:'ACRX  I $P(^ACRAPVS(ACRX,0),U,6)=ACRREFDA!($P($G(ACRDOC0),U,4)=35) S ACRPHEAD=ACRPHEAD+1
 .D PHEAD^ACRFSS12:'$D(ACRORIGF)
 I '$D(ACRPPO),ACRREFX'=148,'$D(ACRCSI),$E($G(IOST),1,2)="C-",'$D(ACRREV) W @IOF
 W !
 D:'$D(ACRPSC) B1
 W:ACRREF'=148&'$D(ACRPSC) "------------------------------------------------------------------------------"
 W:ACRREF=148 "----------------------  SECTION D - CLEARANCE ACTION  ------------------------"
 D:'$D(ACRPSC) B1
 S ACRREFDA=$O(^AUTTDOCR("B",$S(ACRREF'=210:ACRREFX,1:ACRREF),0))
 I ACRREF=210,$D(ACRREQST)!(ACRREFX=116) D
 .S ACRREFDA=$O(^AUTTDOCR("B",116,0))
 .S ACRREFX=116
 I "^103^349^326^210^"[(U_ACRREFX_U),'$D(ACRREV),'$D(ACRPRT),$D(^ACROBL(ACRDOCDA,"APV")),$P(^("APV"),U,6) D
 .W !,$S($P(^ACROBL(ACRDOCDA,"APV"),U,6)=1:"FINAL",1:"PARTIAL")," RECEIVING REPORT COMPLETED" Q
 S (ACRX,ACRJ)=0
 F  S ACRX=$O(^ACRAPVS("AB",D0,ACRX)) Q:'ACRX  I $P(^ACRAPVS(ACRX,0),U,6)=ACRREFDA!($P($G(ACRDOC0),U,4)=35) D
 .S ACRAP0=$G(^ACRAPVS(ACRX,0))
 .S ACRAPDT=$G(^ACRAPVS(ACRX,"DT"))
 .Q:$P(ACRAPDT,U,8)>DT
 .I ACRAP0=""&(ACRAPDT="") D  Q
 ..S DA=ACRX
 ..S DIK="^ACRAPVS("
 ..D DIK^ACRFDIC
 .D EN11
 I ACRJ=0 W ! D  Q
 .N ACRSTAT                            ;ACR*2.1*21.05 IM22502
 .S ACRSTAT=$E(ACROBLAP)               ;ACR*2.1*21.05 IM22502
 .I ACRREFX'=103,ACRREFX'=349,ACRREFX'=326,ACRREFX'=600,ACRREFX'=210 D
 ..W "THIS DOCUMENT HAS "
 ..;Begin old code ACR*2.1*21.05 IM22502
 ..;W $S($E(ACROBLAP)'="D":"NOT BEEN SUBMITTED FOR APPROVAL.",1:"BEEN DISAPPROVED.")
 ..;Begin new code ACR*2.1*21
 ..I ACRSTAT="D" W "BEEN DISAPPROVED." Q
 ..I ACRSTAT="C" W "BEEN CANCELLED." Q
 ..W "NOT BEEN SUBMITTED FOR APPROVAL."
 ..;End new code
 .I ACRREFX=103!(ACRREFX=349)!(ACRREFX=326)!(ACRREFX=210) D
 ..;I $E(ACROBLAP)="D" W $S(ACRDOC0["CANCELLED":"CANCELLED",1:"DISAPPROVED") Q  ;ACR*2.1*21.05 IM22502
 ..I $E(ACROBLAP)="D"!($E(ACROBLAP)="C") W $S(ACRDOC0["CANCELLED":"CANCELLED",1:"DISAPPROVED") Q  ;ACR*2.1*21.05 IM22502
 ..I $P(ACRDOC0,U,4)=35,$P(ACROBLAP,U,8)="A" W "CREDIT CARD PURCHASE APPROVED AND COMPLETED" Q
 ..W "BEING PROCESSED IN PROCURMENT BY: "
 ..N ACRPA
 ..S ACRPA=$P($G(^ACRDOC(D0,"PA")),U)
 ..I 'ACRPA W "PURCHASING AGENT NOT SELECTED."
 ..;E  S ACRPA=$P(^VA(200,ACRPA,0),U),ACRPA=$P($P(ACRPA,",",2)," ")_" "_$P(ACRPA,",")  ;ACR*2.1*19.02 IM16848
 ..E  S ACRPA=$$NAME2^ACRFUTL1(ACRPA),ACRPA=$P($P(ACRPA,",",2)," ")_" "_$P(ACRPA,",")  ;ACR*2.1*19.02 IM16848
 ..W:ACRPA]"" ACRPA
 ..I $D(^ACRDOC(ACRDOCDA,13)) D
 ...N ACR13
 ...S ACR13=$P(^ACRDOC(ACRDOCDA,13),U,4)
 ...W:ACR13]"" ?$X+2,"PO DUE BY: ",$E(ACR13,4,5),"/",$E(ACR13,6,7)
 ..D PDOCSTAT^ACRFEA42
 .;Begin old code ACR*2.1*21.05  IM22502
 .;I ACRREFX=600 D
 .;.I $P(^ACROBL(ACRDOCDA,"APV"),U)="D" D  Q
 .;..W "TRAVEL VOUCHER WAS DISAPPROVED."
 .;.W "TRAVEL VOUCHER BEING PREPARED."
 .;Begin new code ACR*2.1*21.05  IM22502
 .I ACRREFX=600 D
 ..I $P(^ACROBL(ACRDOCDA,"APV"),U)="D"!($P(^ACROBL(ACRDOCDA,"APV"),U)="C") D  Q
 ...W "TRAVEL VOUCHER WAS "
 ...W $S(ACRDOC0["CANCELLED":"CANCELLED",1:"DISAPPROVED")
 ..W "TRAVEL VOUCHER BEING PREPARED."
 .;End new code
 I ACRREFX'=103,ACRREFX'=349,ACRREFX'=326 D
 .W !,"| APPROVAL FOR DOCUMENT: ",ACRDOC
 .W "     ",$$EXPDN^ACRFUTL(ACRDOCDA)           ;ACR*2.1*14.01 IM12272
 .W ?79,"|"
 S ACRX=0
 F  S ACRX=$O(ACRX(ACRX)) Q:'ACRX  D EN12
 D TAIL^ACRFPAP1:$E($G(IOST),1,2)="P-"&'$D(ACRPSC)
 Q
EN11 I $P(ACRDOC0,U,4)=35,$P(ACRAP0,U,3)=1,$P(ACRAP0,U,4)=1 S $P(ACRAP0,U,4)=999
 S ACRX($P(ACRAP0,U,4),$P(ACRAP0,U,3),ACRX)=""
 S ACRDOC=$S($P(ACRDOC0,U,2)]""&($P(ACRDOC0,U,2)'=$P(ACRDOC0,U))&'$D(ACRREQST):$P(ACRDOC0,U,2)_"  ("_$P(ACRDOC0,U)_")",1:$P(ACRDOC0,U))
 S ACRJ=ACRJ+1
 Q
EN12 S ACRY=0
 F  S ACRY=$O(ACRX(ACRX,ACRY)) Q:'ACRY  D
 .S ACRZ=$O(ACRX(ACRX,ACRY,0))
 .S ACRCT=$P(^ACRAPVS(ACRZ,0),U,3)
 .S ACRDT=$G(^ACRAPVS(ACRZ,"DT"))
 .S ACRSTATS=$P(ACRDT,U)
 .S ACRFINAL=$P(ACRDT,U,5)
 .S ACRUS=$S($P(ACRDT,U,6)]"":$P(ACRDT,U,6),1:$P(ACRDT,U,2))
 .S ACRUSO=$P(ACRDT,U,2)
 .S Y=$P(ACRDT,U,4)
 X:Y]"" ^DD("DD")
 S:$D(ACRORIGF) ACRAP=Y
 D EN2
 Q
EN2 I 'ACRCT S ACRCT="NOT STATED"
 I ACRCT=1,ACRSTATS="" D
 .W !
 .D B
 .W $S($D(ACR3542):"9A. ",'$D(ACRPSC):"22. ",1:"    "),"(DOCUMENT PENDING CONTRACT/ORDER OFFICER SIGNATURE)"
 .W ?79
 .D B
 I ACRCT,'$D(^ACRAPVT(ACRCT,0)) S ACRCT="NOT STATED"
 I ACRCT,$D(^ACRAPVT(ACRCT,0)) D
 .D EN^ACRFPAP1
 .S ACRCT=$P(^ACRAPVT(ACRCT,0),U)
 I ACRX=99 S ACRCT="RECERTIFY FUNDS"
 I ACRUS,$D(^VA(200,ACRUS,0)) D
 .;S ACRUS=$E($P(^VA(200,ACRUS,0),U),1,24)  ;ACR*2.1*19.02 IM16848
 .S ACRUS=$E($$NAME3^ACRFUTL1(ACRUS),1,24)  ;ACR*2.1*19.02 IM16848
 .S ACRUS=$P(ACRUS,",",2)_" "_$P(ACRUS,",")
 .I ACRUSO'=ACRUS,$D(^VA(200,ACRUSO,0)) D  I 1
 ..;S ACRUSO=$E($P(^VA(200,ACRUSO,0),U),1,24)  ;ACR*2.1*19.02 IM16848
 ..S ACRUSO=$E($$NAME3^ACRFUTL1(ACRUSO),1,24)  ;ACR*2.1*19.02 IM16848
 ..S ACRUSO=$P(ACRUSO,",",2)_" "_$P(ACRUSO,",")
 E  S ACRUS="NOT STATED"
 S ACRCT=$E($P($P(ACRCT,",",2)," ")_" "_$P(ACRCT,","),1,21)
 I ACRREFX=103!(ACRREFX=349)!(ACRREFX=326),ACRCT["AUTH" S ACRCT="CONTRACT/ORDER OFFICER"
 I (ACRCT["CERTIFY"!(ACRCT["CERTIFICATION OF TRA")!(ACRCT["TRAINING FUNDS AVAIL")),$E(DT,4,5)<10,$E(DT,1,3)+1700<$P(^ACRLOCB($P(ACRDOC0,U,6),"DT"),U) S ACRCT=" SUB. TO AVAIL FUNDS."
 Q:$D(ACRORIGF)
 I "^103^349^326^"'[(U_ACRREFX_U)!("^103^349^326^"[(U_ACRREFX_U)&(ACRFINAL'="Y")) D
 .W !
 .D B
 .W ACRCT
 .I $L(ACRCT)<21 F ACRI=1:1:21-$L(ACRCT) W "."
 .W ": "
 .W ?23,ACRUS
 I ACRREFX=103!(ACRREFX=349)!(ACRREFX=326),ACRREFDA'=$O(^AUTTDOCR("B",116,0)),ACRFINAL="Y" D
 .W !,$S($D(ACR3542):"9A. ",'$D(ACRPSC):"22. ",1:"    "),"UNITED STATES OF AMERICA BY:"
 .I '$D(ACRPSC) D
 ..W ?44,"|",$S($D(ACR3542):"",1:"23. "),"NAME: ",ACRUS
 ..W !?4,$S(ACRSTATS="A":"(ELECTRONIC SIGNATURE) "_$P(Y,"@"),1:"PENDING")
 ..W ?44,"|"
 ..W ?55,"CONTRACT/ORDER OFFICER"
 ..W ?51
 .I $D(ACRPSC) D
 ..W ?$X+2,ACRUS
 ..W !?4,$S(ACRSTATS="A":"(ELECTRONIC SIGNATURE) "_$P(Y,"@"),1:"PENDING")
 ..W ?44,"CONTRACT/ORDER OFFICER"
 ..W ?51
 I ACRREFX=103!(ACRREFX=349)!(ACRREFX=326),ACRFINAL="Y",ACRSTATS="A",$D(^ACROBL(ACRDOCDA,"APV")),$P(^("APV"),U,3)="A",$P(^ACRDOC(ACRDOCDA,0),U,12) D
 .W !?20,"***** ",$S($P(^ACRDOC(ACRDOCDA,0),U,12)=1:"ADVANCE PAYMENT",1:"CASH BUY")," AUTHORIZED *****"
 I "^103^349^326^"'[(U_ACRREFX_U)!("^103^349^326^"[(U_ACRREFX_U)&(ACRFINAL'="Y")) D
 .W ?49,$S($E(ACRSTATS)["A":"APPROVED",$E(ACRSTATS)["D":"DISAPPRVD",1:"PENDING")
 .W ?59,Y
 W ?79 D B
 I ACRUS'=ACRUSO,"^103^349^326^"'[(U_ACRREFX_U)!("^103^349^326^"[(U_ACRREFX_U)&(ACRFINAL'="Y")),ACRSTATS]"" D
 .W !,"|"
 .W ?22,"(ACTING FOR: ",ACRUSO,")"
 .W ?79
 .D B
 Q
B W $S(ACRREFX'=103&(ACRREFX'=349)&(ACRREFX'=326):"|",1:"")
 Q
B1 W $S(ACRREFX'=103&(ACRREFX'=349)&(ACRREFX'=326):"|",1:"-")
 Q