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

ENFAVAL.m

Go to the documentation of this file.
  1. ENFAVAL ;(WIRMFO)/KLD/SAB; VALIDITY CHECKS FOR Fx DOCS ;2/18/99
  1. ;;7.0;ENGINEERING;**25,29,33,38,39,46,60**;Aug 17, 1993
  1. ST ;
  1. N ENC,X
  1. S ENC("BAD")=0
  1. F I=1:1 X "S T=$P($T("_ENFAP("DOC")_"CHK+I),"";;"",2)" Q:T["END" D
  1. . I ENFAP("DOC")="FA" D Q
  1. . . Q:$P(ENEQ(+T),U,$P(T,";",2))]"" D SET("Missing "_$P(T,";",3))
  1. . Q:$P(ENFAP(+T),U,$P(T,";",2))]"" D SET("Missing "_$P(T,";",3))
  1. I ENFAP("DOC")="FA" D FA
  1. I ENFAP("DOC")="FC" D FC
  1. I ENFAP("DOC")="FD" D FD
  1. I ENFAP("DOC")="FR" D FR
  1. I ENC("BAD")>0 S ^TMP($J,"BAD",ENEQ("DA"))=ENC("BAD")
  1. K I,T Q
  1. ;
  1. FA ;Check for appropriate values of certain required fields
  1. I $P(ENEQ(2),U,3)]"" D:$P(ENEQ(2),U,3)'>0 SET("Asset Value must be greater than 0.00")
  1. I $P(ENEQ(3),U,4)]"" D:$P(ENEQ(3),U,4)>0 SET("Acquisition Method inappropriate")
  1. I $P(ENEQ(0),U,4)]"" D:$P(ENEQ(0),U,4)'="NX" SET("Not non-expendable")
  1. D:'$P(ENEQ(8),U,2) SET("Asset not capitalized")
  1. I $P(ENEQ(9),U,6)]"" D
  1. . S X=$G(^ENG(6914.4,$P(ENEQ(9),U,6),0))
  1. . I $P(X,U)="" D SET("BOC invalid pointer")
  1. . I $P(X,U,5)]"",$P(X,U,5)'>DT D SET("BOC has been deactivated")
  1. I $P(ENEQ(8),U,6)]"" D
  1. . I '$D(^ENG(6914.3,$P(ENEQ(8),U,6))) D SET("SGL invalid pointer") Q
  1. . S X=$G(^ENG(6914.3,$P(ENEQ(8),U,6),0))
  1. . I $P(X,U)="6100" D SET("NX SGL account of 6100")
  1. . I $P(X,U,5)]"",$P(X,U,5)'>DT D SET("SGL has been deactivated")
  1. I $P(ENEQ(9),U,7)]"" D
  1. . S X=$G(^ENG(6914.6,$P(ENEQ(9),U,7),0))
  1. . I $P(X,U)="" D SET("FUND invalid pointer")
  1. . I $P(X,U,5)]"",$P(X,U,5)'>DT D SET("FUND has been deactivated")
  1. I $P(ENEQ(2),U,9)]"" D
  1. . S ENFAP("LOC")=$$LOC($$GET1^DIQ(6914,ENEQ("DA"),19))
  1. . I ENFAP("LOC")="" D SET("Invalid CMR") Q
  1. . I $P(ENEQ(9),U,8)]"" D
  1. . . S X=$O(^ENG(6914.9,"B",ENFAP("LOC"),0))
  1. . . Q:'X
  1. . . S Y=$P($G(^ENG(6914.9,X,0)),U,4)
  1. . . I Y]"",Y'=$P(ENEQ(9),U,8) D SET("CMR inappropriate for A/O")
  1. I $P(ENEQ(2),U,8)]"" D
  1. . S ENFAP("GRP")=$$GROUP($$GET1^DIQ(6914,ENEQ("DA"),18))
  1. . I 'ENFAP("GRP") D SET("Invalid CSN") Q
  1. . I $P(ENEQ(8),U,6)]"",'$O(^ENG(6914.3,$P(ENEQ(8),U,6),1,"B",ENFAP("GRP"),0)) D SET("CSN inappropriate for SGL")
  1. I $P(ENEQ(2),U,4)]"",+$E($P(ENEQ(2),U,4),4,5)'>0 D SET("Acquisition Month Missing")
  1. I $P(ENEQ(2),U,10)]"" D
  1. . I +$E($P(ENEQ(2),U,10),4,5)'>0 D SET("Replacement Month Missing")
  1. . I $P(ENEQ(2),U,4)]"",$P(ENEQ(2),U,10)<$P(ENEQ(2),U,4) D SET("Replacement Date preceeds Acquisition Date")
  1. Q
  1. ;
  1. FC ;Check for problems with CSN and/or CMR
  1. I $P(ENFAP(100),U)]"" D
  1. . I $P(ENFAP(3),U,9)="" D SET("CSN is unacceptable for capitalized NX") Q
  1. . I $P(ENEQ(8),U,6)]"",'$O(^ENG(6914.3,$P(ENEQ(8),U,6),1,"B",$P(ENFAP(3),U,9),0)) D SET("CSN inappropriate for SGL")
  1. I $P(ENFAP(100),U,2)]"",$P(ENFAP(3),U,10)="" D SET("CMR is unacceptable for capitalized NX")
  1. ;check date order (ACQUISITION & REPLACEMENT)
  1. I $P(ENFAP(100),U,6)]""!($P(ENFAP(100),U,7)]"") D
  1. . N ENAD,ENRD
  1. . S ENAD=$S($P(ENFAP(100),U,6)]"":$P(ENFAP(100),U,6),1:$P(ENEQ(2),U,4))
  1. . S ENRD=$S($P(ENFAP(100),U,7)]"":$P(ENFAP(100),U,7),1:$P(ENEQ(2),U,10))
  1. . I ENAD=""!(ENRD="") Q
  1. . I ENRD'>ENAD D SET("REPLACEMENT DATE must follow ACQUISITION DATE.")
  1. Q
  1. ;
  1. FD ; Check for probems with disp date
  1. I $P(ENFAP(100),U,3)>DT D SET("DISPOSITION DATE must not be later than Today.")
  1. Q
  1. ;
  1. FR ; Check for problems with CMR
  1. I $P(ENFAP(100),U,6)]"",$$LOC($P($G(^ENG(6914.1,$P(ENFAP(100),U,6),0)),U))="" D SET("CMR is unacceptable for capitalized NX")
  1. I $P(ENFAP(100),U,3)]""!($P(ENFAP(100),U,6)]"") D ; new A/O or new CMR
  1. . N ENAO,ENCMR
  1. . S ENAO=$S($P(ENFAP(100),U,3)]"":$P(ENFAP(100),U,3),1:$P(ENEQ(9),U,8))
  1. . S ENCMR=$S($P(ENFAP(100),U,6)]"":$P(ENFAP(100),U,6),1:$P(ENEQ(2),U,9))
  1. . I ENAO=""!(ENCMR="") Q
  1. . S ENFAP("LOC")=$$LOC($P($G(^ENG(6914.1,ENCMR,0)),U))
  1. . I ENFAP("LOC")="" Q
  1. . S X=$O(^ENG(6914.9,"B",ENFAP("LOC"),0))
  1. . I X'>0 Q
  1. . S Y=$P($G(^ENG(6914.9,X,0)),U,4)
  1. . I Y]"",Y'=ENAO D SET("CMR inappropriate for A/O")
  1. I $P(ENFAP(100),U,5)]"" D
  1. . S X=$G(^ENG(6914.4,$P(ENFAP(100),U,5),0))
  1. . I $P(X,U)="" D SET("BOC invalid pointer")
  1. . I $P(X,U,5)]"",$P(X,U,5)'>DT D SET("BOC has been deactivated")
  1. I $P(ENFAP(100),U,2)]"" D
  1. . S X=$G(^ENG(6914.6,$P(ENFAP(100),U,2),0))
  1. . I $P(X,U)="" D SET("FUND invalid pointer")
  1. . I $P(X,U,5)]"",$P(X,U,5)'>DT D SET("FUND has been deactivated")
  1. Q
  1. SET(X) ;Record problems
  1. S ENC("BAD")=ENC("BAD")+1,^TMP($J,"BAD",ENEQ("DA"),ENC("BAD"))=X
  1. Q
  1. ;
  1. LOC(CMR) ;Accepts CMR and checks 1st two char
  1. ;Returns FAP LOCATION (EIL)
  1. S ENFAP("LOC")=$E(CMR,1,2) I ENFAP("LOC")'?2N S ENFAP("LOC")="" G LOCDN
  1. I ENFAP("LOC")]"",'$D(^ENG(6914.9,"B",ENFAP("LOC"))) S ENFAP("LOC")=""
  1. ;I "^73^74^79^"[(U_ENFAP("LOC")_U) S ENFAP("LOC")=""
  1. ;I ENFAP("LOC")>83,"^86^88^90^98^99^"'[(U_ENFAP("LOC")_U) S ENFAP("LOC")=""
  1. LOCDN Q ENFAP("LOC")
  1. ;
  1. GROUP(CSN) ;Accepts CSN and returns FAP GROUP
  1. N FSC S FSC=$E(CSN,1,4) ;Federal Supply Classification
  1. I FSC'?4N S ENFAP("GRP")=0 G GRPDUN
  1. I "7020^7021^7025^7035^7040^7050^7435"[FSC S ENFAP("GRP")=FSC
  1. E S ENFAP("GRP")=$E(FSC,1,2)_"00"
  1. GRPDUN Q ENFAP("GRP")
  1. ;
  1. FACHK ;;
  1. ;;0;4;Type of Entry
  1. ;;8;6;General Ledger Account
  1. ;;2;8;Category Stock Number
  1. ;;2;9;CMR
  1. ;;2;4;Acquisition Date
  1. ;;9;7;Fund
  1. ;;9;8;A.O. Code
  1. ;;9;6;Budget Object Code
  1. ;;2;6;Life Expectancy
  1. ;;2;3;Acquisition Value
  1. ;;3;4;Acquitition Method
  1. ;;9;9;Equity Account
  1. ;;END
  1. FBCHK ;;
  1. ;;3;7;Betterment Number
  1. ;;3;12;Acquisition Method
  1. ;;6;2;Equity Account
  1. ;;4;4;Dollar Amount
  1. ;;END
  1. FCCHK ;;
  1. ;;3;8;Betterment Number
  1. ;;END
  1. FDCHK ;;
  1. ;;5;4;Disposition Method
  1. ;;5;5;Disposition Year
  1. ;;5;6;Disposition Month
  1. ;;5;7;Disposition Day
  1. ;;5;8;Selling Price
  1. ;;5;9;Disposition Authority
  1. ;;END
  1. FRCHK ;;
  1. ;;3;9;New Fund Code
  1. ;;3;10;New A.O. Code
  1. ;;3;11;New Owning Station
  1. ;;3;12;New Xprogram
  1. ;;END