Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ENWONEW1

ENWONEW1.m

Go to the documentation of this file.
  1. ENWONEW1 ;(WASH ISC)/DLM/JED/DH/SAB-Work Order Transfer ;5/8/1998
  1. ;;7.0;ENGINEERING;**1,35,53**;Aug 17, 1993
  1. TRANS ;Entry point
  1. N SHOPKEY,NEWSHOP,CODE,NUMBER,DONE,WARD
  1. S U="^",DONE=0 I $D(ENSHKEY),ENSHKEY>0 S DIC("B")=$P(^DIC(6922,ENSHKEY,0),U)
  1. S DIC="^DIC(6922,",DIC(0)="AEQM" D ^DIC S:Y>0 SHOPKEY=+Y K DIC
  1. Q:'$D(SHOPKEY)
  1. S DR=$S($D(^DIE("B","ENZWOXFER")):"[ENZWOXFER]",1:"[ENWOXFER]")
  1. NEXT ;Loop thru (.) code until DONE
  1. F D Q:DONE
  1. . W !!,"Transfer a work order from ",$P(^DIC(6922,SHOPKEY,0),U)," to another shop?"
  1. . S DIR(0)="Y",DIR("B")=$S($D(CODE):"NO",1:"YES")
  1. . D ^DIR I Y'>0 S DONE=1 Q
  1. . S DIC("S")="I $P($G(^(5)),U,2)="""",$P($G(^(2)),U)=SHOPKEY,$E($P(^(0),U),1,3)'=""PM-"""
  1. . D WO^ENWOUTL Q:Y'>0 S DA=+Y
  1. . L +^ENG(6920,DA):5 I '$T W !,*7,"This work order is being edited by another user. Please try again later." Q
  1. . 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
  1. . S DIC="^DIC(6922,",DIC(0)="AEQ",DIC("A")="Transfer to which shop: "
  1. . ; set a screen to prevent selection of same shop
  1. . S DIC("S")="I Y'="_SHOPKEY
  1. . D ^DIC K DIC("A"),DIC("S") I Y'>0 L -^ENG(6920,DA) Q
  1. . S NEWSHOP=+Y
  1. . S NUMBER="" D NEWNUM W:NUMBER]"" !,"New WORK ORDER #: ",NUMBER
  1. . I NUMBER="" D
  1. .. L -^ENG(6920,DA)
  1. .. W !!,*7,"Work order transfer unsuccessful."
  1. .. W !,"Please try again later or contact your IRM Service."
  1. . Q:NUMBER=""
  1. . W !,"Edit this work order?"
  1. . S DIR(0)="Y",DIR("B")="YES"
  1. . D ^DIR I Y>0 S DIE="^ENG(6920," D ^DIE
  1. . L -^ENG(6920,DA)
  1. . S WARD=0 S SHOPKEY(0)=SHOPKEY,SHOPKEY=NEWSHOP D WOPRNT^ENWONEW S SHOPKEY=SHOPKEY(0)
  1. Q
  1. ;
  1. NEWNUM ;Change the WORK ORDER #
  1. N DR
  1. I '$D(DT) S %DT="",X="T" D ^%DT S DT=+Y
  1. S CODE=$P(^DIC(6922,NEWSHOP,0),U,2)_$E(DT,2,7)_"-"
  1. L +^ENG(6920,"B"):20 Q:'$T
  1. 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
  1. I NUMBER]"" S DIE="^ENG(6920,",DR=".01///"_NUMBER_";9///"_NEWSHOP D ^DIE
  1. L -^ENG(6920,"B")
  1. Q
  1. ;ENWONEW1