ENFACTR ;(WCIOFO)/SAB-FAP CAPITALIZATION THRESHOLD REMOVED LIST ;10/14/1999
;;7.0;ENGINEERING;**63**;Aug 17, 1993
EN ;
; ask device
S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) D G EXIT
. S ZTRTN="QEN^ENFACTR"
. S ZTDESC="ENG List Equip Removed from Expensed List"
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
;
QEN ; queued entry
U IO
;
COLLECT ; collect data
S END=0 ; init flag, =true if user stopped job
K ^TMP($J)
;
; loop thru equipment in FA DOCUMENT LOG file
S ENDA=0 F S ENDA=$O(^ENG(6915.2,"B",ENDA)) Q:'ENDA D
. Q:+$$CHKFA^ENFAUTL(ENDA)'>0 ; not currently reported to FAP
. S ENX=$$CHKEXP^ENFACTU(ENDA)
. Q:$P(ENX,U)'="U" ; not exempted by user
. ; put on sorted list to report
. S ENSN=$$GET1^DIQ(6914,ENDA_",",60)_" " S:ENSN=" " ENSN="UNK"
. S ^TMP($J,ENSN,ENDA)=$P(ENX,U,2)
;
PRINT ; print results
S ENPG=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
S ENL="",$P(ENL,"-",IOM)=""
I '$D(^TMP($J)) S ENSN="" D HD W !!,"Nothing to report."
; loop thru station
S ENSN="" F S ENSN=$O(^TMP($J,ENSN)) Q:ENSN="" D Q:END
. D HD Q:END
. ; loop thru equipment
. S ENDA=0 F S ENDA=$O(^TMP($J,ENSN,ENDA)) Q:'ENDA D Q:END
. . I $Y+4>IOSL D HD Q:END W " (continued)"
. . S ENCSN=$$GET1^DIQ(6914,ENDA,18)
. . W !!,?2,"ENTRY #: ",ENDA
. . W ?22,"CMR: ",$E($$GET1^DIQ(6914,ENDA,19),1,5)
. . W ?33,"Value: ",$FN($$GET1^DIQ(6914,ENDA,12),",",2)
. . W !,?2,"CATEGORY STOCK NUMBER: ",ENCSN
. . I ENCSN]"" W " (",$$GET1^DIQ(6914,ENDA,"18:2"),")"
. . W !,?2,"Remain Capitalized set by: ",$G(^TMP($J,ENSN,ENDA))
. Q:END
I END W !!,"REPORT STOPPED BY USER REQUEST"
I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
D ^%ZISC
EXIT I $D(ZTQUEUED) S ZTREQ="@"
K ^TMP($J)
K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,END,ENDT,ENL,ENPG
K ENCSN,ENDA,ENSN,ENX
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 !,"EQUIPMENT THAT USER REMOVED FROM CT TASK"
W ?49,ENDT,?72,"page ",ENPG
W !,ENL
I ENPG=1 D
. W !,"The following equipment meets the system criteria to expense, but no action"
. W !,"will be taken because a user indicated that it should remain capitalized.",!
I ENSN]"" W !,"STATION ",ENSN
Q
;
;ENFACTR
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENFACTR 2327 printed Dec 13, 2024@01:53:25 Page 2
ENFACTR ;(WCIOFO)/SAB-FAP CAPITALIZATION THRESHOLD REMOVED LIST ;10/14/1999
+1 ;;7.0;ENGINEERING;**63**;Aug 17, 1993
EN ;
+1 ; ask device
+2 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+3 IF $DATA(IO("Q"))
Begin DoDot:1
+4 SET ZTRTN="QEN^ENFACTR"
+5 SET ZTDESC="ENG List Equip Removed from Expensed List"
+6 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
+7 ;
QEN ; queued entry
+1 USE IO
+2 ;
COLLECT ; collect data
+1 ; init flag, =true if user stopped job
SET END=0
+2 KILL ^TMP($JOB)
+3 ;
+4 ; loop thru equipment in FA DOCUMENT LOG file
+5 SET ENDA=0
FOR
SET ENDA=$ORDER(^ENG(6915.2,"B",ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+6 ; not currently reported to FAP
if +$$CHKFA^ENFAUTL(ENDA)'>0
QUIT
+7 SET ENX=$$CHKEXP^ENFACTU(ENDA)
+8 ; not exempted by user
if $PIECE(ENX,U)'="U"
QUIT
+9 ; put on sorted list to report
+10 SET ENSN=$$GET1^DIQ(6914,ENDA_",",60)_" "
if ENSN=" "
SET ENSN="UNK"
+11 SET ^TMP($JOB,ENSN,ENDA)=$PIECE(ENX,U,2)
End DoDot:1
+12 ;
PRINT ; print results
+1 SET ENPG=0
DO NOW^%DTC
SET Y=%
DO DD^%DT
SET ENDT=Y
+2 SET ENL=""
SET $PIECE(ENL,"-",IOM)=""
+3 IF '$DATA(^TMP($JOB))
SET ENSN=""
DO HD
WRITE !!,"Nothing to report."
+4 ; loop thru station
+5 SET ENSN=""
FOR
SET ENSN=$ORDER(^TMP($JOB,ENSN))
if ENSN=""
QUIT
Begin DoDot:1
+6 DO HD
if END
QUIT
+7 ; loop thru equipment
+8 SET ENDA=0
FOR
SET ENDA=$ORDER(^TMP($JOB,ENSN,ENDA))
if 'ENDA
QUIT
Begin DoDot:2
+9 IF $Y+4>IOSL
DO HD
if END
QUIT
WRITE " (continued)"
+10 SET ENCSN=$$GET1^DIQ(6914,ENDA,18)
+11 WRITE !!,?2,"ENTRY #: ",ENDA
+12 WRITE ?22,"CMR: ",$EXTRACT($$GET1^DIQ(6914,ENDA,19),1,5)
+13 WRITE ?33,"Value: ",$FNUMBER($$GET1^DIQ(6914,ENDA,12),",",2)
+14 WRITE !,?2,"CATEGORY STOCK NUMBER: ",ENCSN
+15 IF ENCSN]""
WRITE " (",$$GET1^DIQ(6914,ENDA,"18:2"),")"
+16 WRITE !,?2,"Remain Capitalized set by: ",$GET(^TMP($JOB,ENSN,ENDA))
End DoDot:2
if END
QUIT
+17 if END
QUIT
End DoDot:1
if END
QUIT
+18 IF END
WRITE !!,"REPORT STOPPED BY USER REQUEST"
+19 IF 'END
IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR
+20 DO ^%ZISC
EXIT IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+1 KILL ^TMP($JOB)
+2 KILL DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,END,ENDT,ENL,ENPG
+3 KILL ENCSN,ENDA,ENSN,ENX
+4 QUIT
+5 ;
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 !,"EQUIPMENT THAT USER REMOVED FROM CT TASK"
+6 WRITE ?49,ENDT,?72,"page ",ENPG
+7 WRITE !,ENL
+8 IF ENPG=1
Begin DoDot:1
+9 WRITE !,"The following equipment meets the system criteria to expense, but no action"
+10 WRITE !,"will be taken because a user indicated that it should remain capitalized.",!
End DoDot:1
+11 IF ENSN]""
WRITE !,"STATION ",ENSN
+12 QUIT
+13 ;
+14 ;ENFACTR