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

ACRFDFLT.m

Go to the documentation of this file.
ACRFDFLT ;IHS/OIRM/DSD/THL,AEF - EDIT VARIOUS DEFAULTS;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ENTRY POINTS TO EDIT DEFAULT DATA
CAND ;EP;TO EDIT CAN NO. DEFAULTS
 F  D CAND1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
CAND1 ;EP;SELECT A CAN NUMBER
 W @IOF
 W !!?22,"EDIT CAN NO. DEFAULTS"
 W !
 S DIC="^ACRCAN("
 S DIC(0)="AELMQZ"
 S DIC("A")="COMMON ACCOUNTING NO: "
 W !?21,"|=======|"
 D DIC^ACRFDIC
 I U[$E(X)!(+Y<1) S ACRQUIT="" Q
 S ACRCANDA=+Y
 I $P(Y,U,3) D DUP
 F  D CAND2 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
CAND2 ;EDIT CAN NUMBER DEFAULTS
 K ^TMP("ACRDCC",$J)
 W @IOF
 W !?10,"Which CAN DEFAULTS for CAN ",$P(^AUTTCAN(ACRCANDA,0),U)
 S DIR(0)="SO^1:Requisition Defaults;2:Purchase Order Defaults;3:Travel Order/Voucher Defaults;4:Training Request Defaults"
 S DIR("?")="Enter the number to indicate which set of DEFAULT values you want to edit."
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!($G(Y)<1) S ACRFDNCA=$P(^AUTTCAN(ACRCANDA,0),U) D CANCHK^ACRFEA1 S ACRQUIT="" Q
 S DR="[ACR CAN "_$S(Y=1:"REQUISITION",Y=2:"PO",Y=3:"TRAVEL",Y=4:"TRAINING")_" DEFAULTS]"
 N ACRD,ACRD1
 K ACRFR,ACRTO
 S DA=ACRCANDA
 S DIE="^ACRCAN("
 S ACR0=^ACRCAN(DA,0)
 S ACRD=$G(^ACRCAN(DA,"DFLT"))
 S ACRD1=$G(^ACRCAN(DA,"DFLT1"))
 S ACRD2=$G(^ACRCAN(DA,"DFLT2"))
 D DDS^ACRFDIC
 I $D(ACRSCREN) K ACRSCREN D DIE^ACRFDIC
 D:$D(^TMP("ACRDCC",$J)) EN2^ACRFDCC
 K ^TMP("ACRDCC",$J)
 Q
PCAND ;EP;TO PRINT CAN NO. DEFAULTS
 D PCEXIT
 F  D PC Q:$D(ACRQUIT)!$D(ACROUT)
PCEXIT K ACRQUIT,ACRCANDA,ACRQUIT,ACROUT,ACRGREF,ACRRTN,ACRJ
 Q
PC S DIR(0)="SO^1:Print for Single CAN;2:Print for All CAN's;3:Print for Selected CAN(s)"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!($G(Y)<1)
 I Y=1 D PC1 Q
 I Y=2 D PC2 Q
 I Y=3 D PC3 Q
 Q
PC1 K ACRCANDA
 D PCAND1
 Q:'$G(ACRCANDA)
 D PCAND2
 Q
PC2 S DIR(0)="YO"
 S DIR("A")="you want to print CAN DEFAULTS for all of these"
 S DIR("A",1)="There are "_$P($G(^ACRCAN(0)),U,4)_" CAN's on file.  Are you certain"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$G(Y)'=1
 S ACRRTN="PCPRINT^ACRFDFLT"
 S ACRGREF="^ACRCAN"
 D PCAND2
 Q
PC3 K ^TMP("ACRCANDF"),ACRRTN
 F ACRJ=1:1 D PCAND11 Q:$D(ACRQUIT)!$D(ACROUT)!'$G(ACRCANDA)  S ^TMP("ACRCANDF",$J,ACRCANDA)=""
 Q:'$D(^TMP("ACRCANDF"))
 S ACRRTN="PCPRINT^ACRFDFLT"
 S ACRGREF="^TMP(""ACRCANDF"")"
 D PCAND2
 Q
PCAND1 ;EP;SELECT A CAN NUMBER
 W @IOF
PCAND11 W !!?22,"PRINT CAN NO. DEFAULTS"
 W !
 S DIC="^ACRCAN("
 S DIC(0)="AEMQZ"
 S DIC("A")="COMMON ACCOUNTING NO: "
 S:$G(ACRJ)>1 DIC("A")="Select another "_DIC("A")
 W:'$G(ACRJ) !?21,"|=======|"
 D DIC^ACRFDIC
 I U[$E(X)!(+Y<1) S ACRQUIT="" Q
 S ACRCANDA=+Y
 Q
PCAND2 ;EP;PRINT CAN NUMBER DEFAULTS
 S ZTDESC="ARMS CAN DEFAULT SUMMARY"
 S ZTSAVE("ACR*")=""
 S ACRRTN=$S($D(ACRRTN):ACRRTN,1:"PCAND3^ACRFDFLT")
 D ^ACRFZIS
 Q
PCAND3 ;EP;TO PRINT CAN DEFAULTS
 S D0=ACRCANDA
 D ^ACRPCAN
 W @IOF
 Q
PCPRINT ;EP;TO PRINT ALL CAN DEFAULTS
 N ACRCANDA
 S ACRCANDA=0
 F  S ACRCANDA=$O(@ACRGREF@(ACRCANDA)) Q:'ACRCANDA!$D(ACRQUIT)!$D(ACROUT)  D PCAND3
 Q
PD ;EP;TO ENTER/UPDATE PER DIEM CITY
 S ACRHEAD="EDIT PER DIEM CITY"
 S ACRDIC="^ACRPD"
 S ACRDIC("A")="PER DIEM CITY.......: "
 S ACRDR="[ACR PER DIEM]"
 S ACRDIR("A")="Edit Per Diem City Info"
 S ACRRTN="^ACRPPC"
 D GEN
 Q
EMP ;EP;TO ENTER/UPDATE EMPLOYEE DATA
 S ACRHEAD="EDIT AN EMPLOYEE"
 S ACRDIC="^ATAEMP"
 S ACRDIC("A")="EMPLOYEE............: "
 S ACRDR="[ACR EMPLOYEE-2]"
 S ACRDIR("A")="Edit Employee Data"
 S ACRRTN="^ACREMP"
 D GEN
 Q
PRG ;EP;TO ENTER/EDIT AN OFFICE/DIVISION/DEPARTMENT
 S ACRHEAD="EDIT DEPARTMENT"
 S ACRDIC="^AUTTPRG"
 S ACRDIC("A")="DEPARTMENT NAME.....: "
 S ACRDR="[ACR PROGRAM]"
 S ACRDIR("A")="Edit Department Information"
 S ACRRTN="^ACRPPRG"
 D GEN
 Q
CAN ;EP;EDIT CAN NO.
 W @IOF
 W !?22,"EDIT COMMON ACCOUNTING NUMBERS"
 F  D CAN1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
CAN1 S DIC(0)="AEMLQZ"
 S DIC="^AUTTCAN("
 S DIC("A")="CAN NO..............: "
 W !!?21,"|=======|"
 D DIC^ACRFDIC
 I U[$E(X)!(+Y<1) S ACRQUIT="" Q
 S DA=+Y
 S DR=".01COMMON ACCOUNTING NO;.19M&M CAN............."
 S DIE="^AUTTCAN("
 D DIE^ACRFDIC
 Q
DUP ;DUPLCATE CAN DEFAULTS FROM AN EXISTING CAN
 S DIR(0)="YO"
 S DIR("A",1)="Duplicate CAN Default data from an"
 S DIR("A")="Existing CAN"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 Q:$G(Y)'=1
 S DIC="^ACRCAN("
 S DIC(0)="AEMQZ"
 S DIC("A")="Select Existing CAN.: "
 S DIC("S")="I +Y'=ACRCANDA"
 W !?21,"|=======|"
 D DIC^ACRFDIC
 I U[$E(X)!(+Y<1) S ACRQUIT="" Q
 S ACRCAN2=+Y
 S %X="^ACRCAN("_+Y_","
 S %Y="^ACRCAN("_ACRCANDA_","
 D %XY^%RCR
 S $P(^ACRCAN(ACRCANDA,0),U)=ACRCANDA
 S DA=ACRCANDA
 S DIK="^ACRCAN("
 D IX1^ACRFDIC
 W !!,"All data from CAN NO.: ",$P(^AUTTCAN(ACRCAN2,0),U)
 W !,"has been duplicated in CAN NO.: ",$P(^AUTTCAN(ACRCANDA,0),U),"."
 W !!,"You may now edit data for CAN NO.: ",$P(^AUTTCAN(ACRCANDA,0),U)
 W !
 K ACRCAN2
 Q
GEN ;EP;TO PROCESS TABLE EDITS
 F  D G1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT,ACRD0,ACRDA,ACRTX
 Q
G1 ;SELECT FILE ENTRY
 W @IOF
 W !?22,ACRHEAD
 W !
 S DIC=ACRDIC_"("
 S DIC(0)="AELMQZ"
 S:DIC["AUTTOBJC" DIC(0)="AEMQZ"
 S DIC("DR")=""
 S DIC("A")=ACRDIC("A")
 D DIC^ACRFDIC
 I U[$E($G(X))!(+Y<1) S ACRQUIT="" Q
 I ACRDIC="^ACRPD",+Y<10000 D  Q
 .S ACRD0=+Y
 .D GDISP
 .W !!,"This PER DIEM information can only be changed by Headquarters"
 .D PAUSE^ACRFWARN
 .S ACRQUIT=""
 N ACRY
 S (ACRD0,ACRDA)=+Y
 S ACRY=$P(Y,U,3)
G3 F  D G2 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
G2 ;EDIT FILE ENTRY
 S DA=ACRDA
 S DIE=ACRDIC_"("
 S DR=ACRDR
 D DDS^ACRFDIC
 I '$D(ACRSCREN) D  Q
 .I ACRDIC["AUTTOBJC" D OBJC1
 .I ACRDIC["AUTTPRG" D
 ..W @IOF
 ..W !,"Additional information for: ",$P(^AUTTPRG(ACRDA,0),U),!
 ..D G32
 .S ACRQUIT=""
 K ACRSCREN
 S ACRY=""
 D GDISP
 S DIR(0)="YO"
 S DIR("B")="NO"
 S DIR("A")=ACRDIR("A")
 W !
 D DIR^ACRFDIC
 I Y'=1 S ACRQUIT="" Q
G31 S DA=ACRDA
 S DIE=ACRDIC_"("
 S DR=ACRDR
 W !
 D DIE^ACRFDIC
 D OBJC1:ACRDIC["AUTTOBJC"
G32 I ACRDIC["AUTTPRG" D
 .I '$D(^ACRDEPT(ACRDA,0)) D
 ..S (X,DINUM)=ACRDA
 ..S DIC="^ACRDEPT("
 ..S DIC(0)="L"
 ..D FILE^ACRFDIC
 .S DA=ACRDA
 .S DIE="^ACRDEPT("
 .S DR=".02T;W !!?22,""Enter the name of a PURCHASING AGENT for this DEPARTMENT"";W !?22,""ONLY if you want ALL requisitions originated by this"";W !?22,""departemnt assigned to this PURCHASING AGENT"";.03T"
 .D DIE^ACRFDIC
 K ACRTX
 Q
GDISP ;DISPLAY ENTRY DATA
 W @IOF
 W ?22,ACRHEAD
 W !!
 N DXS,DIP,DC,DN
 S D0=ACRD0
 D @ACRRTN
 Q
OBJC1 ;EDIT TRANSACTION TYPES FOR THIS OBJECT CODE
 D GDISP
 D OBJC2
 S ACRLBTX=""
 D DISPLAY^ACRFTXTP
 K ACRLBTX
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Add which ARMS TRANSACTION TYPES for this OBJECT CODE"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!'+Y
 S ACRTX=Y
 F ACRJ=1:1 S ACRX=$P(ACRTX,",",ACRJ) Q:ACRX=""  D
 .S DA(1)=+ACRTX(ACRX)
 .S DIC="^ACRTXTYP("_DA(1)_",10,"
 .S DIC(0)="L",(X,DINUM)=ACRDA
 .S:'$D(^ACRTXTYP(DA(1),10,0)) ^ACRTXTYP(DA(1),10,0)="^9002194.1001P"
 .I '$D(^ACRTXTYP(DA(1),10,X,0)) D FILE^ACRFDIC
 K ACRTX
 Q
OBJC2 S DIR(0)="YO"
 S DIR("A")="Delete an ARMS TRANSACTION TYPE from this OBJECT CODE"
 S DIR("B")="NO"
 N X
 S (ACRJ,X)=0
 F  S X=$O(ACRTX(X)) Q:'X  S ACRJ=ACRJ+1
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Which one(s)"
 W !
 D DIR^ACRFDIC
 Q:'+Y
 S ACRTX=Y
 F ACRJ=1:1 S ACRX=$P(ACRTX,",",ACRJ) Q:'ACRX  D
 .I $D(ACRTX(ACRX)),+ACRTX(ACRX) D
 ..S DA(1)=+ACRTX(ACRX)
 ..S DA=ACRDA
 ..S DIK="^ACRTXTYP("_DA(1)_",10,"
 ..D DIK^ACRFDIC
 Q