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

ASURD10V.m

Go to the documentation of this file.
ASURD10V ; IHS/ITSC/LMH -RPT 10 -VOUCHER SUMMARY ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine formats and prints report 10A, Voucher Summary.
EN ;EP;PRIMARY ENTRY POINT FOR REPORT 10V
 I '$D(IO) D HOME^%ZIS
 I '$D(DUZ(2)) W !,"Report must be run from Kernel option" Q
 I '$D(ASUL(1,"AR","AP")) D SETAREA^ASULARST
 S ASUK("PTRSEL")=$G(ASUK("PTRSEL")) I ASUK("PTRSEL")]"" G PSER
 S ZTRTN="PSER^ASURD10V",ZTDESC="SAMS RPT 10V" D O^ASUUZIS
 I POP S IOP=$I D ^%ZIS Q
 I ASUK(ASUK("PTR"),"Q") Q
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D:'$D(^XTMP("ASUR","R10V")) CMPT D U^ASUUZIS
 S ASUV("RPT")="R10V",ASUQ("HDR")="HEADER^ASURD10V" D ^ASUUDATA I ASUX("NDTA") G K
 S (X1,ASUX("IX"),ASUX("VO"),ASUX("SQ"))="",(ASUF("COL"),ASUC("TOT"),ASUC("TOT","VAL"))=0
 F  S ASUX("AS")=$O(^XTMP("ASUR","R10V",ASUX("AS"))) Q:ASUX("AS")=""  D  Q:$D(DUOUT)
 .I ASUV("ARST")'=ASUX("AS") D HEADER Q:$D(DUOUT)
 .S ASUV("ARST")=ASUX("AS")
 .F  S ASUX("VO")=$O(^XTMP("ASUR","R10V",ASUX("AS"),ASUX("VO"))) Q:ASUX("VO")=""  D  Q:$D(DUOUT)
 ..D:ASUC("LN")>(IOSL-6) HEADER Q:$D(DUOUT)
 ..D VHEAD
 ..F  S ASUX("IX")=$O(^XTMP("ASUR","R10V",ASUX("AS"),ASUX("VO"),ASUX("IX"))) Q:ASUX("IX")=""  D
 ...F  S ASUX("SQ")=$O(^XTMP("ASUR","R10V",ASUX("AS"),ASUX("VO"),ASUX("IX"),ASUX("SQ"))) Q:ASUX("SQ")=""  D V1
 ..I ASUF("COL")>0 W ! S ASUC("LN")=ASUC("LN")+1
 ..W ?2,"NUMBER LINE ITEMS: ",$J($FN(ASUC("TOT"),",",0),6)
 ..W ?28,"TOTAL VALUE: $ ",$J($FN(ASUC("TOT","VAL"),",",2),12),! S ASUC("LN")=ASUC("LN")+1
 ..S (ASUC("TOT"),ASUC("TOT","VAL"),ASUF("COL"))=0
 .S ASUC("LN")=IOSL+1
K ;
 K ASUX,ASUV,ASUC,ASUQ D PAZ^ASUURHDR I ASUK("PTRSEL")]"" W @IOF Q
 D C^ASUUZIS Q
