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

ASURD10P.m

Go to the documentation of this file.
ASURD10P ; IHS/ITSC/LMH -RPT 10A -LST DIRECT ISSUE TRANS ;  [ 07/18/2000  7:59 AM ]
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine formats and prints report 10, Direct Issues
 ;Transaction List.
 ;K ^XTMP("ASUR","R10A")
 ;S ^XTMP("ASUR","R10A",0)=ASUK("DT","FM")+10000_U_ASUK("DT","FM")
EN ;EP;PRIMARY ENTRY POINT FOR REPORT 10
 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^ASURD10P",ZTDESC="SAMS RPT 10A" 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 CMPT ;JDH D:'$D(^XTMP("ASUR","R10A")) CMPT
 D U^ASUUZIS
 S ASUV("RPT")="R10A",ASUQ("HDR")="HEADER^ASURD10P"
 D ^ASUUDATA I ASUX("NDTA") G K
 S (ASUX("VO"),ASUX("SQ"))="",(ASUC("TOT"),ASUC("VALTOT"))=0
 F  S ASUX("AS")=$O(^XTMP("ASUR","R10A",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","R10A",ASUX("AS"),ASUX("VO"))) Q:ASUX("VO")=""  D  Q:$D(DUOUT)
 ..F  S ASUX("SQ")=$O(^XTMP("ASUR","R10A",ASUX("AS"),ASUX("VO"),ASUX("SQ"))) Q:ASUX("SQ")=""  D  Q:$D(DUOUT)
 ...S ASUHDA=(^XTMP("ASUR","R10A",ASUX("AS"),ASUX("VO"),ASUX("SQ")))
 ...D READ^ASU0TRRD(.ASUHDA,"H") Q:$G(ASUT)']""
 ...I ASUC("LN")>(IOSL-2) D HEADER Q:$D(DUOUT)
 ...S ASUX("VAL")=ASUT(ASUT,"VAL")
 ...S ASUC("TOT")=ASUC("TOT")+1
 ...S:"0K0M0O0N"[ASUT("TRCD") ASUC("VALTOT")=ASUC("VALTOT")-ASUX("VAL")
 ...S:"02040506"[ASUT("TRCD") ASUC("VALTOT")=ASUC("VALTOT")+ASUX("VAL")
 ...W !?3,ASUT(ASUT,"VOU"),?15,ASUT("TRCD"),?21,$J(ASUT(ASUT,"QTY","ISS"),6)
 ...S ASUC("LN")=ASUC("LN")+1
 ...W ?29,$J($FN(ASUX("VAL"),",",2),9)
 ...W:"0K0M0O0N"[ASUT("TRCD") ?39,"-"
 ...W ?41,ASUT(ASUT,"ACC")
 ...S ASUV("SOBJ")=ASUT(ASUT,"SOBJ")
 ...W:ASUV("SOBJ")]"" ?47,$E(ASUV("SOBJ"),1,2)_"."_$E(ASUV("SOBJ"),3,4)
 ...W ?57,ASUT(ASUT,"SSA"),?62,ASUT(ASUT,"CAN")
 ...W ?70,ASUT(ASUT,"USR"),?75,ASUT(ASUT,"SST"),?82,ASUT(ASUT,"SRC"),?87,ASUT(ASUT,"PON")
 .D:ASUC("LN")>(IOSL-4) HEADER
 .W !!?2,"NUMBER LINE ITEMS: ",$J(ASUC("TOT"),6)
 .W !?2,"TOTAL VALUE:$ ",?29,$J($FN(ASUC("VALTOT"),",",2),9)
 .S ASUC("VALTOT")=0
K ;
 K ASUX,ASUV,ASUC,ASUQ,ASUL(2),^XTMP("ASUR","R10A")
 D PAZ^ASUURHDR
 I ASUK("PTRSEL")]"" Q
 D C^ASUUZIS
 Q
CMPT ;EP;COMPUTE REPORT CONTENTS
 K ^XTMP("ASUR","R10A") S ^XTMP("ASUR","R10A",0)=ASUK("DT","FM")+10000_U_ASUK("DT","FM") N Z
 D:$G(ASUN("TYP"))']"" ^ASUURANG
 F Z="02","04","05","06","0K","0M","0N","0O" D
 .S ASUHDA=$G(ASUN("B#"))-1
 .F  S ASUHDA=$O(^ASUH("T",Z,ASUHDA)) Q:ASUHDA>$G(ASUN("E#"))  Q:ASUHDA']""  D
 ..D READ^ASU0TRRD(.ASUHDA,"H") Q:$G(ASUT)']""  Q:$P(ASUT(ASUT,"TRKY"),"-")'=ASUL(2,"STA","E#")
 ..;S ^XTMP("ASUR","R10A",ASUT(ASUT,"PT","STA"),ASUT(ASUT,"VOU"),ASUHDA)=ASUHDA
 Q
DUMB ;
 F Z="5C","5D" D
 S ASUC("PG")=$G(ASUC("PG"))+1
 I ASUC("PG")>1 D PAZ^ASUURHDR Q:$D(DUOUT)  W @IOF
 W !?5,"REPORT #10A.    LIST DIRECT ISSUE TRANSACTIONS"
 W ?100,"DATE: ",ASUX("DT"),?120,"PAGE: ",ASUC("PG")
 S X=ASUL(1,"AR","AP") W !?3,"AREA: ",ASUL(1,"AR","AP")
 W ?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"))
 W ?15,$G(ASUL(2,"STA","NM"))
 W !!?3,"VOUCHER",?14,"TRAN",?22,"NUMBER",?32,"VALUE",?39,"ACCOUNT",?47,"OBJECT",?54,"SUB SUB",?63,"CAN",?69,"USER",?75,"SUB",?80,"SOURCE",?88,"PURCHASE"
 W !?3,"NUMBER",?14,"CODE",?20,"LINE ITEMS",?40,"CODE",?46,"SUB OBJ",?56,"ACT",?69,"CODE",?75,"STAT",?81,"CODE",?89,"ORDER"
 W !,"------------------------------------------------------------------------------------------------------------------------------------",!!
 S ASUC("LN")=9
 Q