ASUURANG ; IHS/ITSC/LMH -RPT 10 -VOUCHER SUMMARY ;
;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
;This routine selects a range of dates for report data
S DIR(0)="Y",DIR("B")="YES",DIR("A")="Date range for report(s) to be today's transactions only" D ^DIR Q:$D(DIRUT)
S X=Y
D RANGE(X)
Q
RANGE(X) ;EP ;Set report date range
S ASUN("TYP")=X
D:$G(ASUL(2,"STA","E#"))']"" STA^ASULARST($G(ASUL("ST#")))
S (ASUN("BKY"),ASUN("EKY"))=ASUL(2,"STA","E#")
I X D
.S (Y,ASUN("BDT"),ASUN("EDT"))=ASUK("DT","FM")
.S (ASUN("KEY"),ASUN("BKY"))=ASUN("BKY")_"-"_Y_"-"_"0000000"
.S ASUN("EKY")=ASUN("EKY")_"-"_$S(X=1:Y,1:$E(Y,1,5)_"32")_"-"_"9999999"
E D
.W !,"Enter report date range"
.N DIR S DIR(0)="D",DIR("B")="T",DIR("A")="Enter beginning date" D ^DIR Q:$D(DIRUT)
.Q:Y<0
.S ASUN("BDT")=Y
.S (ASUN("KEY"),ASUN("BKY"))=ASUN("BKY")_"-"_Y_"-0000000"
.S DIR("A")="Enter ending date" D ^DIR Q:$D(DIRUT)
.Q:Y<0
.S ASUN("EDT")=Y
.S ASUN("EKY")=ASUN("EKY")_"-"_Y_"-9999999"
Q:Y<0
S ASUN("B#")=$O(^ASUH("B",ASUN("BKY"))),ASUN("E#")=$O(^ASUH("B",ASUN("EKY")),-1)
Q:ASUN("B#")="" Q:ASUN("E#")=""
S ASUN("B#")=$O(^ASUH("B",ASUN("B#"),"")),ASUN("E#")=$O(^ASUH("B",ASUN("E#"),"")),ASUHDA=ASUN("B#")-1
Q
ASUURANG ; IHS/ITSC/LMH -RPT 10 -VOUCHER SUMMARY ;
+1 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
+2 ;This routine selects a range of dates for report data
+3 SET DIR(0)="Y"
SET DIR("B")="YES"
SET DIR("A")="Date range for report(s) to be today's transactions only"
DO ^DIR
IF $DATA(DIRUT)
QUIT
+4 SET X=Y
+5 DO RANGE(X)
+6 QUIT
RANGE(X) ;EP ;Set report date range
+1 SET ASUN("TYP")=X
+2 IF $GET(ASUL(2,"STA","E#"))']""
DO STA^ASULARST($GET(ASUL("ST#")))
+3 SET (ASUN("BKY"),ASUN("EKY"))=ASUL(2,"STA","E#")
+4 IF X
Begin DoDot:1
+5 SET (Y,ASUN("BDT"),ASUN("EDT"))=ASUK("DT","FM")
+6 SET (ASUN("KEY"),ASUN("BKY"))=ASUN("BKY")_"-"_Y_"-"_"0000000"
+7 SET ASUN("EKY")=ASUN("EKY")_"-"_$SELECT(X=1:Y,1:$EXTRACT(Y,1,5)_"32")_"-"_"9999999"
End DoDot:1
+8 IF '$TEST
Begin DoDot:1
+9 WRITE !,"Enter report date range"
+10 NEW DIR
SET DIR(0)="D"
SET DIR("B")="T"
SET DIR("A")="Enter beginning date"
DO ^DIR
IF $DATA(DIRUT)
QUIT
+11 IF Y<0
QUIT
+12 SET ASUN("BDT")=Y
+13 SET (ASUN("KEY"),ASUN("BKY"))=ASUN("BKY")_"-"_Y_"-0000000"
+14 SET DIR("A")="Enter ending date"
DO ^DIR
IF $DATA(DIRUT)
QUIT
+15 IF Y<0
QUIT
+16 SET ASUN("EDT")=Y
+17 SET ASUN("EKY")=ASUN("EKY")_"-"_Y_"-9999999"
End DoDot:1
+18 IF Y<0
QUIT
+19 SET ASUN("B#")=$ORDER(^ASUH("B",ASUN("BKY")))
SET ASUN("E#")=$ORDER(^ASUH("B",ASUN("EKY")),-1)
+20 IF ASUN("B#")=""
QUIT
IF ASUN("E#")=""
QUIT
+21 SET ASUN("B#")=$ORDER(^ASUH("B",ASUN("B#"),""))
SET ASUN("E#")=$ORDER(^ASUH("B",ASUN("E#"),""))
SET ASUHDA=ASUN("B#")-1
+22 QUIT