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

PRCHRCS7.m

Go to the documentation of this file.
PRCHRCS7 ;SF/TKW,WISC/RWS-PRINT REPORTS SHOWING  WHAT DEPOT LOG CODE SHEETS NEED TO BE GENERATED ;3-25-91/08:11
V ;;5.1;IFCAP;;Oct 20, 2000
 ;Per VHA Directive 10-93-142, this routine should not be modified.
 ;
EN S PRCHSAVQ=PRCHQ,PRCHQ=PRCHQ_"^PRCHRCS7",PRCHQ("DEST")="S" D ^PRCHQUE
 S PRCH=$S(PRCHSAVQ["EN1":"AE",PRCHSAVQ["EN2":"AF",1:"") I PRCH="" G Q2
 F PRCHPO=0:0 S PRCHPO=$O(^PRC(442,PRCH,"N",PRCHPO)) Q:'PRCHPO  I $D(^PRC(442,PRCHPO,0)),+^(0)=PRC("SITE"),$D(^(1)),$P(^(1),U,18)="N" W $P(^(0),U,1),! D DELE
 ;
Q2 K PRCH,PRCHSAVQ,PRCHQ Q
 ;
EN1 ;PRINT REPORT OF ACQUISITIONS CODE SHEETS TO BE DONE
 S PRCHRPT=1,PRCH="AE" G RD
 ;
EN2 ;PRINT REPORT OF RECV.REPORT CODE SHEETS TO BE DONE
 S PRCHRPT=2,PRCH="AF"
 ;
RD K ^TMP($J) S Y=DT D DD^%DT S PRCHDT=Y,PRCHPAGE=0 D HD
 F PRCHPO=0:0 S PRCHPO=$O(^PRC(442.8,PRCH,"N",PRCHPO)) Q:'PRCHPO  I $D(^PRC(442,PRCHPO,0)) S X=$P(^(0),U,1) I +X=PRC("SITE") S ^TMP($J,$P(X,"-",2))=PRCHPO I $D(^PRC(442,PRCHPO,1)),$P(^(1),U,18)="N" S $P(^TMP($J,$P(X,"-",2)),U,2)="**"
 S PRCHPONO=""
 F J=0:0 S PRCHPONO=$O(^TMP($J,PRCHPONO)) Q:PRCHPONO=""  S PRCHPO=$P(^(PRCHPONO),U,1),PRCHNON=$P(^(PRCHPONO),U,2) D P1 I PRCHRPT=2 F PRCHFPT=0:0 S PRCHFPT=$O(^PRC(442.8,"AF","N",PRCHPO,PRCHFPT)) Q:'PRCHFPT  D P2
 G Q
 ;
P1 D:PRCHDY>60 HD
 W !,?1,PRCHNON,?4,PRCHPONO D PODATA W ?15,Y,?30,PRCHMOP,?62,PRCHSFC,!,?7,PRCHVND S PRCHDY=PRCHDY+2 I PRCHRPT=1 W ! S PRCHDY=PRCHDY+1
 Q
 ;
PODATA S X=^PRC(442,PRCHPO,0)
 S PRCHMOP=$P($G(^PRCD(442.5,+$P(X,U,2),0)),U,1)
 S Y=$P(^DD(442,.03,0),U,3),PRCHSFC=$P(X,U,19) I PRCHSFC F I=1:1 S X=$P(Y,";",I) Q:X=""  I $P(X,":",1)=PRCHSFC S PRCHSFC=$P(X,":",2) Q
 S Y=$G(^PRC(442,PRCHPO,1)),PRCHVND=$P($G(^PRC(440,+Y,0)),U,1),Y=+$P(Y,U,15) D DD^%DT
 Q
 ;
P2 Q:'$D(^PRC(442,PRCHPO,11,PRCHFPT,0))  S Y=+^(0) D DD^%DT S PRCHRDT=Y D:PRCHDY>60 HD W ?45,$J(PRCHFPT,6),?57,PRCHRDT,! S PRCHDY=PRCHDY+1
 Q
 ;
HD S PRCHPAGE=PRCHPAGE+1 W @IOF,$S(PRCHRPT=1:"DEPOT DUE-INS",1:"RECEIVING REPORTS")_" NEEDING LOG CODE SHEETS--STATION: ",PRC("SITE"),?67,PRCHDT,?88,"PAGE ",PRCHPAGE,!
 ;W ?1,"(NOTE: ** INDICATES NONEXPENDABLE ORDERS)",!
 W ?4,"P.O.NO.",?15,"P.O.DATE",?30,"METHOD OF PROCESSING",?62,"SPECIAL FUND CONTROL POINT",!,?7,"VENDOR"
 I PRCHRPT=2 W ?45,"PARTIAL",?57,"DATE RECEIVED"
 W ! F J=0:1:(IOM-2) W "-"
 W ! S PRCHDY=5
 Q
 ;
Q W $C(13),! K X,Y,I,J,PRCH,PRCHDT,PRCHDY,PRCHFPT,PRCHMOP,PRCHNON,PRCHPAGE,PRCHPO,PRCHPONO,PRCHRDT,PRCHRPT,PRCHSFC,PRCHVND
 I $D(ZTSK) D KILL^%ZTLOAD
 Q
 ;
DELE ;DELETE NON-EXPENDABLE ORDERS FROM LIST OF ORDERS NEEDING CODE-SHEETS PROCESSED.
 I PRCH="AE" S DIE="^PRC(442,",DA=PRCHPO,DR="103.5///@" D ^DIE K DIE,DA,DR Q
 F PRCHFPT=0:0 S PRCHFPT=$O(^PRC(442,"AF","N",PRCHPO,PRCHFPT)) Q:'PRCHFPT  S DIE="^PRC(442,"_PRCHPO_",11,",DA(1)=PRCHPO,DA=PRCHFPT,DR="19.2///@" D ^DIE K DIE,DA,DR
 Q