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

ASURM24P.m

Go to the documentation of this file.
ASURM24P ; IHS/ITSC/LMH -RPT 24 SUPPLY EXPIRATION ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine formats and prints report 24, List Inactive Items
 ;from sorted extracts.
EN ;EP;PRIMARY ENTRY POINT FOR REPORT 24
 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^ASURM24P",ZTDESC="SAMS RPT 24" 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","R24")) SORT
 Q:$O(^XTMP("ASUR","R24",0))=""  ;WAR 10/1/99 no data for Dir Issue
 D U^ASUUZIS
 S (ASUC("PG"),ASUMS("E#","STA"))=0,ASUF("BK")=0
 S ASUMS("E#","STA")=$O(^XTMP("ASUR","R24",0))
 I ASUMS("E#","STA")]"" D
 .D ARE^ASULARST($E(ASUMS("E#","STA"),1,2)),STA^ASULARST(ASUMS("E#","STA"))
 .S ASURX("ACG")=$O(^XTMP("ASUR","R24",ASUMS("E#","STA"),0)) D ACGNM^ASULDIRF(ASURX("ACG"))
 S ASUV("RPT")="R24",ASUQ("HDR")="HEADER^ASURM24P"
 D ^ASUUDATA I ASUX("NDTA") G K
 S (ASUC("PG"),ASUMS("E#","STA"))=0,ASUF("BK")=""
 F  S ASUMS("E#","STA")=$O(^XTMP("ASUR","R24",ASUMS("E#","STA"))) Q:ASUMS("E#","STA")']""  D  Q:$D(DTOUT)  Q:$D(DUOUT)
 .D ARE^ASULARST($E(ASUMS("E#","STA"),1,2)),STA^ASULARST(ASUMS("E#","STA"))
 .S ASURX("ACG")=0
 .F  S ASURX("ACG")=$O(^XTMP("ASUR","R24",ASUMS("E#","STA"),ASURX("ACG"))) Q:ASURX("ACG")']""  D  Q:$D(DTOUT)  Q:$D(DUOUT)
 ..D ACGNM^ASULDIRF(ASURX("ACG")) D:ASUC("PG")>1 HEADER
 ..S ASUMS("E#","IDX")=0
 ..F  S ASUMS("E#","IDX")=$O(^XTMP("ASUR","R24",ASUMS("E#","STA"),ASURX("ACG"),ASUMS("E#","IDX"))) Q:ASUMS("E#","IDX")']""  D  Q:$D(DUOUT)  Q:$D(DTOUT)
 ...S ASUMX("E#","IDX")=ASUMS("E#","IDX")
 ...D READ^ASUMXDIO,^ASUMSTRD D:ASUF("BK") HEADER Q:$D(DUOUT)  Q:$D(DTOUT)
 ...W !,$E(ASUMX("IDX"),1,5),".",$E(ASUMX("IDX"),6),?12,ASUMS("SLC"),?15,ASUMX("DESC",1),?48,ASUMX("AR U/I"),?52,ASUMS("PMIQ")
 ...S ASUV("DXP")=0
 ...F ASUV("DXPC")=1:1 S ASUV("DXP")=$O(ASUMS("DXP",ASUV("DXP"))) Q:ASUV("DXP")']""  D
 ....S X1=ASUK("DT","FM"),X2=ASUV("DXP") D ^%DTC Q:X>121
 ....W:ASUV("DXPC")=2 ?15,ASUMX("DESC",2)
 ....S Y=ASUV("DXP") X ^DD("DD") W ?58,Y,?67,$J($FN(ASUMS("DXP",ASUV("DXP")),","),8)
 ....W:ASUV("DXPC")=1 ?82,$J($FN(ASUMS("QTY","O/H"),","),5)
 ....W !
 ...W:ASUV("DXPC")=2 ?15,ASUMX("DESC",2)
 ...W !
 ...S ASUC("TOTLI")=$G(ASUC("TOTLI"))+1
K ;
 K ASUMX,ASUMS,ASURX,ASUX,ASUC,ASUF("BK")
 Q
 S ASUC("PG")=$G(ASUC("PG"))+1,ASUC("LINE")=5
 I ASUC("PG")>1 D PAZ^ASUURHDR Q:$D(DUOUT)  Q:$D(DTOUT)
 W @(IOF),"REPORT #24 SUPPLY EXPIRATION REPORT",?90,ASUK("DT"),?110,"PAGE",?115,$J($FN(ASUC("PG"),","),7)
 W !,"AREA",?6,$G(ASUL(1,"AR","AP")),?9,$G(ASUL(1,"AR","NM"))
 W !,"STAT",?6,$G(ASUL(2,"STA","CD")),?9,$G(ASUL(2,"STA","NM")),?50,"G L ACCOUNT 125.",$G(ASUL(9,"ACG")),?68,$G(ASUL(9,"ACG","NM")),!
 W !?61,"EXP",?66,"SHORT DATED",?82,"TOTAL"
 W !?3,"INDEX",?60,"DATE    QUANTITY   QUANTITY"
 W !?3,"NUMBER",?10,"SLC",?15,"DESCRIPTION",?47,"U/I",?52,"PAMIQ",?69,"ON HAND   ON HAND    ACTION TAKEN",!
 Q
SORT ;EP ;
 K ^XTMP("ASUR","R24")
 S ^XTMP("ASUR","R24",0)=ASUK("DT","FM")+10000_U_ASUK("DT","FM")
 S ASUMS("E#","STA")=0
 F  S ASUMS("E#","STA")=$O(^ASUMS(ASUMS("E#","STA"))) Q:ASUMS("E#","STA")'?1N.N  D
 .F ASUMS("E#","IDX")=0:0 S ASUMS("E#","IDX")=$O(^ASUMS(ASUMS("E#","STA"),1,ASUMS("E#","IDX"))) Q:ASUMS("E#","IDX")'?1N.N  D
 ..D ^ASUMSTRD Q:ASUMS("DXP")'>0
 ..S (ASUF("DXP"),ASUV("DXP"))=0
 ..F  S ASUV("DXP")=$O(ASUMS("DXP",ASUV("DXP"))) Q:ASUV("DXP")']""  D  Q:ASUF("DXP")
 ...S X1=ASUK("DT","FM"),X2=ASUV("DXP") D ^%DTC
 ...Q:X>121  S ASUF("DXP")=1
 ..Q:'ASUF("DXP")
 ..S ASUMX("E#","IDX")=ASUMS("E#","IDX") D READ^ASUMXDIO,ACC^ASULDIRF(ASUMX("ACC"))
 ..S ^XTMP("ASUR","R24",ASUMS("E#","STA"),ASUL(9,"ACG"),ASUMS("E#","IDX"))=ASUV("DXP")
 Q