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

ASUURHDR.m

Go to the documentation of this file.
ASUURHDR ; IHS/ITSC/LMH -PRINT HEADING NO RECS ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine provides entry points for various print templates to
 ;invoke to print a report heading when there are no records to print.
 ;VARIABLE ASUH("STS") WILL BE SET BY OPTION -INDICATES STATUS
DUEIN ;EP ;CHECK HEADINGS FOR DUE IN REPORTS
 S ASUH("IDIR")="^ASUT(1," G BEGIN
RECEIPT ;EP ;CHECK HEADINGS FOR RECEIPT REPORTS
 S ASUH("IDIR")="^ASUT(2," G BEGIN
ISSUE ;EP ;CHECK HEADINGS FOR ISSUE REPORTS
 S ASUH("IDIR")="^ASUT(3,"
 S ASUH("ISSTP")=$S($E($P(XQY0,U),7,7)="T":1,1:3)
 S ASUH("STAT")=$O(^ASUT(3,"AD",ASUH("ISSTP"),""))
 I ASUH("STAT")']"" G RESULT
 G BEGIN
AREA ;EP ;CHECK HEADINGS FOR AREA TRANS REPORTS
 S ASUH("IDIR")="^ASUT(4," G BEGIN
STAT ;EP ;CHECK HEADINGS FOR STATION TRANS REPORTS
 S ASUH("IDIR")="^ASUT(5," G BEGIN
DIRECT ;EP ;CHECK HEADINGS FOR DIRECT ISSUE REPORTS
 S ASUH("IDIR")="^ASUT(7," G BEGIN
ADJUST ;EP ;CHECK HEADINGS FOR ADJUSTMENT REPORTS
 S ASUH("IDIR")="^ASUT(6," G BEGIN
BEGIN ;CHECK FOR DATA
 S ASUH("TYPE")=$E($P(XQY0,U),6,6)
 I ASUH("STS")="Q" D
 .F ASURPT="R","U","X" D STATUS Q:ASUH("STAT")]""
 .I 1
 E  D
 .S ASURPT=ASUH("STS") D STATUS
 .I ASUH("STAT")']"",ASUH("STS")="U" S ASURPT="X" D STATUS
RESULT ;
 I ASUH("STAT")']"" D
 .S ASUH("TPL")=$P(FLDS,"[",2),ASUH("TPL")=$P(ASUH("TPL"),"]"),ASUH("TPL#")="" I ASUH("TPL")]"" D
 ..S ASUH("TPL#")=$O(^DIPT("B",ASUH("TPL"),"")),ASUH("HEAD")=0
 .I ASUH("TPL#")]"" D
 ..S ASUH("HEAD")=1
 ..W @IOF,^DIPT(ASUH("TPL#"),"H"),!
 ..Q:'$D(^DIPT(ASUH("TPL#"),"ROU"))
 ..S ASUH("TPLROU")=^DIPT(ASUH("TPL#"),"ROU")
 ..S ASUH("TPLHDR")="HEAD"_ASUH("TPLROU")
 ..D @ASUH("TPLHDR")
 .W:'ASUH("HEAD") @IOF,$P(XQY0,U,2),!!
 .W !,"No data found for report."
 .K ASUH("TPL#"),ASUH("TPLROU"),ASUH("TPLHDR"),FLDS
EXIT ;
 K ASURPT
 Q
STATUS ;
 S ASUH("IDR1")=ASUH("IDIR")_"""C"","""_ASURPT_""","""")"
 S ASUH("STAT")=$O(@ASUH("IDR1"))
 I ASUH("STAT")]"" D DATE
 Q
DATE ;
 S ASUH("SORT")=0
 F  S ASUH("SORT")=$O(DPP(ASUH("SORT"))) Q:ASUH("SORT")=""  Q:$P(DPP(ASUH("SORT")),U,3)["DATE"
 Q:ASUH("SORT")=""
 S ASUH("XREF")=$S($P(DPP(ASUH("SORT")),U,3)["PROC":"AC",1:"AX")
 S ASUH("1ST")=$P($G(DPP(ASUH("SORT"),"F")),".")
 S ASURPT=$S(ASUH("1ST")]"":ASUH("1ST")-1,1:"")
 S ASUH("IDR2")=ASUH("IDIR")_""""_ASUH("XREF")_""",ASURPT)"
 S ASUH("STAT")=$O(@ASUH("IDR2"))
 Q:ASUH("STAT")=ASUH("1ST")
 S ASUH("LAST")=$P($G(DPP(ASUH("SORT"),"T")),".")
 Q:ASUH("LAST")']""
 S:ASUH("STAT")>ASUH("LAST") ASUH("STAT")=""
 Q
PAZ ;EP ;;PAUSE AT LAST SCREEN FOR REPORTS SENT TO TERMINAL
 G:$D(IO("Q")) EXIT
 G:$G(IO("S"))]"" EXIT
 I $E($G(IOST),1,2)="C-",ION'["HFS" N DIR S DIR(0)="E" D ^DIR
 G EXIT