ENWOP ;(WASH ISC)/DLM/DH-Work Order Print ;4.7.97
;;7.0;ENGINEERING;**21,35**;Aug 17, 1993
; Expects ENSHKEY,ENBY
; ENSRT if ENBY="LOC"
EN N SPC
N IOINLOW,IOINHI D ZIS^ENUTL S ENPG=0
S %DT="T",X="N" D ^%DT S ENTOD=Y X ^DD("DD") S ENTOD("E")=Y W:$E(IOST,1,2)="C-" @IOF
ONE I '$D(ENSHKEY("ALL")) D
. S ENDNX="",ENQUIT=0
. I $O(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0 D Q
.. S ENQUIT=1
.. W !!,"There are no incomplete work orders for the ",$P(^DIC(6922,ENSHKEY,0),U)," shop."
.. I $E(IOST,1,2)="C-" W !!,"Press <RETURN> to continue..." R X:DTIME
. F Q:ENQUIT!($O(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0) D
.. D HDR
.. S ENDNX1=ENDNX ;I $D(XRTL) D T0^%ZOSV
.. D FDAT^ENWOP3 ;I $D(XRT0) S XRTN=$T(+0) D T1^%ZOSV
.. I ENWONX=0,ENPG=1 W !!,"There are no incomplete work orders that meet the search criteria",!,"in the ",$P(^DIC(6922,ENSHKEY,0),U)," Shop."
.. I $E(IOST,1,2)="C-" D
... I ENWONX=0 W !!,"Press <RETURN> to continue..."
... E D
.... I 'ENQUIT W !,"'^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: MORE// "
.... E W !,"1 TO ",ENWONX," FOR EXPANDED DISPLAY: EXIT//"
... R X:DTIME
... I X?1.2N,$D(ENWONX(X)) S DA=ENWONX(X) D EXPAND
... I $E($G(X))="^" S ENQUIT=1
ALL I $D(ENSHKEY("ALL")) D
. N ENSHKEY S ENABORT=0
. F ENSHKEY=0:0 S ENSHKEY=$O(^DIC(6922,ENSHKEY)) Q:ENABORT!(ENSHKEY'>0) D
.. S ENDNX="",ENQUIT=0 I IO'=IO(0) U IO(0) W "." U IO
.. F Q:ENQUIT!($O(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0) D
... D HDR
... S ENDNX1=ENDNX D FDAT^ENWOP3
... I ENWONX=0,ENDNX1="" W !!,"There are no incomplete work orders that meet the search criteria",!,"in the ",$P(^DIC(6922,ENSHKEY,0),U)," Shop."
... I $E(IOST,1,2)="C-",ENQUIT D Q
.... I ENWONX=0 W !!,"'^' TO EXIT; <RETURN> FOR NEXT SHOP: NEXT SHOP//"
.... E W !,"'^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: NEXT SHOP//"
.... R X:DTIME
.... I X?1.2N,$D(ENWONX(X)) S DA=ENWONX(X) D EXPAND
.... I $E($G(X))="^" S ENABORT=1
... I $E(IOST,1,2)="C-",'ENQUIT D
.... W !,"'^' FOR NEXT SHOP; '^^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: MORE//"
.... R X:DTIME
.... I X?1.2N,$D(ENWONX(X)) S DA=ENWONX(X) D EXPAND
.... I $E($G(X))="^" S ENQUIT=1
.... I $E($G(X),1,2)="^^" S ENABORT=1
G EXIT
;
HDR W:$E(IOST,1,2)="C-" IOINHI W:ENPG @IOF S ENPG=ENPG+1
W "INCOMPLETE WORK ORDERS ("_$P(^DIC(6922,ENSHKEY,0),U)_") "_ENTOD("E")_" Page "_ENPG
W !,"WORK ORDER",?18,"REQ DATE",?27,"LOCATION",?43,"EQUIP ID#",?54,"CONTACT",?68,"PRI.",?73,"STAT"
W !," EMPL ASSIGNED",?22,"TASK DESCRIPTION"
W !?2,"ACC #",?20,"S/P",?27,"VENDOR",?51,"P.O. #",?59,"EST.DEL.",?69,"DEL.COMP."
K X S $P(X,"-",79)="-" W !,X,!
D CLEAN
S ENY=5
Q
;
EXPAND ;Screen display work order
S ENDNX=ENDNX1,ENPG=ENPG-1,ENQUIT=0
D EDIT1^ENWOD
W @IOF
Q
;
CLEAN K X,ENWONX S ENWONX=0 W:$E(IOST,1,2)="C-" IOINLOW
Q
EXIT ;
K ENDNX,ENWONX,ENTOD,ENPG,ENQUIT,ENABORT,ENY,ENWO,ENDSTAT
W @IOF
S:$D(ZTQUEUED) ZTREQ="@"
K ENWOR,ENRDA,ENLOC,ENRBE,ENRQR,ENPRI,ENTEC,ENDPR,ENSTAT
K ENPMI,ENAC,DA,ENEQ,ENDNX1,ENSRT
K ENSHKEY("ALL")
Q
;ENWOP
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWOP 3088 printed Nov 22, 2024@17:06:34 Page 2
ENWOP ;(WASH ISC)/DLM/DH-Work Order Print ;4.7.97
+1 ;;7.0;ENGINEERING;**21,35**;Aug 17, 1993
+2 ; Expects ENSHKEY,ENBY
+3 ; ENSRT if ENBY="LOC"
EN NEW SPC
+1 NEW IOINLOW,IOINHI
DO ZIS^ENUTL
SET ENPG=0
+2 SET %DT="T"
SET X="N"
DO ^%DT
SET ENTOD=Y
XECUTE ^DD("DD")
SET ENTOD("E")=Y
if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
ONE IF '$DATA(ENSHKEY("ALL"))
Begin DoDot:1
+1 SET ENDNX=""
SET ENQUIT=0
+2 IF $ORDER(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0
Begin DoDot:2
+3 SET ENQUIT=1
+4 WRITE !!,"There are no incomplete work orders for the ",$PIECE(^DIC(6922,ENSHKEY,0),U)," shop."
+5 IF $EXTRACT(IOST,1,2)="C-"
WRITE !!,"Press <RETURN> to continue..."
READ X:DTIME
End DoDot:2
QUIT
+6 FOR
if ENQUIT!($ORDER(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0)
QUIT
Begin DoDot:2
+7 DO HDR
+8 ;I $D(XRTL) D T0^%ZOSV
SET ENDNX1=ENDNX
+9 ;I $D(XRT0) S XRTN=$T(+0) D T1^%ZOSV
DO FDAT^ENWOP3
+10 IF ENWONX=0
IF ENPG=1
WRITE !!,"There are no incomplete work orders that meet the search criteria",!,"in the ",$PIECE(^DIC(6922,ENSHKEY,0),U)," Shop."
+11 IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:3
+12 IF ENWONX=0
WRITE !!,"Press <RETURN> to continue..."
+13 IF '$TEST
Begin DoDot:4
+14 IF 'ENQUIT
WRITE !,"'^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: MORE// "
+15 IF '$TEST
WRITE !,"1 TO ",ENWONX," FOR EXPANDED DISPLAY: EXIT//"
End DoDot:4
+16 READ X:DTIME
+17 IF X?1.2N
IF $DATA(ENWONX(X))
SET DA=ENWONX(X)
DO EXPAND
+18 IF $EXTRACT($GET(X))="^"
SET ENQUIT=1
End DoDot:3
End DoDot:2
End DoDot:1
ALL IF $DATA(ENSHKEY("ALL"))
Begin DoDot:1
+1 NEW ENSHKEY
SET ENABORT=0
+2 FOR ENSHKEY=0:0
SET ENSHKEY=$ORDER(^DIC(6922,ENSHKEY))
if ENABORT!(ENSHKEY'>0)
QUIT
Begin DoDot:2
+3 SET ENDNX=""
SET ENQUIT=0
IF IO'=IO(0)
USE IO(0)
WRITE "."
USE IO
+4 FOR
if ENQUIT!($ORDER(^ENG(6920,"AINC",ENSHKEY,ENDNX))'>0)
QUIT
Begin DoDot:3
+5 DO HDR
+6 SET ENDNX1=ENDNX
DO FDAT^ENWOP3
+7 IF ENWONX=0
IF ENDNX1=""
WRITE !!,"There are no incomplete work orders that meet the search criteria",!,"in the ",$PIECE(^DIC(6922,ENSHKEY,0),U)," Shop."
+8 IF $EXTRACT(IOST,1,2)="C-"
IF ENQUIT
Begin DoDot:4
+9 IF ENWONX=0
WRITE !!,"'^' TO EXIT; <RETURN> FOR NEXT SHOP: NEXT SHOP//"
+10 IF '$TEST
WRITE !,"'^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: NEXT SHOP//"
+11 READ X:DTIME
+12 IF X?1.2N
IF $DATA(ENWONX(X))
SET DA=ENWONX(X)
DO EXPAND
+13 IF $EXTRACT($GET(X))="^"
SET ENABORT=1
End DoDot:4
QUIT
+14 IF $EXTRACT(IOST,1,2)="C-"
IF 'ENQUIT
Begin DoDot:4
+15 WRITE !,"'^' FOR NEXT SHOP; '^^' TO EXIT; 1 TO ",ENWONX," FOR EXPANDED DISPLAY: MORE//"
+16 READ X:DTIME
+17 IF X?1.2N
IF $DATA(ENWONX(X))
SET DA=ENWONX(X)
DO EXPAND
+18 IF $EXTRACT($GET(X))="^"
SET ENQUIT=1
+19 IF $EXTRACT($GET(X),1,2)="^^"
SET ENABORT=1
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+20 GOTO EXIT
+21 ;
HDR if $EXTRACT(IOST,1,2)="C-"
WRITE IOINHI
if ENPG
WRITE @IOF
SET ENPG=ENPG+1
+1 WRITE "INCOMPLETE WORK ORDERS ("_$PIECE(^DIC(6922,ENSHKEY,0),U)_") "_ENTOD("E")_" Page "_ENPG
+2 WRITE !,"WORK ORDER",?18,"REQ DATE",?27,"LOCATION",?43,"EQUIP ID#",?54,"CONTACT",?68,"PRI.",?73,"STAT"
+3 WRITE !," EMPL ASSIGNED",?22,"TASK DESCRIPTION"
+4 WRITE !?2,"ACC #",?20,"S/P",?27,"VENDOR",?51,"P.O. #",?59,"EST.DEL.",?69,"DEL.COMP."
+5 KILL X
SET $PIECE(X,"-",79)="-"
WRITE !,X,!
+6 DO CLEAN
+7 SET ENY=5
+8 QUIT
+9 ;
EXPAND ;Screen display work order
+1 SET ENDNX=ENDNX1
SET ENPG=ENPG-1
SET ENQUIT=0
+2 DO EDIT1^ENWOD
+3 WRITE @IOF
+4 QUIT
+5 ;
CLEAN KILL X,ENWONX
SET ENWONX=0
if $EXTRACT(IOST,1,2)="C-"
WRITE IOINLOW
+1 QUIT
EXIT ;
+1 KILL ENDNX,ENWONX,ENTOD,ENPG,ENQUIT,ENABORT,ENY,ENWO,ENDSTAT
+2 WRITE @IOF
+3 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 KILL ENWOR,ENRDA,ENLOC,ENRBE,ENRQR,ENPRI,ENTEC,ENDPR,ENSTAT
+5 KILL ENPMI,ENAC,DA,ENEQ,ENDNX1,ENSRT
+6 KILL ENSHKEY("ALL")
+7 QUIT
+8 ;ENWOP