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

PRCPUMAN.m

Go to the documentation of this file.
  1. PRCPUMAN ;WISC/RFJ/DGL-lookup for mand source field .4 file 445 ; 7/22/99 1:49pm
  1. V ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. HELP(INVPT,ITEMDA,SCREEN) ; called from help (node 4 for dd(445.01,.4, )
  1. ; to display mandatory source.
  1. ; screen=1 to lookup in screen for procurement source in 445.07
  1. ; optional prc("cp"),prc("site")
  1. I 'INVPT!('ITEMDA) Q
  1. N %,CP,MANSRCE,SITE,TYPE
  1. S MANSRCE=$$MANDSRCE^PRCPU441(ITEMDA),TYPE=$P($G(^PRCP(445,INVPT,0)),"^",3)
  1. S SITE=+$G(PRC("SITE")) I 'SITE S SITE=+$G(^PRCP(445,INVPT,0))
  1. S CP=$G(PRC("CP")) I CP="" S CP=+$O(^PRC(420,"AE",SITE,INVPT,0)),CP=$P($G(^PRC(420,SITE,1,CP,0))," ") ; Multiple FCP not supported
  1. W ! I TYPE="W" D W !! Q
  1. . I MANSRCE'=$O(^PRC(440,"AC","S",0)) W !,"ITEM IS NOT SET UP AS POSTED STOCK. THE MANDATORY SOURCE IN THE ITEM MASTER",!,"FILE DOES NOT EQUAL THE WAREHOUSE VENDOR." Q
  1. . S %=$P($G(^PRC(440,+$P($G(^PRC(441,ITEMDA,0)),"^",4),0)),"^") I %'="" W !,"LAST VENDOR ORDERED: ",%
  1. . S %=$P($G(^PRC(440,+$P($G(^PRC(441,ITEMDA,4,SITE_CP,0)),"^",3),0)),"^") I %'="" W !,"PREFERRED VENDOR (FOR CP: ",CP,"): ",%
  1. . W !,"YOU MAY SELECT ANY VENDOR WHICH IS SET UP AS A VENDOR FOR THIS ITEM IN THE ITEM",!,"MASTER FILE"
  1. . W $S(SCREEN:", AND IS A PROCUREMENT SOURCE FOR THIS ITEM IN THE INVENTORY POINT.",1:". ") W:SCREEN ! W "THE VENDOR ALSO MUST NOT BE INACTIVATED."
  1. I TYPE="P" D W !! Q
  1. . I MANSRCE W !,"ITEM HAS A MANDATORY SOURCE: ",$P($G(^PRC(440,+MANSRCE,0)),"^"),".",!,"YOU CAN ONLY SELECT THIS VENDOR." Q
  1. . S %=$P($G(^PRC(440,+$P($G(^PRC(441,ITEMDA,0)),"^",4),0)),"^") I %'="" W !,"LAST VENDOR ORDERED: ",%
  1. . S %=$P($G(^PRC(440,+$P($G(^PRC(441,ITEMDA,4,SITE_CP,0)),"^",3),0)),"^") I %'="" W !,"PREFERRED VENDOR (FOR CP: ",CP,"): ",%
  1. . W !,"YOU MAY SELECT ANY VENDOR WHICH IS SET UP AS A VENDOR FOR THIS ITEM IN THE ITEM",!,"MASTER FILE, AND IS A PROCUREMENT SOURCE FOR THIS ITEM IN THE INVENTORY POINT.",!,"THE VENDOR ALSO MUST NOT BE INACTIVATED."
  1. I TYPE="S" D W !! Q
  1. . W !,"YOU CAN ONLY SELECT A PRIMARY DISTRIBUTION POINT WHICH DISTRIBUTES THIS ITEM."
  1. Q
  1. ;
  1. ;
  1. SCREEN(INVPT,ITEMDA,SCREEN1) ; called from input transform for dd(445.01,.4,
  1. ; x=vendor name, y=vendor number,
  1. ; dic=file 440 or 445 it should lookup on
  1. ; screen1=1 to lookup in screen for procurement source in 445.07
  1. ; if vendor y fails -->> flag=0 and $t=0
  1. N %,FLAG,LOOKUP,MANSRCE,SCREEN,TYPE
  1. S FLAG=1
  1. I 'INVPT!('ITEMDA) S FLAG=0 G END
  1. S MANSRCE=$$MANDSRCE^PRCPU441(ITEMDA),TYPE=$P($G(^PRCP(445,INVPT,0)),"^",3),LOOKUP=$S($G(DIC)["^PRCP(445":";PRCP(445,",1:";PRC(440,")
  1. S SCREEN="I LOOKUP[440,$D(^PRC(441,ITEMDA,2,+Y)),'$P($G(^PRC(440,+Y,10)),""^"",5)"_$S(SCREEN1:",$O(^PRCP(445,INVPT,1,ITEMDA,5,""B"",(+Y)_"";PRC(440,"",0))",1:"")
  1. I TYPE="W" D G END
  1. . I MANSRCE'=$O(^PRC(440,"AC","S",0)) S FLAG=0 Q
  1. . I MANSRCE=Y S FLAG=0 Q
  1. . X SCREEN I '$T S FLAG=0
  1. I TYPE="P" D G END
  1. . I MANSRCE,Y=MANSRCE Q
  1. . I MANSRCE S FLAG=0 Q
  1. . X SCREEN I '$T S FLAG=0
  1. I TYPE="S" D
  1. . I LOOKUP[445,$D(^PRCP(445,Y,1,ITEMDA,0)),$D(^PRCP(445,Y,2,INVPT,0)) Q
  1. . S FLAG=0
  1. END I FLAG Q
  1. I 0
  1. Q