CMPT ;EP;COMPUTE REPORT CONTENTS
 K ^XTMP("ASUR","R10V") S ^XTMP("ASUR","R10V",0)=ASUK("DT","FM")+10000_U_ASUK("DT","FM")
 D:$G(ASUN("TYP"))']"" ^ASUURANG
 S ASUHDA=$G(ASUN("B#"))-1
 F  S ASUHDA=$O(^ASUH(ASUHDA)) Q:ASUHDA>$G(ASUN("E#"))  Q:ASUHDA'?1N.N  D
 .Q:ASUHDA=0
 .D READ^ASU0TRRD(.ASUHDA,"H") Q:$G(ASUT)']""  Q:ASUT(ASUT,"VOU")']""
 .;WAR 4/14/99 temp fix need to add this to list
 .I $E(ASUT,1,2)="DI" S ASUT(ASUT,"PT","IDX")=ASUT(ASUT,"AR")_"999998"
 .S ^XTMP("ASUR","R10V",ASUT(ASUT,"PT","STA"),ASUT(ASUT,"VOU"),ASUT(ASUT,"PT","IDX"),ASUHDA)=ASUHDA
 Q
 S ASUC("PG")=$G(ASUC("PG"))+1 I ASUC("PG")>1 D PAZ^ASUURHDR Q:$D(DUOUT)  W @IOF
 W !?5,"REPORT #10. DAILY VOUCHER LISTING"
 W ?100,"DATE: ",ASUX("DT"),?120,"PAGE: ",ASUC("PG")
 S X=ASUL(1,"AR","AP") W !?3,"AREA: ",ASUL(1,"AR","AP"),?15,ASUL(1,"AR","NM")
 I ASUX("AS")'=$G(ASUL(2,"STA","E#")) D STA^ASULARST(ASUX("AS"))
 W !?3,"STATION: ",$G(ASUL(2,"STA","CD")),?15,$G(ASUL(2,"STA","NM"))
 W !!?35,"F",?73,"F",?111,"F",!?3,"TR",?9,"INDEX",?35,"P",?41,"TR",?46,"INDEX",?73,"P",?79,"TR",?85,"INDEX",?111,"P"
 W !?3,"CD",?8,"NUMBER",?19,"QTY",?28,"VALUE",?35,"N",?41,"CD",?45,"NUMBER",?57,"QTY",?66,"VALUE",?73,"N",?79,"CD",?84,"NUMBER",?95,"QTY",?104,"VALUE",?111,"N"
 W !,"------------------------------------------------------------------------------------------------------------------------------------",!
 S ASUC("LN")=9
 Q
VHEAD ;PRINT VOUCHER HEADING LINE
 W !?2,"VOUCHER NO: ",$G(ASUX("VO")),! S ASUC("LN")=ASUC("LN")+2 Q
V1 ;
 S ASUHDA=(^XTMP("ASUR","R10V",ASUX("AS"),ASUX("VO"),ASUX("IX"),ASUX("SQ"))) K ASUT D READ^ASU0TRRD(.ASUHDA,"H") Q:$G(ASUT)']""
 D:ASUC("LN")>(IOSL-2) HEADER,VHEAD
 I $E(ASUT("TRCD"),2,2)?1N S ASUC("TOT","VAL")=ASUC("TOT","VAL")+ASUT(ASUT,"VAL"),ASUC("TOT")=ASUC("TOT")+1
 I ASUF("COL")=0 D  Q
 .W ?3,ASUT("TRCD"),?7,$E(ASUT(ASUT,"IDX"),1,5),".",$E(ASUT(ASUT,"IDX"),6,6),?16,$J($FN(ASUT(ASUT,"QTY"),",",0),6),?23,$J($FN(ASUT(ASUT,"VAL"),",",2),10),?35,ASUT(ASUT,"FPN")
 .S ASUF("COL")=1 ;S ASUC("LN")=ASUC("LN")+1
 I ASUF("COL")=1 D  Q
 .W ?41,ASUT("TRCD"),?46,$E(ASUT(ASUT,"IDX"),1,5),".",$E(ASUT(ASUT,"IDX"),6,6),?54,$J($FN(ASUT(ASUT,"QTY"),",",0),6),?61,$J($FN(ASUT(ASUT,"VAL"),",",2),10),?73,ASUT(ASUT,"FPN")
 .S ASUF("COL")=2
 W ?79,ASUT("TRCD"),?83,$E(ASUT(ASUT,"IDX"),1,5),".",$E(ASUT(ASUT,"IDX"),6,6),?92,$J($FN(ASUT(ASUT,"QTY"),",",0),6),?99,$J($FN(ASUT(ASUT,"VAL"),",",2),10),?111,ASUT(ASUT,"FPN"),! S ASUC("LN")=ASUC("LN")+1
 S ASUF("COL")=0
 Q