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

PRCHRP6.m

Go to the documentation of this file.
  1. PRCHRP6 ;WISC/KMB/CR FISCAL DAILY REVIEW ;7/09/98 10:34
  1. ;;5.1;IFCAP;**8**;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. START ;
  1. N LINE1,LINE2,PONUM,STRING,LIN1,LIN2,AMT,AMT1,FLAG,STATUS,CP,VEND,USER,STATUS,TDATE,EDATE,FDATE,HDATE,DIR,ZP,P,X,Y,F1,F2,LINE3,TOT,XXZ,EX
  1. K ^TMP($J)
  1. W @IOF
  1. S PRCF("X")="S" D ^PRCFSITE Q:'$D(PRC("SITE")) Q:$G(X)="^"
  1. S DIR("A")="Enter beginning date",DIR("?")="Enter the first date for which you wish to see records"
  1. S DIR(0)="D^^" D ^DIR K DIR Q:+Y<1 S FDATE=+Y W " ",Y(0)
  1. S DIR("A")="Enter ending date",DIR("?")="Enter the last date for which you wish to see records"
  1. S DIR(0)="D^^" D ^DIR K DIR Q:+Y<1 S EDATE=+Y W " ",Y(0)
  1. I EDATE<FDATE W !,"Date range is incorrect." G START
  1. S DIR("A")="Do you want to see delivery orders",DIR(0)="Y^^" D ^DIR K DIR Q:Y<0 S FLAG=Y
  1. S %ZIS("B")="",%ZIS="MQ" D ^%ZIS Q:POP
  1. I $D(IO("Q")) S ZTRTN="DETAIL^PRCHRP6",ZTSAVE("*")="" D ^%ZTLOAD,^%ZISC Q
  1. D DETAIL,^%ZISC
  1. Q
  1. ;
  1. DETAIL ;
  1. D NOW^%DTC,YX^%DTC S HDATE=Y
  1. S (P,EX)=1
  1. S ZP="" F S ZP=$O(^PRC(442,"F",25,ZP)) Q:ZP="" D DETAIL1
  1. I $G(FLAG)=1 S ZP="" F S ZP=$O(^PRC(442,"F",1,ZP)) Q:ZP="" D DETAIL1
  1. D WRITE
  1. K ^TMP($J)
  1. Q
  1. ;
  1. DETAIL1 ;
  1. S F1=$G(^PRC(442,ZP,0)),F2=$G(^PRC(442,ZP,1))
  1. I $D(PRC("SITE")) Q:$P(F1,"-")'=PRC("SITE")
  1. S Y=$P(F2,"^",15),CP=$P(F1,"^",3),CP=+$P(CP," ")
  1. Q:CP="" Q:Y<FDATE Q:Y>EDATE
  1. D DD^%DT S TDATE=Y
  1. S USER=$P(F2,"^",10),USER=$P($G(^VA(200,+USER,0)),"^"),VEND=$P(F2,"^"),VEND=$P($G(^PRC(440,+VEND,0)),"^"),AMT=$P(F1,"^",15)
  1. I VEND="SIMPLIFIED",$P($G(^PRC(442,ZP,24)),"^",2)'="" S VEND=$P($G(^PRC(442,ZP,24)),"^",2)
  1. S VEND=$E(VEND,1,25)
  1. S LINE1=TDATE_"^"_USER_"^"_VEND_"^"_AMT
  1. S PONUM=$P(F1,"^"),STATUS=$P($G(^PRC(442,ZP,7)),"^") Q:STATUS=1 Q:STATUS=45
  1. S:STATUS'="" STATUS=$P($G(^PRCD(442.3,STATUS,0)),"^"),STATUS=$E(STATUS,1,40)
  1. S LINE2=STATUS_"^"_PONUM
  1. S ^TMP($J,CP,ZP,1)=LINE1,^TMP($J,CP,ZP,2)=LINE2
  1. Q
  1. ;
  1. WRITE ;
  1. U IO S P=1
  1. S STRING="PURCHASE CARD PO NUMBER" S:FLAG=1 STRING="TRANSACTION PO NUMBER"
  1. I '$D(^TMP($J)) S CP="" D HEADER W !!!!,?10,"*** NO RECORDS TO PRINT ***" Q
  1. S TOT=0,(CP,ZP)="" F S CP=$O(^TMP($J,CP)) Q:EX[U Q:CP="" D
  1. .D HEADER
  1. .F S ZP=$O(^TMP($J,CP,ZP)) Q:EX[U Q:ZP="" D
  1. ..S LINE1=^TMP($J,CP,ZP,1),LINE2=^TMP($J,CP,ZP,2) D
  1. ...W !,$P(LINE1,"^"),?15,$P(LINE1,"^",2),?40,$P(LINE1,"^",3) S AMT1=$P(LINE1,"^",4) W ?70,$J(AMT1,8,2)
  1. ...W !,$P(LINE2,"^"),?45,$P(LINE2,"^",2),!
  1. ...S TOT=TOT+AMT1
  1. ...I (IOSL-$Y)<5 D HOLD
  1. .I EX'[U W !,?25,"CONTROL POINT ",CP," SUBTOTAL: ",$J(TOT,0,2),! S TOT=0
  1. .I $E(IOST,1,2)'="P-",EX'[U W !,"Press return to continue, '^' to exit: " R XXZ:DTIME S:XXZ[U EX=U S:'$T EX=U W !
  1. Q
  1. ;
  1. HOLD G HEADER:$E(IOST,1,2)="P-"!(IO'=IO(0)) W !,"Press return to continue, '^' to exit: " R XXZ:DTIME S:XXZ["^" EX="^" S:'$T EX="^" D:EX'="^" HEADER
  1. Q
  1. ;
  1. W @IOF
  1. W !,"FISCAL DAILY REVIEW REPORT",?42,HDATE,?70,"PAGE ",P,!
  1. W !,"PURCHASE DATE",?15,"BUYER",?40,"VENDOR",?72,"AMOUNT"
  1. W !,?3,"STATUS",?45,STRING
  1. W ! F I=1:1:10 W "--------"
  1. W !!,"CONTROL POINT: ",CP,!
  1. S P=P+1
  1. Q