source: FOIAVistA/trunk/r/ENGINEERING-EN/ENFAXMT.m@ 1765

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1ENFAXMT ;WCIOFO/KLD/DH/SAB; TRANSMIT FAP RECORDS ; 12/16/1998
2 ;;7.0;ENGINEERING;**29,33,39,57,60**;Aug 17, 1993
3 ; This routine should not be modified.
4 ;
5 ; Input
6 ; ENEQ("DA") - equipment entry number
7 ; ENFAP("DOC") - type of FAP document
8 ; ENFA("DA") or ENFB("DA")... - ien of document
9ST K X F I=0:1:3,8,9 S ENEQ(I)=$G(^ENG(6914,ENEQ("DA"),I))
10 S ENFAP("STATION")=$P(ENEQ(9),U,5) ;Owning station
11 I '$D(ENFAP("FY")) S ENFAP("FY")=$E($E(DT,1,3)+$E(DT,4),2,3)
12COUNT ;Update document counter
13 S:'$D(ENFAP("SITE")) ENFAP("SITE")=+^ENG(6915.1,1,0)
14 S DIC="^ENG(6915.1,",DIC(0)="M",X=ENFAP("SITE") D ^DIC
15 L +^ENG(6915.1,+Y):5
16 S X=$S(ENFAP("DOC")="FR":6,1:$A(ENFAP("DOC"),2)-63) ; piece in node
17 S ENFAP("COUNT")=$P(^ENG(6915.1,+Y,0),U,X)+1
18 S:ENFAP("COUNT")>9999 ENFAP("COUNT")=1
19 S $P(^ENG(6915.1,+Y,0),U,X)=ENFAP("COUNT")
20 L -^ENG(6915.1,+Y)
21 S ENFAP("COUNT")="000"_ENFAP("COUNT"),ENFAP("COUNT")=$E(ENFAP("COUNT"),$L(ENFAP("COUNT"))-3,$L(ENFAP("COUNT")))
22FX1 ; set up first 4 fields of first data segment
23 S ENFAP("AO")=$$GET1^DIQ(6914,ENEQ("DA"),63)
24 S ENFAP("FUND")=$$GET1^DIQ(6914,ENEQ("DA"),62)
25 S ENFAP("CFO")=$S(ENFAP("AO")=10:"01",ENFAP("AO")=40:"05",ENFAP("AO")=20:"02",ENFAP("AO")="02":"06",ENFAP("AO")="00":"05",1:10)
26 S ENFAP("TRANS")=$S(ENFAP("STATION")]"":$E(ENFAP("STATION"),1,3),1:ENFAP("SITE"))_$E(ENFAP("FY"),2)_"N"_ENFAP("COUNT")
27 S X(1)=ENFAP("DOC")_"1"_U_ENFAP("DOC")_U_ENFAP("AO")_U_ENFAP("TRANS")
28 ; add remaining data to first segment
29FA I ENFAP("DOC")="FA" D
30 . D FANUM^ENFAXMT3(1)
31 . S ENFAP("GRP")=$$GROUP^ENFAVAL($$GET1^DIQ(6914,ENEQ("DA"),18))
32 . S ENFAP("CMR")=$E($$GET1^DIQ(6914,ENEQ("DA"),19),1,5)
33 . S ENFAP("LOC")=$$LOC^ENFAVAL(ENFAP("CMR"))
34 . S X(1)=X(1)_U_ENFAP("GRP")_U_ENFAP("LOC")
35 . D BUDFY^ENFAXMT3($P(ENEQ(9),U,7))
36 . S X(1)=X(1)_"^^"_ENFAP("FUND")_U_ENFAP("AO")
37 . D XORG,XPROG^ENFAXMT3
38 . S X(1)=X(1)_U_$$GET1^DIQ(6914,ENEQ("DA"),61)_U_$$GET1^DIQ(6914,ENEQ("DA"),18)
39 . D ACQTIME,ACQMETH,XAREA,FUNDSRC
40 . I ENFAP("TY")="X" S X(1)=X(1)_"^^^^^^" ; excessed
41 . E D REPLTIME,LIFEXP,SALDEPM
42 . D SUMAV,COSTCEN
43 . D SUBORG
44 . S $P(X(1),U,33)="~"
45FB I ENFAP("DOC")="FB" D
46 . S X(1)=X(1)_"^^^^^"
47 . D FANUM^ENFAXMT3(1) S X(1)=X(1)_U_$P(ENFAP(3),U,7,8)
48 . D CVTDATE($P($G(^ENG(6915.3,ENFB("DA"),100)),U))
49 . S X(1)=X(1)_U_$P(ENFAP(3),U,12)
50 . S $P(X(1),U,26)="~"
51FC I ENFAP("DOC")="FC" D
52 . S X(1)=X(1)_"^^^^^"
53 . D BUDFY^ENFAXMT3($P(ENEQ(9),U,7))
54 . S X(1)=X(1)_"^" ;No END BUDGET FY
55 . D FANUM^ENFAXMT3(1) S X(1)=X(1)_U_$P(ENFAP(3),U,8)
56 . I $P(ENFAP(3),U,8)="00" D Q ;FC against an FA
57 . . S X=$$GROUP^ENFAVAL($$GET1^DIQ(6915.4,ENFC("DA"),100))
58 . . S X(1)=X(1)_U_$S(X="0":"",1:X) ; csn may not have been entered
59 . . S X(1)=X(1)_U_$$LOC^ENFAVAL($$GET1^DIQ(6915.4,ENFC("DA"),101))
60 . . S X(1)=X(1)_U_$$GET1^DIQ(6915.4,ENFC("DA"),100) ;Description (CSN)
61 . . D ACQTIME,ACQMETH S $P(X(1),U,32)="~"
62 . S X(1)=X(1)_"^^" ;FC against a betterment
63 . S X(1)=X(1)_U_$P(ENFAP(3),U,11)
64 . D CVTDATE($P(ENFAP(100),U,6)) ; acquisition date from FC
65 . S X(1)=X(1)_U_$P(ENFAP(3),U,15) ; acquisition method from FC
66 . S $P(X(1),U,32)="~"
67FD I ENFAP("DOC")="FD" D
68 . S X(1)=X(1)_"^^^^^"
69 . D BUDFY^ENFAXMT3($P(ENEQ(9),U,7))
70 . S $P(X(1),U,12)="~"
71FR I ENFAP("DOC")="FR" D
72 . S X(1)=X(1)_"^^^^^"
73 . D FANUM^ENFAXMT3(1)
74 . S X(1)=X(1)_U_$P(^ENG(6915.6,ENFR("DA"),3),U,7,8)_"^^"_$P(^(3),U,9,18)
75 . S $P(X(1),U,25)="~"
76 ;end of Fx1 document
77 D:ENFAP("DOC")'="FR" ^ENFAXMT1
78 D SEND^ENFAXMT2
79 ;
80K K X,Y ;Campground cleanup performed by calling routine
81 Q
82 ;
83FUNDXDIV S X(1)=X(1)_U_ENFAP("FUND")_U_ENFAP("AO") Q
84 ;
85XORG S X(1)=X(1)_U_$E(ENFAP("STATION"),1,3) Q
86 ;
87ACQTIME S X=$P(ENEQ(2),U,4)
88 S X(1)=X(1)_U_($E(X,1,3)+1700)_U_$E(X,4,5)_U_$E(X,6,7)
89 Q
90 ;
91ACQMETH S X(1)=X(1)_U_$P(ENEQ(3),U,4) Q
92 ;
93XAREA S X(1)=X(1)_U_ENFAP("CMR") Q
94 ;
95FUNDSRC S X(1)=X(1)_U_$E($P(ENEQ(2),U,4),2,3)_$E(ENFAP("FUND"),1,4)_ENFAP("CFO") Q
96 ;
97REPLTIME S X=$P(ENEQ(2),U,10)
98 I X="" S X(1)=X(1)_"^^^" Q
99 S X(1)=X(1)_U_($E(X,1,3)+1700)_U_$E(X,4,5)_U_$E(X,6,7) Q
100 ;
101LIFEXP S X(1)=X(1)_U_$P(ENEQ(2),U,6) Q
102SALDEPM S X(1)=X(1)_"^0.00^SL" Q ;Salvage value & Deprec. method
103 ;
104SUMAV ;Summary asset value
105 S X(1)=X(1)_U_$P(ENEQ(2),U,3) Q
106 ;
107COSTCEN S X(1)=X(1)_U_$$GET1^DIQ(6914,ENEQ("DA"),"19:10") ; cost center num
108 S X(1)=X(1)_U ; not passing sub-cost center
109 Q
110 ;
111SUBORG ;Used for satellite designator
112 I $E(ENFAP("STATION"),4,5)?2UN S X(1)=X(1)_U_$E(ENFAP("STATION"),4,5)
113 E S X(1)=X(1)_U
114 Q
115CVTDATE(ENX) ; year^month^date from FileMan date
116 I ENX="" S X(1)=X(1)_"^^^" Q
117 S X(1)=X(1)_U_($E(ENX,1,3)+1700)_U_$E(ENX,4,5)_U_$E(ENX,6,7) Q
118 ;ENFAXMT
Note: See TracBrowser for help on using the repository browser.