ENFAR3 ;WIRMFO/SAB-FIXED ASSET RPT, CHECK OF EQUIP CAPITALIZATION ;5/29/2002
;;7.0;ENGINEERING;**25,63,71**;Aug 17, 1993
;-----------------------------------------------------------------
;Patch 71 Increases Threshold from $25,000.00 to $100,000.00
;
;ENCAP = Investment Category
;ENSGL = Standard General Ledger
; ENCT = Capitalization Threshold
;ENTYI = Type of Entry
;
;-----------------------------------------------------------------
EN W !,"This report searches the entire equipment file and may take some"
W !,"time to complete. Consider queuing this report to run after-hours."
; ask device
S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) D G EXIT
. S ZTRTN="QEN^ENFAR3",ZTDESC="Check of Equipment Capitalization"
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
QEN ; queued entry
U IO
S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
S ENL="",$P(ENL,"-",IOM)=""
D HD
;
;The new capitalization threshold of 100K will take effect for
;this report after the 1-time job runs on July 24, 2002 (3020724).
S ENCT=$S(DT>3020724:100000,1:25000)
;
; loop thru equipment file
S ENT=0
S ENDA=0 F S ENDA=$O(^ENG(6914,ENDA)) Q:'ENDA D Q:END
. Q:$P($G(^ENG(6914,ENDA,3)),U,11)]"" ; ignore dispositioned items
. S ENY2=$G(^ENG(6914,ENDA,2)),ENY8=$G(^ENG(6914,ENDA,8))
. S ENTYI=$P($G(^ENG(6914,ENDA,0)),U,4) ;TYPE OF ENTRY (#7)
. S ENVAL=$P(ENY2,U,3) ;TOTAL ASSET VALUE (#12)
. S X=$P(ENY2,U,9),ENCMR=$S(X:$P($G(^ENG(6914.1,X,0)),U),1:X)
. ;;S X=$P(ENY8,U,2),ENCAP=$S(X=1:"YES",X=0:"NO",1:X)
. S ENCAP=$P(ENY8,U,2) ;INVESTMENT CATEGORY (#34)
. ;
. ;ENSGL = Standard General Ledger (#38)
. S X=$P(ENY8,U,6),ENSGL=$S(X:$P($G(^ENG(6914.3,X,0)),U),1:X)
. K ENY2,ENY8
. ; perform checks
. K EN S ENC=0
. I ENCAP'=1,ENVAL'<ENCT,ENTYI="NX"!(ENTYI="") D
. . S ENC=ENC+1,EN(ENC)="Check capitalization"
. ;
. ;Investment Category (1) is Capitalized/Accountable
. I ENCAP=1 D
. . I ENTYI="" S ENC=ENC+1,EN(ENC)="Type Entry is blank"
. . I ENTYI="NX" D
. . . I ENVAL<ENCT S ENC=ENC+1,EN(ENC)="Check capitalization"
. . . I $$LOC^ENFAVAL(ENCMR)="" S ENC=ENC+1,EN(ENC)="Check CMR"
. . . I ENSGL="" S ENC=ENC+1,EN(ENC)="SGL is blank"
. . . I ENSGL=6100 S ENC=ENC+1,EN(ENC)="SGL is 6100 (Expensed)"
. I ENC D
. . ; print questionable equipment item
. . S ENT=ENT+1
. . S ENCAP=$S(ENCAP=1:"YES",1:"NO")
. . I $Y+3+ENC>IOSL D HD Q:END
. . W !!,ENDA,?12,ENTYI,?19,ENCMR,?26
. . W $J("$"_$FN(ENVAL,",",2),14),?47,ENCAP,?55,EN(1)
. . F ENI=2:1:ENC W !,?55,EN(ENI)
I 'END D
. W !!,ENT," questionable equipment items found"
. I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
D ^%ZISC
EXIT I $D(ZTQUEUED) S ZTREQ="@"
K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
K END,ENDT,ENL,ENPG
K EN,ENC,ENCAP,ENCT,ENCMR,ENDA,ENI,ENSGL,ENT,ENTYI,ENVAL
Q
HD ; header
I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
I $E(IOST,1,2)="C-"!ENPG W @IOF
S ENPG=ENPG+1
W !,"CHECK OF EQUIPMENT CAPITALIZATION",?48,ENDT,?72,"page ",ENPG
W !!,?12,"TYPE"
W !,"EQUIP ID#",?12,"ENTRY",?19,"CMR",?26," ASSET VALUE"
W ?42,"CAPITALIZED"
W !,$E(ENL,1,10),?12,$E(ENL,1,5),?19,$E(ENL,1,5),?26,$E(ENL,1,14)
W ?42,$E(ENL,1,11),?55,$E(ENL,1,23)
Q
;ENFAR3
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENFAR3 3289 printed Nov 22, 2024@17:03:42 Page 2
ENFAR3 ;WIRMFO/SAB-FIXED ASSET RPT, CHECK OF EQUIP CAPITALIZATION ;5/29/2002
+1 ;;7.0;ENGINEERING;**25,63,71**;Aug 17, 1993
+2 ;-----------------------------------------------------------------
+3 ;Patch 71 Increases Threshold from $25,000.00 to $100,000.00
+4 ;
+5 ;ENCAP = Investment Category
+6 ;ENSGL = Standard General Ledger
+7 ; ENCT = Capitalization Threshold
+8 ;ENTYI = Type of Entry
+9 ;
+10 ;-----------------------------------------------------------------
EN WRITE !,"This report searches the entire equipment file and may take some"
+1 WRITE !,"time to complete. Consider queuing this report to run after-hours."
+2 ; ask device
+3 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+4 IF $DATA(IO("Q"))
Begin DoDot:1
+5 SET ZTRTN="QEN^ENFAR3"
SET ZTDESC="Check of Equipment Capitalization"
+6 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
QEN ; queued entry
+1 USE IO
+2 SET (END,ENPG)=0
DO NOW^%DTC
SET Y=%
DO DD^%DT
SET ENDT=Y
+3 SET ENL=""
SET $PIECE(ENL,"-",IOM)=""
+4 DO HD
+5 ;
+6 ;The new capitalization threshold of 100K will take effect for
+7 ;this report after the 1-time job runs on July 24, 2002 (3020724).
+8 SET ENCT=$SELECT(DT>3020724:100000,1:25000)
+9 ;
+10 ; loop thru equipment file
+11 SET ENT=0
+12 SET ENDA=0
FOR
SET ENDA=$ORDER(^ENG(6914,ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+13 ; ignore dispositioned items
if $PIECE($GET(^ENG(6914,ENDA,3)),U,11)]""
QUIT
+14 SET ENY2=$GET(^ENG(6914,ENDA,2))
SET ENY8=$GET(^ENG(6914,ENDA,8))
+15 ;TYPE OF ENTRY (#7)
SET ENTYI=$PIECE($GET(^ENG(6914,ENDA,0)),U,4)
+16 ;TOTAL ASSET VALUE (#12)
SET ENVAL=$PIECE(ENY2,U,3)
+17 SET X=$PIECE(ENY2,U,9)
SET ENCMR=$SELECT(X:$PIECE($GET(^ENG(6914.1,X,0)),U),1:X)
+18 ;;S X=$P(ENY8,U,2),ENCAP=$S(X=1:"YES",X=0:"NO",1:X)
+19 ;INVESTMENT CATEGORY (#34)
SET ENCAP=$PIECE(ENY8,U,2)
+20 ;
+21 ;ENSGL = Standard General Ledger (#38)
+22 SET X=$PIECE(ENY8,U,6)
SET ENSGL=$SELECT(X:$PIECE($GET(^ENG(6914.3,X,0)),U),1:X)
+23 KILL ENY2,ENY8
+24 ; perform checks
+25 KILL EN
SET ENC=0
+26 IF ENCAP'=1
IF ENVAL'<ENCT
IF ENTYI="NX"!(ENTYI="")
Begin DoDot:2
+27 SET ENC=ENC+1
SET EN(ENC)="Check capitalization"
End DoDot:2
+28 ;
+29 ;Investment Category (1) is Capitalized/Accountable
+30 IF ENCAP=1
Begin DoDot:2
+31 IF ENTYI=""
SET ENC=ENC+1
SET EN(ENC)="Type Entry is blank"
+32 IF ENTYI="NX"
Begin DoDot:3
+33 IF ENVAL<ENCT
SET ENC=ENC+1
SET EN(ENC)="Check capitalization"
+34 IF $$LOC^ENFAVAL(ENCMR)=""
SET ENC=ENC+1
SET EN(ENC)="Check CMR"
+35 IF ENSGL=""
SET ENC=ENC+1
SET EN(ENC)="SGL is blank"
+36 IF ENSGL=6100
SET ENC=ENC+1
SET EN(ENC)="SGL is 6100 (Expensed)"
End DoDot:3
End DoDot:2
+37 IF ENC
Begin DoDot:2
+38 ; print questionable equipment item
+39 SET ENT=ENT+1
+40 SET ENCAP=$SELECT(ENCAP=1:"YES",1:"NO")
+41 IF $Y+3+ENC>IOSL
DO HD
if END
QUIT
+42 WRITE !!,ENDA,?12,ENTYI,?19,ENCMR,?26
+43 WRITE $JUSTIFY("$"_$FNUMBER(ENVAL,",",2),14),?47,ENCAP,?55,EN(1)
+44 FOR ENI=2:1:ENC
WRITE !,?55,EN(ENI)
End DoDot:2
End DoDot:1
if END
QUIT
+45 IF 'END
Begin DoDot:1
+46 WRITE !!,ENT," questionable equipment items found"
+47 IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR
End DoDot:1
+48 DO ^%ZISC
EXIT IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+1 KILL DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+2 KILL END,ENDT,ENL,ENPG
+3 KILL EN,ENC,ENCAP,ENCT,ENCMR,ENDA,ENI,ENSGL,ENT,ENTYI,ENVAL
+4 QUIT
HD ; header
+1 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET ZTSTOP=1
SET END=1
QUIT
+2 IF $EXTRACT(IOST,1,2)="C-"
IF ENPG
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF 'Y
SET END=1
QUIT
+3 IF $EXTRACT(IOST,1,2)="C-"!ENPG
WRITE @IOF
+4 SET ENPG=ENPG+1
+5 WRITE !,"CHECK OF EQUIPMENT CAPITALIZATION",?48,ENDT,?72,"page ",ENPG
+6 WRITE !!,?12,"TYPE"
+7 WRITE !,"EQUIP ID#",?12,"ENTRY",?19,"CMR",?26," ASSET VALUE"
+8 WRITE ?42,"CAPITALIZED"
+9 WRITE !,$EXTRACT(ENL,1,10),?12,$EXTRACT(ENL,1,5),?19,$EXTRACT(ENL,1,5),?26,$EXTRACT(ENL,1,14)
+10 WRITE ?42,$EXTRACT(ENL,1,11),?55,$EXTRACT(ENL,1,23)
+11 QUIT
+12 ;ENFAR3