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

ASUV1PL.m

Go to the documentation of this file.
ASUV1PL ; IHS/ITSC/LMH -RPT 37 PHYSICAL INVENTORY LIST ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine creates report 37 - Physical Inventory List
 D:'$D(DT) ^XBKVAR S %H=$H D YX^%DTC S ASUK("RUN","DT")=$P(Y,"@") K X,Y,%H
 D:'$D(IO(0)) HOME^%ZIS
 D CLS^ASUUHDG
 I $G(ASUL(2,"STA","E#"))']"" D STA^ASUV0NT I $D(DTOUT)!($D(DUOUT)) G XIT1
 S DIC("A")="PRINT RPT 37 'PHYSICAL INVENTORY LIST' FOR WHAT ACCOUNT? "
 S DIC="9002039.09",DIC(0)="AMEZQ"
 D ^DIC K DIC
 I $D(DTOUT)!($D(DUOUT)) G XIT1
 K DIR
 Q:'$D(Y)  Q:Y=""
 I Y>0 D
 .S ASUMV("ACC")=$P(Y,U),ASUMV("E#","ASA")=ASUL(2,"STA","E#")_ASUMV("ACC")
 .D ACC^ASULDIRF(ASUMV("ACC"))
 E  G XIT1
 G:ASUMV("E#","ASA")="" XIT1
 I $D(^ASUMV(ASUMV("E#","ASA"),0)) D
 .D ACCOUNT^ASUV9IMR
 E  D  Q
 .W !!,"NO INVENTORY ACTIVE FOR ACCOUNT ",ASUMV("ACC")," ",ASUL(9,"ACC","NM")
 .S DIR(0)="E" D ^DIR K DIR
 S ASUV("ASA")=ASUMV("E#","ASA")
 S ASUF=$G(ASUF)
 I ASUF=2 D
 .S ASUF=0,ASUMV("MODE")=1
 E  D
 .S ASUV("MSG",1)="YOU HAVE REQUESTED AN INVENTORY LIST BUT "
 .D CKINIT^ASUV1PN K ASURX
 G:ASUF XIT1
 D ASUV1PL0
 I '$D(IO) D HOME^%ZIS
 I '$D(DUZ(2)) W !,"Report must be run from Kernel option" D PAZ^ASUURHDR Q
 S ZTRTN="PSER^ASUV1PL",ZTDESC="SAMS PHYSICAL INVENTORY LIST" D O^ASUUZIS
 I POP S IOP=$I D ^%ZIS Q
 I ASUK(ASUK("PTR"),"Q") K IOP,POP,ZTDESC,ZTRTN,ZTSK,ASUK(ASUK("PTR")),ASUK("PTR"),ASUK("PTR-Q") G XIT1
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D U^ASUUZIS
 S (ASUC("PG"),ASUC("LN"))=0
 D ACCOUNT^ASUV9IMR
 S ASUMV("E#","SLC")=""
 F  S ASUMV("E#","SLC")=$O(^ASUV("IL",ASUMV("E#","ASA"),ASUMV("E#","SLC"))) Q:ASUMV("E#","SLC")'?1N.N  D
 .D STORLOC^ASUV9IMR
 .D:ASUC("LN")<1 HEADING
 .S ASUMV("E#","INDX")=""
 .F  S ASUMV("E#","INDX")=$O(^ASUV("IL",ASUMV("E#","ASA"),ASUMV("E#","SLC"),ASUMV("E#","INDX"))) Q:ASUMV("E#","INDX")'?1N.N  D
 ..D INDEX^ASUV9IMR
 ..Q:ASUMV("IDX")["*"  ;MASTER HAS BEEN DELETED
 ..D:ASUC("LN")>55 HEADING
 ..D READ^ASUMXDIO
 ..S ASUMS("E#","IDX")=$O(^ASUMS(ASUL(2,"STA","E#"),1,"B",ASUMX("E#","IDX"),""))
 ..S ASUMS("ORD#")=$P(^ASUMS(ASUL(2,"STA","E#"),1,ASUMS("E#","IDX"),0),U,3)
 ..S ASUV("ORD#")=$S(ASUMS("ORD#")'=" ":ASUMS("ORD#"),1:ASUMX("NSN"))
 ..W !?1,ASUMV("SLC"),?8,$E(ASUMX("IDX"),1,5),".",$E(ASUMX("IDX"),6,6),?20,ASUMX("DESC",1),?51,ASUMX("AR U/I")
 ..W !?2,ASUV("ORD#"),?20,ASUMX("DESC",2)
 ..D SEPERATE
 ..S ASUC("LN")=ASUC("LN")+3
 .D:ASUC("LN")>7 FOOTING
 D:ASUC("LN")>7 FOOTING
 I $G(ASUK(ASUK("PTR"),"S")) D C^ASUUZIS
 I '$G(ASUF("RPRN")) U IO(0) D FLAGIT1^ASUV1PN
XIT1 ;
 K ASUC,ASUR,ASUF,ASUMS,ASUMV,ASUV,ASUMX
 K DTOUT,DUOUT,ZTDESC,ZTRTN,X,Y,X1
 D:$D(ASUK("PTR")) C^ASUUZIS
 Q
HEADING ;
 D CLS^ASUUHDG S ASUC("PG")=ASUC("PG")+1,ASUC("LN")=7
 W "REPORT 37  PHYSICAL INVENTORY LISTING   DATE : ",ASUK("RUN","DT"),?70," PAGE : ",ASUC("PG")
 W !,"AREA: ",ASUL(1,"AR","E#")," ",ASUL(1,"AR","NM")
 W !,"STAT: ",ASUL(2,"STA","CD")," ",ASUL(2,"STA","NM"),?35,"ACCOUNT : ",ASUL(9,"ACC","NM"),?60,"SLC : ",ASUMV("SL NM")
 W !!,"SLC      INDEX",?51,"U   INVENTORY"
 W !," ORD/NSN NUMBER     DESCRIPTION",?53,"I     COUNT"
 D SEPERATE
 Q
SEPERATE ;
 W !,"_______________________________________________________________________________"
 Q
FOOTING ;
 D:ASUC("LN")>55 HEADING
 W !!?5,"INVENTORY RECORDER:",?50,"DATE:"
 W !?25,"SIGNATURE/TITLE"
 W !!?5,"INVENTORY COUNTER:",?50,"DATE:"
 W !?25,"SIGNATURE/TITLE"
 S ASUC("LN")=0
 Q
ASUV1PL0 ;
 K ^ASUV("IL")
 S ASUMV("E#","SLC")=""
 F  S ASUMV("E#","SLC")=$O(^ASUMV(ASUMV("E#","ASA"),1,ASUMV("E#","SLC"))) Q:ASUMV("E#","SLC")'?1N.N  D
 .S ASUMV("E#","INDX")=0
 .F  S ASUMV("E#","INDX")=$O(^ASUMV(ASUMV("E#","ASA"),1,ASUMV("E#","SLC"),1,ASUMV("E#","INDX"))) Q:ASUMV("E#","INDX")'?1N.N  D
 ..D ^ASUV9IMR
 ..Q:ASUMV("STA")']""
 ..S ^ASUV("IL",ASUMV("E#","ASA"),ASUMV("E#","SLC"),ASUMV("E#","INDX"))=""
 Q