source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQ4.m@ 1474

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

revised back to 6/30/08 version

File size: 2.3 KB
Line 
1ENEQ4 ;WIRMFO/SAB-PURGE EQUIPMENT INV FILE ;2.25.97
2 ;;7.0;ENGINEERING;**40**;Aug 17, 1993
3 ;
4DEL ;Delete Equipment Record entry
5 S ENEDNX=$D(^XUSEC("ENEDNX",DUZ))
6 W !!,"This option completely deletes a specific equipment record. If"
7 W !,"you would rather move equipment records to an archive media, then"
8 W !,"exit this option and use the Engineering Archive Module instead."
9DELSEQ ; select equipment record for deletion
10 W !
11 D GETEQ^ENUTL G:Y'>0 DELX
12 S ENDA=+Y
13 F ENI=0,1,2,3 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
14 ;
15 ; display equipment data
16 W @IOF
17 W !,"ENTRY #: ",ENDA
18 W !!,?2,"MFGR EQUIP NAME: ",$P(ENY(0),U,2)
19 W !,?2,"EQUIP CATEGORY: ",$$GET1^DIQ(6914,ENDA,6)
20 W !,?2,"CSN: ",$$GET1^DIQ(6914,ENDA,18)
21 S ENX=$$GET1^DIQ(6914,ENDA,"18:2") I ENX]"" W " (",ENX,")"
22 W !!,?2,"MANUFACTURER: ",$$GET1^DIQ(6914,ENDA,1)
23 W !,?2,"MODEL: ",$P(ENY(1),U,2),?42,"SERIAL #: ",$P(ENY(1),U,3)
24 W !!,?2,"CMR: ",$$GET1^DIQ(6914,ENDA,19)
25 W ?42,"USE STATUS: ",$$GET1^DIQ(6914,ENDA,20)
26 W !,?2,"ACQUISITION DATE: ",$$FMTE^XLFDT($P(ENY(2),U,4))
27 W ?34,"LE: ",$P(ENY(2),U,6)
28 W ?42,"DISPOSITION DATE: ",$$FMTE^XLFDT($P(ENY(3),U,11)),!
29 ;
30 ; validate selection
31 K ENV
32 S ENX=$$CHKFA^ENFAUTL(ENDA)
33 I +ENX S ENV(1)="It is currently reported to Fixed Assets in Austin."
34 E I $P(ENX,U,2)]"" S ENV(2)="It was previously reported to Fixed Assets in Austin."
35 I $P(ENY(0),U,4)="NX",'ENEDNX S ENV(3)="Security key ENEDNX is required to delete NX equipment."
36 I $P(ENY(3),U,1)=1 S ENV(4)="USE STATUS is IN USE."
37 I $P(ENY(3),U,11)="" S ENV(5)="DISPOSITION DATE is blank."
38 I $D(ENV) D G DELSEQ
39 . W $C(7),!,"This equipment entry can not be deleted because:"
40 . S ENI=0 F S ENI=$O(ENV(ENI)) Q:'ENI W !,?2,ENV(ENI)
41 ;
42 ; confirm deletion
43 S DIR(0)="Y",DIR("A")="Delete this entry"
44 D ^DIR K DIR G:$D(DIRUT) DELX I 'Y G DELSEQ
45 ;
46 ; first close any open work orders
47 S ENTXT(1)="Automatically closed when equipment record was deleted."
48 S DA=0 F S DA=$O(^ENG(6920,"G",ENDA,DA)) Q:'DA I $P($G(^ENG(6920,DA,5)),U,2)="" D
49 . D WP^DIE(6920,DA_",",40,"A","ENTXT")
50 . S DIE="^ENG(6920,",DR="36///T;32///^S X=""COMPLETED"""
51 . D ^DIE
52 K DIE,DR,ENTXT
53 ; then delete equipment
54 S DIK="^ENG(6914,",DA=ENDA D ^DIK K DIK
55 W !,"Equipment entry # ",ENDA," was deleted."
56 ;
57 G DELSEQ
58 ;
59DELX ; delete equipment record exit
60 K DA,DIC,DIE,DIK,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
61 K END,ENDA,ENEDNX,ENI,ENV,ENWO,ENX,ENY
62 Q
63 ;
64 ;ENEQ4
Note: See TracBrowser for help on using the repository browser.