ENFACTE ;(WCIOFO)/SAB-FAP CAPITALIZATION THRESHOLD EDIT ;5/22/2002
;;7.0;ENGINEERING;**63,71**;August 17, 1993
;
N ENCMR,ENCSN,ENDA,ENL,ENTSK,X,Y
S ENL=$$REPEAT^XLFSTR("-",IOM-1)
;
ASKEQ ; ask equipment
;S DIC("S")="I $$CHKFA^ENFAUTL(+Y)>0" ; ?screen for reported to FAP
W !! D GETEQ^ENUTL G:Y'>0 EXIT S ENDA=+Y
S ENCMR=$E($$GET1^DIQ(6914,ENDA,19),1,5)
S ENCSN=$$GET1^DIQ(6914,ENDA,18)
;
; display info
W !,ENL
W !,"ENTRY #: ",ENDA,?24,"CMR: ",ENCMR
W ?38,"ASSET VALUE: ",$FN($$GET1^DIQ(6914,ENDA,12),",",2)
W !,"CSN: ",ENCSN
I ENCSN]"" W " (",$$GET1^DIQ(6914,ENDA,"18:2"),")"
W !
;
; lock pseudo node to avoid conflict with equipment edit options
; since field 99 will not be updated by those options
L +^ENG(6914,"RC",ENDA):2 I '$T D G ASKEQ
. W $C(7)
. W !,"Another user is currently editing this item with this option."
. W !,"Please try again later."
;
; determine and display current status related to task
S ENTSK=$$CHKEXP^ENFACTU(ENDA)
I $P(ENTSK,U)=0 D
. W !,"This equipment will not be expensed by the task because"
. W !," ",$P(ENTSK,U,2)
I $P(ENTSK,U)="U" D
. W !,"This equipment will not be expensed by the task solely because"
. W !," ",$P(ENTSK,U,2)," indicated that it should remain capitalized."
I $P(ENTSK,U)=1 D
. W !,"This equipment will be expensed by the task."
;
; if item meets critera to expense (or was exempted by user) then edit
I $P(ENTSK,U)'=0 D
. W !
. S DIR(0)="Y",DIR("B")=$S($P(ENTSK,U)="U":"YES",1:"NO")
. S DIR("A")="Should this item remain capitalized"
. S DIR("?",1)="Enter YES to exempt this equipment item from being expensed"
. S DIR("?",2)="by the one-time task that will run on July 24, 2002."
. S DIR("?",3)="Enter NO if the item should be expensed by the task."
. S DIR("?",4)=" "
. S DIR("?")="Enter YES or NO"
. D ^DIR K DIR Q:$D(DIRUT)
. S DR=""
. I Y,$P(ENTSK,U)=1 S DR="99////^S X=DUZ" ; exempts from task
. I 'Y,$P(ENTSK,U)="U" S DR="99///@" ; removes exemption
. I DR]"" S DA=ENDA,DIE="^ENG(6914," D ^DIE K DIE,DA
. K DR
;
; unlock
L -^ENG(6914,"RC",ENDA)
;
G ASKEQ
;
EXIT ;
K DIROUT,DIRUT,DTOUT,DUOUT
Q
;ENFACTE
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENFACTE 2195 printed Dec 13, 2024@01:53:23 Page 2
ENFACTE ;(WCIOFO)/SAB-FAP CAPITALIZATION THRESHOLD EDIT ;5/22/2002
+1 ;;7.0;ENGINEERING;**63,71**;August 17, 1993
+2 ;
+3 NEW ENCMR,ENCSN,ENDA,ENL,ENTSK,X,Y
+4 SET ENL=$$REPEAT^XLFSTR("-",IOM-1)
+5 ;
ASKEQ ; ask equipment
+1 ;S DIC("S")="I $$CHKFA^ENFAUTL(+Y)>0" ; ?screen for reported to FAP
+2 WRITE !!
DO GETEQ^ENUTL
if Y'>0
GOTO EXIT
SET ENDA=+Y
+3 SET ENCMR=$EXTRACT($$GET1^DIQ(6914,ENDA,19),1,5)
+4 SET ENCSN=$$GET1^DIQ(6914,ENDA,18)
+5 ;
+6 ; display info
+7 WRITE !,ENL
+8 WRITE !,"ENTRY #: ",ENDA,?24,"CMR: ",ENCMR
+9 WRITE ?38,"ASSET VALUE: ",$FNUMBER($$GET1^DIQ(6914,ENDA,12),",",2)
+10 WRITE !,"CSN: ",ENCSN
+11 IF ENCSN]""
WRITE " (",$$GET1^DIQ(6914,ENDA,"18:2"),")"
+12 WRITE !
+13 ;
+14 ; lock pseudo node to avoid conflict with equipment edit options
+15 ; since field 99 will not be updated by those options
+16 LOCK +^ENG(6914,"RC",ENDA):2
IF '$TEST
Begin DoDot:1
+17 WRITE $CHAR(7)
+18 WRITE !,"Another user is currently editing this item with this option."
+19 WRITE !,"Please try again later."
End DoDot:1
GOTO ASKEQ
+20 ;
+21 ; determine and display current status related to task
+22 SET ENTSK=$$CHKEXP^ENFACTU(ENDA)
+23 IF $PIECE(ENTSK,U)=0
Begin DoDot:1
+24 WRITE !,"This equipment will not be expensed by the task because"
+25 WRITE !," ",$PIECE(ENTSK,U,2)
End DoDot:1
+26 IF $PIECE(ENTSK,U)="U"
Begin DoDot:1
+27 WRITE !,"This equipment will not be expensed by the task solely because"
+28 WRITE !," ",$PIECE(ENTSK,U,2)," indicated that it should remain capitalized."
End DoDot:1
+29 IF $PIECE(ENTSK,U)=1
Begin DoDot:1
+30 WRITE !,"This equipment will be expensed by the task."
End DoDot:1
+31 ;
+32 ; if item meets critera to expense (or was exempted by user) then edit
+33 IF $PIECE(ENTSK,U)'=0
Begin DoDot:1
+34 WRITE !
+35 SET DIR(0)="Y"
SET DIR("B")=$SELECT($PIECE(ENTSK,U)="U":"YES",1:"NO")
+36 SET DIR("A")="Should this item remain capitalized"
+37 SET DIR("?",1)="Enter YES to exempt this equipment item from being expensed"
+38 SET DIR("?",2)="by the one-time task that will run on July 24, 2002."
+39 SET DIR("?",3)="Enter NO if the item should be expensed by the task."
+40 SET DIR("?",4)=" "
+41 SET DIR("?")="Enter YES or NO"
+42 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+43 SET DR=""
+44 ; exempts from task
IF Y
IF $PIECE(ENTSK,U)=1
SET DR="99////^S X=DUZ"
+45 ; removes exemption
IF 'Y
IF $PIECE(ENTSK,U)="U"
SET DR="99///@"
+46 IF DR]""
SET DA=ENDA
SET DIE="^ENG(6914,"
DO ^DIE
KILL DIE,DA
+47 KILL DR
End DoDot:1
+48 ;
+49 ; unlock
+50 LOCK -^ENG(6914,"RC",ENDA)
+51 ;
+52 GOTO ASKEQ
+53 ;
EXIT ;
+1 KILL DIROUT,DIRUT,DTOUT,DUOUT
+2 QUIT
+3 ;ENFACTE