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

PSGWSC1.m

Go to the documentation of this file.
PSGWSC1 ;BHAM ISC/PTD,CML-Print Cost Report for Single Item for Selected Date Range - CONTINUED ; 23 Mar 93 / 12:55 PM
 ;;2.3;Automatic Replenishment/Ward Stock ;**21**;4 JAN 94;Build 6
EN1 S (QD,CST,INACTOT)=0,PGCT=1,QFLG="",$P(LN,"-",80)="" D HDR
AOU F AOU=0:0 S AOU=$O(^TMP("PSGWSC",$J,AOU)) Q:'AOU  D WRTLN G:QFLG END
 I '$O(^TMP("PSGWSC",$J,0)) W !?5,"NO COST DATA IN FILE FOR SELECTED DATES." G DONE
WRTOT W !?44 F J=1:1:31 W "-"
 W !?39,"TOTAL",?46,$J((QD),8,0),?64,$S(INACTOT=1:"INCOMPLETE",1:$J((CST),10,2)),!!
 ;
DONE I $E(IOST)'="C" W @IOF
 I $E(IOST)="C" D:'QFLG SS^PSGWUTL1
 ;PSGW*2.3*21 add PSGWCNM to kill list
END K PSGWCNM,ZTSK,ALL,AOU,CST,BDT,DRGCST,DRGDA,DRGNM,DRGQD,EDT,INACTOT,INC,INVDA,INVDT,INVN,J,JJ,SEL,IGDA,LOC,LOC1,LOC2,ODA,ODT,PGCT,ITNAM,QD,RETDT,%,%I,%H,D,DA,G,^TMP("PSGWSC",$J),^TMP("PSGWINV",$J),IO("Q"),X,Y,ANS,QFLG,LN,JJ,CHK,AOUCNT,AOULP
 D ^%ZISC
 S:$D(ZTQUEUED) ZTREQ="@" Q
 ;
HDR ;PRINT REPORT MAIN HEADER
 W:$Y @IOF W !?5,"COST REPORT FROM " S Y=BDT X ^DD("DD") W Y," TO " S Y=EDT X ^DD("DD") W Y,?70,"PAGE ",PGCT I $D(SEL),SEL="I",$D(IGDA) W !?5,"FOR INVENTORY GROUP - ",$P(^PSI(58.2,IGDA,0),"^")
 W !?5,"DATE: ",$$PSGWDT^PSGWUTL1 S PGCT=PGCT+1 W !!?5,"ITEM: ",ITNAM,!?46,"QUANTITY",!?5,"AREA OF USE",?45,"DISPENSED",?67,"COST",!,LN
 Q
 ;
WRTLN S LOC=^TMP("PSGWSC",$J,AOU) D:$Y+5>IOSL PRTCHK Q:QFLG  W !?5,$P(^PSI(58.1,AOU,0),"^"),?46,$J($P(LOC,"^"),8,0),?64,$S($P(LOC,"^",2)'="NO DATA":$J($P(LOC,"^",2),10,2),1:"DATA MISSING")
 S QD=QD+$P(LOC,"^") I $P(LOC,"^",2)'="NO DATA" S CST=CST+$P(LOC,"^",2) Q
 E  S INACTOT=1 Q
PRTCHK ;
 I $E(IOST)="C" W !!,"Press <RETURN> to Continue or ""^"" to Exit: " R ANS:DTIME S:'$T ANS="^" D:ANS?1."?" HELP^PSGWUTL1 I ANS="^" S QFLG=1 Q
 D HDR Q