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

ACRFDUP.m

Go to the documentation of this file.
ACRFDUP ;IHS/OIRM/DSD/THL,AEF - DUPLICATE A DOCUMENT;  [ 09/23/2005  3:23 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,19**;NOV 05, 2001
 ;;
EN ;EP;TO DUPLICATE A DOCUMENT
 F  D EN1 Q:$D(ACRQUIT)
EXIT K ACRQUIT,ACRNOT,ACRTDA,ACRTNAM,ACRTDDA,ACRDNAM
 Q
EN1 W @IOF
 W !?20,"DOCUMENT DUPLICATION UTILITY"
 D DOC
 Q:$D(ACRQUIT)
 S ACRDUPJ=0
 F  D EN2 Q:$D(ACRQUIT)
 K ACRQUIT,ACRDUPJ
 Q
EN2 W !!
 I "^130^600^148^"[(U_ACRREF_U) D TRAVELER Q:$D(ACRQUIT)
 D DEPT
 Q:$D(ACRQUIT)!$D(ACROUT)
 I "^116^204^103^349^326^210^"[(U_ACRREF_U) D BOIL
 I "^130^600^148^"[(U_ACRREF_U) D AL
 Q:$D(ACRQUIT)!$D(ACROUT)
 D SURE
 Q:$D(ACRQUIT)
 S ACRNOT=""
 S ACRREF=$S("^116^204^103^349^326^210^"[(U_ACRREF_U):116,ACRREF=130!(ACRREF=600):130,1:ACRREF)
 S ACRREFDA=$O(^AUTTDOCR("B",ACRREF,0))
 D EN1^ACRFAUTO
 W !!,"The new document is now being created.  You can use the 'ER' function"
 W !,"to access and edit it under DEPARTMENT ACCOUNT ID NO.: ",ACRTDDA
 I +$G(ACRBOIL) D
 .D:"^116^204^103^349^326^210^"[(U_ACRREF_U) B
 .D:"^130^600^148^"[(U_ACRREF_U) A(.ACRBOIL,ACROBL2)
 D PAUSE^ACRFWARN
 Q
DEPT S ACRDIC="ACRLOCB"
 D CHOOSE^ACRFDTP4
 Q:$D(ACRQUIT)!$D(ACROUT)
 S DIC="^ACRLOCB("
 S DIC("A")=ACRDIC("A")
 S DIC(0)=ACRDIC(0)
 S DIC("DR")="",D=ACRD
 S DIC("S")="I $D(^ACRLOCB(""SEC"",DUZ,+Y))"
 D IX^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S (ACRFDNO,ACRLBDA,ACRTDDA,ACRZDA)=+Y
SETDEP ;EP;TO SET DEPARTMENT ACCOUNT INFORMATION
 I '$D(ACRLBDA)#2 S ACRQUIT="" Q
 I '$D(ACRFDNO)#2 S ACRQUIT="" Q
 I '$D(^ACRLOCB(ACRLBDA,0))#2 S ACRQUIT="" Q
 N X,Y
 S X=^ACRLOCB(ACRLBDA,0)
 S Y=^ACRLOCB(ACRLBDA,"DT")
 S ACRFY=+Y
 S ACRCANDA=$P(Y,U,9)
 S ACRAPPDA=$P(X,U,2)
 S ACRALWDA=$P(X,U,3)
 S ACRALWDA=$P(X,U,4)
 S ACRDPTDA=$P(X,U,5)
 S ACRDNAM=$P(^AUTTPRG(ACRDPTDA,0),U)
 S ACRCAN=$P(^AUTTCAN(ACRCANDA,0),U)
 Q
TRAVELER S DIC="^ACRAU("
 S DIC(0)="AEMQZ"
 I ACRREF'=148 S DIC("A")="Name of "_$S(ACRDUPJ>0:"NEXT TRAVELER.:",1:"TRAVELER......: ")
 E  S DIC("A")="Name of "_$S(ACRDUPJ>0:"NEXT ATTENDEE.:",1:"ATTENDEE......: ")
 D DIC^ACRFDIC
 Q:$D(ACRQUIT)
 I '+Y S ACRQUIT="" Q
 I '$D(^VA(200,+Y,0))#2 S ACRQUIT="" Q
 S ACRTDA=+Y
 N X
 ;S X=$P(^VA(200,+Y,0),U)  ;ACR*2.1*19.02 IM16848
 S X=$$NAME2^ACRFUTL1(+Y)  ;ACR*2.1*19.02 IM16848
 S X=$P($P(X,",",2)," ")_" "_$P(X,",")
 S ACRTNAM=X
 Q
SURE W !!,"You have chosen to duplicate DOCUMENT NO.: ",ACRDOC
 I "^130^600^148^"[(U_ACRREF_U) D
 .W !,"The ",$S(ACRREF'=148:"TRAVELER",1:"ATTENDEE")," for the new document is.....: ",ACRTNAM
 W !,"You have chosen to create the"
 W !,"NEW DOCUMENT in DEPARTMENT ACCOUNT ID NO.: ",ACRLBDA
 W ?$X+2,ACRDNAM
 W !?43,"FY: ",ACRFY
 W ?$X+2,"CAN: ",ACRCAN
 S DIR(0)="YO"
 S DIR("A",1)="Are you certain this information is correct"
 S DIR("A")="and you want to proceed with this duplication"
 S DIR("B")="NO"
 W !!
 D DIR^ACRFDIC
 I $G(Y)'=1 S ACRQUIT="" Q
 S ACRDUPJ=ACRDUPJ+1
 Q
DOC S DIC="^ACRDOC("
 S DIC(0)="AEMNQZ"
 S DIC("A")="Duplicate DOCUMENT NO.: "
 S DIC("S")="I $P($G(^ACROBL(+Y,""APV"")),U)'=""D"",'$P($G(^ACRDOC(+Y,0)),U,15),'$P($G(^(0)),U,19)" ;ACR*2.1*3.32
 W !!!
 D DIC^ACRFDIC
 Q:$D(ACRQUIT)
 I '+Y S ACRQUIT="" Q
 I '$D(^ACRDOC(+Y,0)) S ACRQUIT="" Q
 S ACRDOCDA=+Y
 D SETDOC^ACRFEA1
 I '$G(ACRREFDA) S ACRQUIT="" Q
 S:ACRREF=600 ACRREF=130
 S:"^103^349^326^210^"[(U_ACRREF_U) ACRREF=116
 S (ACRREF,ACRREFX)=$P(^AUTTDOCR(ACRREFDA,0),U)
 Q
BOIL ;DETERMINE IF BOILER PLATE STATEMENTS SHOULD BE DUPLICATED
 Q:'$D(^ACRDOCBP("C",ACRDOCDA))
 N J,X,Y
 W !!,"The following BOILER PLATE statements are on file for this document."
 W !!?10,"NO.",?15,"Type of Boiler Plate"
 W !?10,"---",?15,"------------------------------"
 S X=0
 F  S X=$O(^ACRDOCBP("C",ACRDOCDA,X)) Q:'X  D
 .S J=$G(J)+1
 .S J(J)=X
 .S Y=^ACRDOCBP(X,0)
 .W !?10,$J(J,3),?15,$P($G(^ACRBP(+Y,0)),U)
 S DIR(0)="LO^1:"_+J
 S DIR("A")="Duplicate which statement(s)"
 W !
 D DIR^ACRFDIC
 I '+ACRY K ACRQUIT Q
 S ACRBOIL=ACRY
 F J=1:1 S ACRX=$P(ACRBOIL,",",J) Q:'ACRX!('$G(J(+ACRX)))  S ACRBOIL(ACRX)=J(ACRX)
 Q
B N ACRX
 F J=1:1 S ACRX=$P(ACRBOIL,",",J) Q:'ACRX!('$G(ACRBOIL(+ACRX)))  D
 .S ACRX=ACRBOIL(ACRX)
 .S X=+$G(^ACRDOCBP(ACRX,0))
 .Q:'X
 .S DIC="^ACRDOCBP("
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_ACROBL2
 .D FILE^ACRFDIC
 .S ACRBPDA=+Y
 .S %X="^ACRDOCBP("_ACRX_",1,"
 .S %Y="^ACRDOCBP("_ACRBPDA_",1,"
 .D %XY^%RCR
 .S DA=ACRBPDA
 .S DIK="^ACRDOCBP("
 .D IX1^ACRFDIC
 K ACRBOIL,ACRBPDA
 Q
AL ;DETERMINE IF AIRLINE RESERVATIONS SHOULD BE DUPLICATED
 Q:'$D(^ACRAL("E",ACRDOCDA))
 N J,X,Y
 W !!,"The following AIRLINE RESERVATIONS are on file for this document."
 D DISPLAY^ACRFSS5
 S X=0
 F  S X=$O(^ACRAL("E",ACRDOCDA,X)) Q:'X  D
 .S J=$G(J)+1
 .S J(J)=X
 S DIR(0)="LO^1:"_+J
 S DIR("A")="Duplicate which reservation(s)"
 W !
 D DIR^ACRFDIC
 I '+ACRY K ACRQUIT Q
 S ACRBOIL=ACRY
 F J=1:1 S ACRX=$P(ACRBOIL,",",J) Q:'ACRX!('$G(J(+ACRX)))  S ACRBOIL(ACRX)=J(ACRX)
 Q
A(ACRBOIL,ACROBL2) ;
 ;----- DUPLICATES AIRLINE RESERVATIONS
 ;
 ;     INPUT:
 ;     ACRBOIL = ARRAY CONTAINING FLIGHT IENS FROM FMS AIRLINE
 ;                 INFORMATION FILE BEING DUPLICATED
 ;     ACROBL2 = DUPLICATE DOCUMENT IEN
 ;
 N ACRDATA,ACRX,DD,DIC,DO,FLD,J,X
 F J=1:1 S ACRX=$P(ACRBOIL,",",J) Q:'ACRX!('$G(ACRBOIL(+ACRX)))  D
 .S ACRX=ACRBOIL(ACRX)
 .S X=+$G(^ACRAL(ACRX,0))
 .Q:'X
 .S DIC="^ACRAL("
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_(ACROBL2)_";.03////"_ACROBL2
 .S ACRDATA=$G(^ACRAL(ACRX,"DT"))
 .F FLD=1:1:11 D
 ..S DIC("DR")=DIC("DR")_";"_FLD_"///"_$P(ACRDATA,U,FLD)
 .D FILE^DICN
 Q