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

ENEXPT1.m

Go to the documentation of this file.
  1. ENEXPT1 ;WIRMFO/SAB-EQUIPMENT FILE EXPORT SUMMARY RPT ;1/18/96
  1. ;;7.0;ENGINEERING;**27**;Aug 17, 1993
  1. EN ;
  1. W !,"This report searches the entire equipment file and may take some"
  1. W !,"time to complete. Consider queuing this report to run after-hours."
  1. ; ask device
  1. S %ZIS="QM" D ^%ZIS G:POP EXIT
  1. I $D(IO("Q")) D G EXIT
  1. . S ZTRTN="QEN^ENEXPT1",ZTDESC="Equipment File Export Summary Rpt"
  1. . D ^%ZTLOAD,HOME^%ZIS K ZTSK
  1. QEN ; queued entry
  1. N ENC,END,ENDA,ENDL,ENDT,ENPG,ENSN,ENSND,ENTA,ENTL,ENY0,ENY2,ENY3
  1. U IO
  1. S ENSND=$$GET1^DIQ(6910,"1,",1) ; default station #
  1. W:$E(IOST,1,2)="C-" !,"Searching Equipment File"
  1. S ENDA=0 F S ENDA=$O(^ENG(6914,ENDA)) Q:'ENDA D
  1. . I $E(IOST,1,2)="C-" W:'(ENDA#100) "."
  1. . S ENY0=$G(^ENG(6914,ENDA,0))
  1. . Q:$P(ENY0,U,4)'="NX" ; type of entry screen
  1. . S ENY3=$G(^ENG(6914,ENDA,3))
  1. . Q:"^4^5^"[(U_$P(ENY3,U,1)_U) ; use status screen
  1. . S ENSN=$P($G(^ENG(6914,ENDA,9)),U,5) S:ENSN="" ENSN=ENSND ; station
  1. . S ENY2=$G(^ENG(6914,ENDA,2))
  1. . S ENC(ENSN)=$G(ENC(ENSN))+1
  1. . S ENTA(ENSN)=$G(ENTA(ENSN))+$P(ENY2,U,3)
  1. . S ENTL(ENSN)=$G(ENTL(ENSN))+$P(ENY2,U,12)
  1. ; print summary
  1. S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
  1. S ENDL="",$P(ENDL,"-",IOM)=""
  1. D HD
  1. S (ENC,ENTA,ENTL)=0
  1. S ENSN="" F S ENSN=$O(ENC(ENSN)) Q:ENSN="" D Q:END
  1. . I $Y+4>IOSL D HD Q:END
  1. . W !,?5,ENSN,?15,$J(ENC(ENSN),6),?28,$J($FN($G(ENTA(ENSN)),",",2),16),?48,$J($FN($G(ENTL(ENSN)),",",2),16)
  1. . S ENC=ENC+ENC(ENSN)
  1. . S ENTA=ENTA+$G(ENTA(ENSN))
  1. . S ENTL=ENTL+$G(ENTL(ENSN))
  1. I 'END D
  1. . W !,?5,"-------",?15,"----------",?28,"-----------------",?48,"----------------"
  1. . W !,?5,"TOTAL:",?15,$J(ENC,6),?28,$J($FN(ENTA,",",2),16),?48,$J($FN(ENTL,",",2),16)
  1. . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
  1. D ^%ZISC
  1. EXIT I $D(ZTQUEUED) S ZTREQ="@"
  1. K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. Q
  1. HD ; header
  1. I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
  1. I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
  1. I $E(IOST,1,2)="C-"!ENPG W @IOF
  1. S ENPG=ENPG+1
  1. W !,"EQUIPMENT FILE EXPORT SUMMARY RPT",?48,ENDT,?72,"page ",ENPG
  1. W !!,?5,"STATION",?15,"ITEM COUNT",?28,"TOTAL ASSET VALUE"
  1. W ?48,"TOTAL LEASE COST"
  1. W !,ENDL
  1. Q
  1. ASK ; description of selection criteria and set up of summary report prompt
  1. ; called by ENEXPT
  1. W !!,"The Equipment File Export transmits equipment data to the National"
  1. W !,"Engineering Service Center (NESC) in St. Louis."
  1. W !,"Equipment which meets the following criteria will be selected:"
  1. W !," TYPE OF ENTRY equals ""NX"""
  1. W !," USE STATUS not equal ""TURNED IN"" or ""LOST OR STOLEN""",!
  1. S DIR(0)="Y",DIR("A")="Would you like a summary report",DIR("B")="YES"
  1. S DIR("?",1)="Enter YES to generate a summary report of equipment that"
  1. S DIR("?")="will be included in the transmission."
  1. Q
  1. ;ENEXPT1