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

ACRFVCTR.m

Go to the documentation of this file.
ACRFVCTR ;IHS/OIRM/DSD/THL,AEF - LOOKUP CONTRACT NUMBER FOR ITEM VENDOR; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO LOOKUP CONTRACT NUMBER FOR ITEM VENDOR
EN I '$D(^AUTTVNDR(ACRVENDA,"CN")) D  Q
 .W !?10,"NO CONTRACTS ON FILE FOR ",$P(^AUTTVNDR(ACRVENDA,0),U)
 .H 2
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRQUIT
 Q
EN1 D DISPLAY
 D SELECT:ACRJ
 I 'ACRJ D
 .S ACRQUIT=""
 .W !?10,"NO CONTRACTS ON FILE FOR ",$P(^AUTTVNDR(ACRVENDA,0),U)
 .H 2
 Q
DISPLAY D HEAD
 S (ACR,ACRJ)=0
 F  S ACR=$O(^AUTTVNDR(ACRVENDA,"CN",ACR)) Q:'ACR  D
 .S ACRX=ACR_U_^AUTTVNDR(ACRVENDA,"CN",ACR,0)
 .D DATE
 Q
SELECT S DIR(0)="NO^1:"_ACRJ
 S DIR("A")="Contract for this item"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 S $P(^ACRITEM(ACRITMDA,"DT1"),U,10)=$P(ACRX(Y),U)
 S ACRQUIT=""
 Q
DATE S X1=DT
 S (ACRB,X2)=$P(ACRX,U,3)
 D ^%DTC
 I X<1 K ACRX(ACR) Q
 S Y=ACRB
 X ^DD("DD")
 S ACRB=Y
 S X2=DT
 S (ACRE,X1)=$P(ACRX,U,4)
 D ^%DTC
 I X<1 K ACRX(ACR) Q
 S Y=ACRE
 X ^DD("DD")
 S ACRE=Y
 S ACRJ=ACRJ+1
 S ACRX(ACRJ)=ACRX
W W !,$P(ACRX,U,2)
 W ?13,ACRB
 W ?25,ACRE
 W ?37,$J($FN($P(ACRX,U,5),"P",2),12)
 W ?50,$P(ACRX,U,6)
 Q
 W !!,"CONTRACT NO."
 W ?13,"BEGINNING"
 W ?27,"ENDING"
 W ?39,"AMOUNT"
 W ?50,"DESCRIPTION"
 W !,"------------ ----------- ----------- ------------ ------------------------------"
 Q