source: FOIAVistA/trunk/r/ENGINEERING-EN/ENWONEW1.m@ 677

Last change on this file since 677 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1ENWONEW1 ;(WASH ISC)/DLM/JED/DH/SAB-Work Order Transfer ;5/8/1998
2 ;;7.0;ENGINEERING;**1,35,53**;Aug 17, 1993
3TRANS ;Entry point
4 N SHOPKEY,NEWSHOP,CODE,NUMBER,DONE,WARD
5 S U="^",DONE=0 I $D(ENSHKEY),ENSHKEY>0 S DIC("B")=$P(^DIC(6922,ENSHKEY,0),U)
6 S DIC="^DIC(6922,",DIC(0)="AEQM" D ^DIC S:Y>0 SHOPKEY=+Y K DIC
7 Q:'$D(SHOPKEY)
8 S DR=$S($D(^DIE("B","ENZWOXFER")):"[ENZWOXFER]",1:"[ENWOXFER]")
9NEXT ;Loop thru (.) code until DONE
10 F D Q:DONE
11 . W !!,"Transfer a work order from ",$P(^DIC(6922,SHOPKEY,0),U)," to another shop?"
12 . S DIR(0)="Y",DIR("B")=$S($D(CODE):"NO",1:"YES")
13 . D ^DIR I Y'>0 S DONE=1 Q
14 . S DIC("S")="I $P($G(^(5)),U,2)="""",$P($G(^(2)),U)=SHOPKEY,$E($P(^(0),U),1,3)'=""PM-"""
15 . D WO^ENWOUTL Q:Y'>0 S DA=+Y
16 . L +^ENG(6920,DA):5 I '$T W !,*7,"This work order is being edited by another user. Please try again later." Q
17 . I $D(^ENG(6920,DA,5)),$P(^(5),U,2)]"" W !,*7,"This work order has already been closed out. Transfer aborted." L -^ENG(6920,DA) Q
18 . S DIC="^DIC(6922,",DIC(0)="AEQ",DIC("A")="Transfer to which shop: "
19 . ; set a screen to prevent selection of same shop
20 . S DIC("S")="I Y'="_SHOPKEY
21 . D ^DIC K DIC("A"),DIC("S") I Y'>0 L -^ENG(6920,DA) Q
22 . S NEWSHOP=+Y
23 . S NUMBER="" D NEWNUM W:NUMBER]"" !,"New WORK ORDER #: ",NUMBER
24 . I NUMBER="" D
25 .. L -^ENG(6920,DA)
26 .. W !!,*7,"Work order transfer unsuccessful."
27 .. W !,"Please try again later or contact your IRM Service."
28 . Q:NUMBER=""
29 . W !,"Edit this work order?"
30 . S DIR(0)="Y",DIR("B")="YES"
31 . D ^DIR I Y>0 S DIE="^ENG(6920," D ^DIE
32 . L -^ENG(6920,DA)
33 . S WARD=0 S SHOPKEY(0)=SHOPKEY,SHOPKEY=NEWSHOP D WOPRNT^ENWONEW S SHOPKEY=SHOPKEY(0)
34 Q
35 ;
36NEWNUM ;Change the WORK ORDER #
37 N DR
38 I '$D(DT) S %DT="",X="T" D ^%DT S DT=+Y
39 S CODE=$P(^DIC(6922,NEWSHOP,0),U,2)_$E(DT,2,7)_"-"
40 L +^ENG(6920,"B"):20 Q:'$T
41 F I=1:1 S X=CODE_$S(I<10:"00"_I,I<100:"0"_I,1:I) I '$D(^ENG(6920,"B",X)),'$D(^ENG(6920,"H",X)) S NUMBER=X Q
42 I NUMBER]"" S DIE="^ENG(6920,",DR=".01///"_NUMBER_";9///"_NEWSHOP D ^DIE
43 L -^ENG(6920,"B")
44 Q
45 ;ENWONEW1
Note: See TracBrowser for help on using the repository browser.