ENEQNX5 ;(WASH ISC)/DH-Manual Update of Equipment Inventory ;9.26.97
;;7.0;ENGINEERING;**35,43**;Aug 17, 1993
EN ;Update NX Inventory (Single record mode)
DIC W @IOF,!! D GETEQ^ENUTL G:Y'>0 EXIT S DA=+Y
I '$D(^ENG(6914,DA)) S ENMSG="RECORD NOT FOUND.",ENMSG(0,1)="Suspect database degrade." D XCPTN^ENEQNX1 G DIC
S EN(2)=$S($D(^ENG(6914,DA,2)):^(2),1:""),EN(3)=$S($D(^(3)):^(3),1:"") S ENLOC=$P(EN(3),U,5),ENOLDLOC=$P(EN(3),U,8),ENINVDT=$P(EN(2),U,13) I ENINVDT]"" S Y=ENINVDT X ^DD("DD") S ENINVDT=Y
I ENLOC=+ENLOC,$D(^ENG("SP",ENLOC,0)) S ENLOC=$P(^(0),U)
W !!,"Entry Number: ",DA S ENPMN=$P(EN(3),U,6) I ENPMN]"" W ?30,"PM Number: ",ENPMN
W !,?5,"Location: ",ENLOC,?30,"Previous location: ",ENOLDLOC
W !,?5,"Last inventoried: ",ENINVDT
CNFRM W !!,"Do you wish to update this record" S %=1 D YN^DICN G:%=0 CNFRM G:%'=1 DIC
S DIE="^ENG(6914,",DR="24;23///^S X=""T""" D ^DIE
G DIC
;
UPDT(DA,ENDT,ENLOC) ; Update PHYSICAL INVENTORY DATE
;
; DA => IEN to Equipment File (not returned)
; ENDT => Date (internal format)
; ENLOC => Location from Work Order (internal format)
; Called by work order routines, mainly PM close-out
;
Q:DA']"" Q:'$D(^ENG(6914,DA,0))
N CURNT,DIE,DR
S CURNT=$P($G(^ENG(6914,DA,2)),U,13)
S DIE="^ENG(6914,"
I ENDT>CURNT D
. S DR="23///^S X=ENDT" D ^DIE
. I ENLOC]"",$D(^ENG("SP",ENLOC,0)),ENLOC'=$P($G(^ENG(6914,DA,3)),U,5) S DR="24////^S X=ENLOC" D ^DIE
K DA
Q
;
EXIT K EN,ENLOC,ENOLDLOC,ENINVDT,DA,ENPMN
Q
;ENEQNX5
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQNX5 1506 printed Dec 13, 2024@01:52:39 Page 2
ENEQNX5 ;(WASH ISC)/DH-Manual Update of Equipment Inventory ;9.26.97
+1 ;;7.0;ENGINEERING;**35,43**;Aug 17, 1993
EN ;Update NX Inventory (Single record mode)
DIC WRITE @IOF,!!
DO GETEQ^ENUTL
if Y'>0
GOTO EXIT
SET DA=+Y
+1 IF '$DATA(^ENG(6914,DA))
SET ENMSG="RECORD NOT FOUND."
SET ENMSG(0,1)="Suspect database degrade."
DO XCPTN^ENEQNX1
GOTO DIC
+2 SET EN(2)=$SELECT($DATA(^ENG(6914,DA,2)):^(2),1:"")
SET EN(3)=$SELECT($DATA(^(3)):^(3),1:"")
SET ENLOC=$PIECE(EN(3),U,5)
SET ENOLDLOC=$PIECE(EN(3),U,8)
SET ENINVDT=$PIECE(EN(2),U,13)
IF ENINVDT]""
SET Y=ENINVDT
XECUTE ^DD("DD")
SET ENINVDT=Y
+3 IF ENLOC=+ENLOC
IF $DATA(^ENG("SP",ENLOC,0))
SET ENLOC=$PIECE(^(0),U)
+4 WRITE !!,"Entry Number: ",DA
SET ENPMN=$PIECE(EN(3),U,6)
IF ENPMN]""
WRITE ?30,"PM Number: ",ENPMN
+5 WRITE !,?5,"Location: ",ENLOC,?30,"Previous location: ",ENOLDLOC
+6 WRITE !,?5,"Last inventoried: ",ENINVDT
CNFRM WRITE !!,"Do you wish to update this record"
SET %=1
DO YN^DICN
if %=0
GOTO CNFRM
if %'=1
GOTO DIC
+1 SET DIE="^ENG(6914,"
SET DR="24;23///^S X=""T"""
DO ^DIE
+2 GOTO DIC
+3 ;
UPDT(DA,ENDT,ENLOC) ; Update PHYSICAL INVENTORY DATE
+1 ;
+2 ; DA => IEN to Equipment File (not returned)
+3 ; ENDT => Date (internal format)
+4 ; ENLOC => Location from Work Order (internal format)
+5 ; Called by work order routines, mainly PM close-out
+6 ;
+7 if DA']""
QUIT
if '$DATA(^ENG(6914,DA,0))
QUIT
+8 NEW CURNT,DIE,DR
+9 SET CURNT=$PIECE($GET(^ENG(6914,DA,2)),U,13)
+10 SET DIE="^ENG(6914,"
+11 IF ENDT>CURNT
Begin DoDot:1
+12 SET DR="23///^S X=ENDT"
DO ^DIE
+13 IF ENLOC]""
IF $DATA(^ENG("SP",ENLOC,0))
IF ENLOC'=$PIECE($GET(^ENG(6914,DA,3)),U,5)
SET DR="24////^S X=ENLOC"
DO ^DIE
End DoDot:1
+14 KILL DA
+15 QUIT
+16 ;
EXIT KILL EN,ENLOC,ENOLDLOC,ENINVDT,DA,ENPMN
+1 QUIT
+2 ;ENEQNX5