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

ASUV2RL.m

Go to the documentation of this file.
ASUV2RL ; IHS/ITSC/LMH -RPT RE-COUNT INVENTORY LIST ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine creates the Physical Inventory Re-count 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 EXIT
 S DIC("A")="PRINT RPT 37A 'INVENTORY RE-COUNT LIST' FOR WHAT ACCOUNT "
 S DIC="9002039.09",DIC(0)="AMEZQ"
 D ^DIC K DIC
 I $D(DTOUT)!($D(DUOUT)) G EXIT
 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 EXIT
 G:ASUMV("E#","ASA")="" EXIT
 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")=2
 E  D
 .S ASUV("MSG",1)="YOU HAVE REQUESTED A RE-COUNT LIST BUT "
 .D ASUV1PN0^ASUV1PN
 G:ASUF EXIT
 D ASUV2RL0
 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 ZTRTN="PSER^ASUV2RL",ZTDESC="SAMS RE-COUNT INVENTORY LIST" D O^ASUUZIS
 I POP S IOP=$I D ^%ZIS Q
 I ASUK("PTR-Q") K IOP,POP,ZTDESC,ZTRTN,ZTSK,ASUK(ASUK("PTR")),ASUK("PTR"),ASUK("PTR-Q") G EXIT
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D U^ASUUZIS
 S (ASUC("PG"),ASUC("LN"))=0
 D ACCOUNT^ASUV9IMR
 S ASUMV("E#","SLC")=""
 F ASUC(1)=0:1 S ASUMV("E#","SLC")=$O(^ASUV("RL",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("RL",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 ?55,$J(ASUMV("QTY","STAM"),7),?63,$J(ASUMV("CNT","1ST"),7)
 ..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 ASUC("1")=0 D HEADING W !,"NO ITEMS TO BE RECOUNTED -ALL MATCHED FIRST COUNT",! D SEPERATE,FOOTING
 I $G(ASUK(ASUK("PTR"),"S")) D C^ASUUZIS
 I '$G(ASUF("RPRN")) U IO(0) D FLAGIT2^ASUV1PN
EXIT ;
 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 NO. 37A INVENTORY RECOUNT 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 : ",$G(ASUMV("SL NM"))
 W !!,"SLC      INDEX",?52,"U  RECORD    FIRST  RECOUNT"
 W !," ORD/NSN NUMBER    DESCRIPTION",?53,"I BALANCE   COUNT  QUANTITY"
 D SEPERATE
 Q
SEPERATE ;
 W !,"_______________________________________________________________________________"
 Q
FOOTING ;
 D:ASUC("LN")>56 HEADING
 W !!?5,"RECOUNTERS:",?50,"DATE:"
 W !?25,"SIGNATURE/TITLE"
 W !!?50,"DATE:"
 W !?25,"SIGNATURE/TITLE"
 S ASUC("LN")=0
 Q
ASUV2RL0 ;SORT
 K ^ASUV("RL")
 S ASUMV("E#","SLC")=0
 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")']""
 ..Q:ASUMV("QTY","DIF")=0
 ..S ^ASUV("RL",ASUMV("E#","ASA"),ASUMV("E#","SLC"),ASUMV("E#","INDX"))=""
 Q