source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENFAR3.m@ 1375

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1ENFAR3 ;WIRMFO/SAB-FIXED ASSET RPT, CHECK OF EQUIP CAPITALIZATION ;5/29/2002
2 ;;7.0;ENGINEERING;**25,63,71**;Aug 17, 1993
3 ;-----------------------------------------------------------------
4 ;Patch 71 Increases Threshold from $25,000.00 to $100,000.00
5 ;
6 ;ENCAP = Investment Category
7 ;ENSGL = Standard General Ledger
8 ; ENCT = Capitalization Threshold
9 ;ENTYI = Type of Entry
10 ;
11 ;-----------------------------------------------------------------
12EN W !,"This report searches the entire equipment file and may take some"
13 W !,"time to complete. Consider queuing this report to run after-hours."
14 ; ask device
15 S %ZIS="QM" D ^%ZIS G:POP EXIT
16 I $D(IO("Q")) D G EXIT
17 . S ZTRTN="QEN^ENFAR3",ZTDESC="Check of Equipment Capitalization"
18 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
19QEN ; queued entry
20 U IO
21 S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
22 S ENL="",$P(ENL,"-",IOM)=""
23 D HD
24 ;
25 ;The new capitalization threshold of 100K will take effect for
26 ;this report after the 1-time job runs on July 24, 2002 (3020724).
27 S ENCT=$S(DT>3020724:100000,1:25000)
28 ;
29 ; loop thru equipment file
30 S ENT=0
31 S ENDA=0 F S ENDA=$O(^ENG(6914,ENDA)) Q:'ENDA D Q:END
32 . Q:$P($G(^ENG(6914,ENDA,3)),U,11)]"" ; ignore dispositioned items
33 . S ENY2=$G(^ENG(6914,ENDA,2)),ENY8=$G(^ENG(6914,ENDA,8))
34 . S ENTYI=$P($G(^ENG(6914,ENDA,0)),U,4) ;TYPE OF ENTRY (#7)
35 . S ENVAL=$P(ENY2,U,3) ;TOTAL ASSET VALUE (#12)
36 . S X=$P(ENY2,U,9),ENCMR=$S(X:$P($G(^ENG(6914.1,X,0)),U),1:X)
37 . ;;S X=$P(ENY8,U,2),ENCAP=$S(X=1:"YES",X=0:"NO",1:X)
38 . S ENCAP=$P(ENY8,U,2) ;INVESTMENT CATEGORY (#34)
39 . ;
40 . ;ENSGL = Standard General Ledger (#38)
41 . S X=$P(ENY8,U,6),ENSGL=$S(X:$P($G(^ENG(6914.3,X,0)),U),1:X)
42 . K ENY2,ENY8
43 . ; perform checks
44 . K EN S ENC=0
45 . I ENCAP'=1,ENVAL'<ENCT,ENTYI="NX"!(ENTYI="") D
46 . . S ENC=ENC+1,EN(ENC)="Check capitalization"
47 . ;
48 . ;Investment Category (1) is Capitalized/Accountable
49 . I ENCAP=1 D
50 . . I ENTYI="" S ENC=ENC+1,EN(ENC)="Type Entry is blank"
51 . . I ENTYI="NX" D
52 . . . I ENVAL<ENCT S ENC=ENC+1,EN(ENC)="Check capitalization"
53 . . . I $$LOC^ENFAVAL(ENCMR)="" S ENC=ENC+1,EN(ENC)="Check CMR"
54 . . . I ENSGL="" S ENC=ENC+1,EN(ENC)="SGL is blank"
55 . . . I ENSGL=6100 S ENC=ENC+1,EN(ENC)="SGL is 6100 (Expensed)"
56 . I ENC D
57 . . ; print questionable equipment item
58 . . S ENT=ENT+1
59 . . S ENCAP=$S(ENCAP=1:"YES",1:"NO")
60 . . I $Y+3+ENC>IOSL D HD Q:END
61 . . W !!,ENDA,?12,ENTYI,?19,ENCMR,?26
62 . . W $J("$"_$FN(ENVAL,",",2),14),?47,ENCAP,?55,EN(1)
63 . . F ENI=2:1:ENC W !,?55,EN(ENI)
64 I 'END D
65 . W !!,ENT," questionable equipment items found"
66 . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
67 D ^%ZISC
68EXIT I $D(ZTQUEUED) S ZTREQ="@"
69 K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
70 K END,ENDT,ENL,ENPG
71 K EN,ENC,ENCAP,ENCT,ENCMR,ENDA,ENI,ENSGL,ENT,ENTYI,ENVAL
72 Q
73HD ; header
74 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
75 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
76 I $E(IOST,1,2)="C-"!ENPG W @IOF
77 S ENPG=ENPG+1
78 W !,"CHECK OF EQUIPMENT CAPITALIZATION",?48,ENDT,?72,"page ",ENPG
79 W !!,?12,"TYPE"
80 W !,"EQUIP ID#",?12,"ENTRY",?19,"CMR",?26," ASSET VALUE"
81 W ?42,"CAPITALIZED"
82 W !,$E(ENL,1,10),?12,$E(ENL,1,5),?19,$E(ENL,1,5),?26,$E(ENL,1,14)
83 W ?42,$E(ENL,1,11),?55,$E(ENL,1,23)
84 Q
85 ;ENFAR3
Note: See TracBrowser for help on using the repository browser.