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

ASUL20IT.m

Go to the documentation of this file.
  1. ASUL20IT ; IHS/ITSC/LMH -IN TRANSFORM REQUSITIONER TABLE 20 ;
  1. ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
  1. ;This routine is the File Man Input transform for SAMS table 20 -
  1. ;Requsitioner table
  1. I '$D(DUZ(2)) K X W !?10,"DUZ(2) must be set so Area Accounting Point can be determined" Q
  1. I '$D(ASUL(1,"AR","AP")) D SETAREA^ASULARST
  1. I $D(DIC(0)) D
  1. .S DIC(0)=$TR(DIC(0),"Q")
  1. .S:DIC(0)'["N" DIC(0)="N"_DIC(0)
  1. .S:DIC(0)'["A" DIC(0)="A"_DIC(0)
  1. E D
  1. .S DIC(0)="NAE"
  1. N DIK,DIR,DR,DIC,DIE
  1. S (DIC,DIE)=9002039.2
  1. EN1 ;X ALREADY SET BY EN2
  1. S X=$G(X),ASUL("REQ")=1
  1. I X']"" D ASUL19RC^ASUL19IT G:$D(DIRUT) ERR I Y>0 G SST
  1. I $D(DA) D G:ASUL("REQ")=2 REQ G:$D(ASUL(19,"USR","E#")) SST
  1. .I DA?9N,$D(^ASUL(20,+DA,0)) D I ASUL("REQ")=2 Q
  1. ..I $E(DA,1,2)=ASUL(1,"AR","AP") S ASUL("REQ")=2
  1. .I $D(^ASUL(19,+DA,0)),DA?6N D I Y>0 K DA
  1. ..I $E(DA,1,2)=ASUL(1,"AR","AP") D USR^ASULDIRR(.DA)
  1. E D
  1. .S DA=X
  1. I DA]"" K Y D G:$G(Y)>0 SST
  1. .I DA?6N,$D(^ASUL(19,+DA,0)) D Q:$G(Y)>0
  1. ..I $E(DA,1,2)'=ASUL(1,"AR","AP") Q
  1. ..I $G(ASUL(19,"USR","E#"))'=DA D USR^ASULDIRR(.DA) Q:Y<-1 Q:Y>0
  1. ..I Y=-1 D USR^ASULDIRA(.DA) Q:Y<0
  1. .E D
  1. ..I DA?1AN.ANP S Y=$O(^ASUL(19,"B",DA,"")) I Y]"" S DA=Y D USR^ASULDIRR(.DA) Q
  1. E D
  1. .D DIC^ASUL19IT
  1. G:$D(DIRUT) ERR
  1. I $D(ASUL(19)) G SST
  1. W !?5,"No valid Requsitioner, User, or Sub Station entered"
  1. G ERR
  1. SST ;
  1. I $D(ASUL(18)) G REQ
  1. D ASUL18RC^ASUL18IT
  1. G:$D(DIRUT) ERR
  1. I $D(ASUL(18)) G REQ
  1. I Y>0 S DA=Y D SST^ASULDIRR(.DA)
  1. I $D(ASUL(18)) G REQ
  1. D DIC^ASUL18IT
  1. I '$D(ASUL(18,"SST","E#")) W !?5,"Valid Sub Station not entered" G ERR
  1. REQ ;
  1. I '$D(DA),$D(ASUL(18,"SST","E#")),$D(ASUL(19,"USR","E#")) S DA=ASUL(18,"SST","E#")_$E(ASUL(19,"USR","E#"),3,6)
  1. I DA?9N D G:Y>0 EXIT
  1. .I '$D(ASUL(18,"SST","E#")) S ASUL(18,"SST","E#")=$E(DA,1,5) D SST^ASULDIRR(ASUL(18,"SST","E#"))
  1. .I '$D(ASUL(19,"USR","E#")) S ASUL(19,"USR","E#")=$E(DA,1,2)_$E(DA,6,9) D USR^ASULDIRR(ASUL(19,"USR","E#"))
  1. .D REQ^ASULDIRR(.DA)
  1. I $D(ASUL(18,"SST","E#")) D
  1. .I $D(ASUL(19,"USR","E#")) D
  1. ..S (DA,ASUL(20,"REQ","E#"))=ASUL(18,"SST","E#")_$E(ASUL(19,"USR","E#"),3,6)
  1. ..D REQ^ASULDIRR(.DA)
  1. ..D:Y<0 FILE
  1. .E D
  1. ..W !?5,"Valid User not entered" D ERR
  1. E D
  1. .W !?5,"Valid Sub Station not entered" D ERR
  1. G:'$D(X) ERR
  1. EXIT ;
  1. S (DA,D0)=ASUL(20,"REQ","E#"),X=ASUL(20,"REQ","NM")
  1. K ASUL(18),ASUL(19),ASUL(20),ASUL(22),ASUL("REQ")
  1. Q
  1. ARIT ;EP;;AREA POINTER INPUT TRANSFORM FOR FILEMAN
  1. N Z S Z=$E(DA,1,2) K:X'=Z X Q
  1. FILE ;ADD ENTRY TO REQUSITIONER TABLE FILE
  1. S ASUL(20,"REQ","ULV")=$S($E(DA,1,2)=59:2.0,1:1.5)
  1. W !?10,"Adding entry in Requsitioner Table (20)"
  1. W !?10," NAME: ",ASUL(20,"REQ","NM")
  1. W !?10," AREA: ",ASUL(1,"AR","AP")
  1. W !?10," USER LEVEL: ",ASUL(20,"REQ","ULV")
  1. S ^ASUL(20,ASUL(20,"REQ","E#"),0)=ASUL(20,"REQ","NM")_U_ASUL(19,"USR","E#")_U_ASUL(18,"SST","E#")_U_ASUL(1,"AR","AP")
  1. S ^ASUL(20,ASUL(20,"REQ","E#"),1)=ASUL(20,"REQ","ULV")
  1. S $P(^ASUL(20,0),U,4)=$P(^ASUL(20,0),U,4)+1
  1. S $P(^ASUL(20,0),U,3)=ASUL(19,"USR","E#")
  1. S DIK="^ASUL(20,",DA=ASUL(20,"REQ","E#") D IX^DIK K X
  1. ERR ;ERROR OR NEW ENTRY MADE
  1. K X,DUOUT,DTOUT,ASUL(18),ASUL(19),ASUL(20),ASUL(22),ASUL("REQ")
  1. Q
  1. HELP ;
  1. W !?5,"You may only access Requsitioner table entries for the Area you are signed"
  1. W !?5,"in to SAMS with. This is determined using the setting of DUZ(2)"
  1. W !?5,"which is set when you sign in to SAMS. If you wish to change Areas,"
  1. W !?5,"you must sign out of SAMS and then sign back in to SAMS selecting the"
  1. W !?5,"appropriate DIVISION (area). If when you sign in to SAMS you are not"
  1. W !?5,"prompted for a DIVISION, then you are automatically signed on as a"
  1. W !?5,"specific Area and are restricted to that Area."
  1. W !!?5,"You will be asked for the Requsitioner (User) Code for the entry you wish"
  1. W !?5,"to Access. If an entry for that User does not exist, you will be asked"
  1. W !?5,"for all necessary data to enter a new User in the ASUTBL USER table file."
  1. W !?5,"For the user you select, you will be asked for the Sub Station where the"
  1. W !?5,"user is located. If an entry for that Sub Station does not exist, you will"
  1. W !?5,"be asked for all data to enter a new Sub Station in the ASUTBL SUB STATION"
  1. W !?5,"table file. Once an entry has been made to the Requsitioner table, only"
  1. W !?5,"the USER LEVEL field may be changed. To change any other field, you must"
  1. W !?5,"delete the entry and re-enter it with the changes. Deletions however,"
  1. W !?5,"may only be done by those with specific access keys."
  1. Q
  1. EN2 ;EP;;FOR ASUL20EN
  1. I $D(ASUL(19)) G SST
  1. I $D(ASUL(18)) K X
  1. G EN1