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

ASUV3AL.m

Go to the documentation of this file.
ASUV3AL ; IHS/ITSC/LMH -INITIAL INVENTORY OVER/SHORT LIST ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine creates the Inventory Over/Short List Report
 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 37B 'OVERAGE/SHORTAGE 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 IS 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")=3
 E  D
 .S ASUV("MSG",1)="YOU HAVE REQUESTED AN OVERAGE/SHORTAGE LIST BUT "
 .D ASUV2RN0^ASUV2RN
 G:ASUF EXIT
 D ASUV3AL0
 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^ASUV3AL",ZTDESC="SAMS OVER/SHORT 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 EXIT
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D U^ASUUZIS
 S (ASUC("PG"),ASUC("LN"))=0
 S ASUMV("E#","SLC")=""
 I ASUL(2,"STA","E#")'=ASUL(2,"STA","CD") S X=ASUL(1,"AR","E#"),(ASUL(2,"STA","CD"),X1)=$P(^ASUMS(ASUL(2,"STA","E#"),0),U) D STAT^ASULARST
 S ASUMV("E#","INDX")=""
 D:ASUC("LN")<1 HEADING
 F  S ASUMV("E#","INDX")=$O(^ASUV("OS",ASUMV("E#","ASA"),ASUMV("E#","INDX"))) Q:ASUMV("E#","INDX")'?1N.N  D
 .S ASUMV("E#","SLC")=^ASUV("OS",ASUMV("E#","ASA"),ASUMV("E#","INDX"))
 .D ^ASUV9IMR
 .D:ASUC("LN")>55 HEADING
 .S ASUV("CNT","LST")=$S(ASUMV("CNT","2ND"):ASUMV("CNT","2ND"),1:ASUMV("CNT","1ST"))
 .S ASUV("VALO/S")=ASUMV("QTY","DIF")*ASUMV("U/C")
 .I ASUV("VALO/S")<25,ASUV("VALO/S")'<-25 D  Q
 ..S ASUMV("CNT-ENT")=3 D INDEX^ASUV9IMW ;CHANGE TO UPDATE AS ADJUSTED
 .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)
 .W ?20,ASUMX("DESC",1),?52,ASUMX("AR U/I"),?56,$J(ASUMV("U/C"),6)
 .W ?63,$J(ASUMV("QTY","STAM"),6),?70,$J(ASUV("CNT","LST"),6)
 .W !?2,ASUV("ORD#"),?20,ASUMX("DESC",2)
 .W !?5,$S(ASUMV("QTY","DIF")<0:"SHT",1:"OVR"),?11,"QTY: ",$FN(ASUMV("QTY","DIF"),"-,")
 .W ?25,"VAL: ",$FN(ASUV("VALO/S"),"-,",2),?40,"RSCH/ADJ MASTER QUANTITY:"
 .W !?1,"REMARKS:",!!
 .D SEPERATE
 .S ASUC("LN")=ASUC("LN")+7
 D:ASUC("LN")>7 FOOTING
 I $G(ASUK(ASUK("PTR"),"S")) D C^ASUUZIS
 I '$G(ASUF("RPRN")) U IO(0) D FLAGIT3^ASUV2RN
EXIT ;
 K ASUC,ASUR,ASUF,ASUMS,ASUMV,ASUV,ASUMX
 K DTOUT,DUOUT,ZTRTN,ZTDESC,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 37B INITIAL INVENTORY OVERAGE/SHORTAGE LIST  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")
 W !!,"SLC      INDEX",?52,"U    UNIT RECORD   INV"
 W !," ORD/NSN NUMBER    DESCRIPTION",?53,"I   COST BALANCE  QTY"
 D SEPERATE
 Q
SEPERATE ;
 W !,"_______________________________________________________________________________"
 Q
FOOTING ;
 S ASUC("LN")=0
 Q
ASUV3AL0 ;
 K ^ASUV("OS")
 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
 ..I ASUMV("QTY","DIF")<2,ASUMV("QTY","DIF")'<-1 D  Q
 ...S ASUMV("CNT-ENT")=3 D INDEX^ASUV9IMW
 ..S ^ASUV("OS",ASUMV("E#","ASA"),ASUMV("E#","INDX"))=ASUMV("E#","SLC")
 Q