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

ACRFEA.m

Go to the documentation of this file.
ACRFEA ;IHS/OIRM/DSD/THL,AEF - EDIT FINANCIAL DATA;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO EDIT FINANCIAL DATA
EN ;EP;
 I $D(ACRNEWOB),(ACRENTRY["OBLAMT") D EN1,EXIT Q
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT D EXITFEA^ACRFEXIT
 W @IOF
 Q
EN1 D SET
 I $D(ACRRR)#2 D  Q
 .D ^ACRFRR
 .K ACRRR
 .S ACRQUIT=""
 D FDTP1:'$D(ACRQUIT)
 D ^ACRFEA4:'$D(ACRQUIT)&'$D(ACRPRT)&'$D(ACRCSI)
 Q:$D(ACROUT)!$D(ACRQUIT)!$D(ACROUT)
 D TRANS^ACRFEA2:ACRENTRY'["APP"&(ACRENTRY'["OBLAMT")
 Q
FDTP1 ;CONTROLLER FOR DIC("S") FOR ALL ACCOUNT AND OBLIGATIONS LOOKUPS
 I ACRENTRY["APPAMT",$D(ACRFDNO) D  Q
 .S DA=ACRFDNO
 .D ^ACRFEA4
 .S ACRQUIT=""
 I ACRENTRY["FDIS",$D(ACRFDNO) D FDTP11 Q
 I '$D(ACRNEWOB) D FDTP12
 I ACRENTRY["ALLAMT" D  Q
 .S DIC("S")="I $P(^ACRALW(+Y,0),U,2)=ACRFDNO,$D(^ACRALW(""SEC"","_DUZ_",+Y))"
 .D DIC
 I ACRENTRY["ALC" D  Q
 .S DIC("S")="I $P(^ACRALC(+Y,0),U,3)=ACRFDNO,$D(^ACRALC(""SEC"","_DUZ_",+Y))"
 .D DIC
 I ACRENTRY["LOCB" D  Q
 .S DIC("S")="I $P(^ACRLOCB(+Y,0),U,4)=ACRFDNO,$D(^ACRLOCB(""SEC"","_DUZ_",+Y))"
 .D DIC
 Q:ACRENTRY'["OBLA"
ACRREV I $D(ACRREV),$D(ACRCOMP) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,""ACD""[$E(ACRAPV)!(""ACD""[$P(ACRAPV,U,3)) W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
 I $D(ACRREV) D  Q
 .S DIC("S")="I $P(ACR,U,6)=ACRFDNO W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
ACRCSI I $D(ACRCSI) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0) I $P(ACR,U,6)=ACRFDNO W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
REACT I $D(ACRREACT),'$D(ACRJVOD) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,'$$OBL^ACRFEA(+Y),$P(ACRAPV,U)]"""",""ACD""[$P(ACRAPV,U)!(""D""[$P(ACRAPV,U,3)) W @(""$E(""_DIC_""Y,0),0)"")"
 .K ACRQUIT
 .D DIC
JVOD I $D(ACRJVOD) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,$E(ACRAPV)=""A"",$P(ACRAPV,U,3)=""A"" W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
ACRCTV I $D(ACRCTV) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,$P(ACRAPV,U)]"""",""CD""'[$E(ACRAPV),$P(ACRAPV,U,7)=19,$P(ACRAPV,U,8)="""",$P(ACR,U,13)=$O(^AUTTDOCR(""B"",600,0)) W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
ACRCONV I $D(ACRCONV),'$D(ACRCTV) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,$P(^ACROBL(Y,""CONV""),U)=""Y"" W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
ACRTV I '$D(ACRREACT) D  Q
 .S DIC("S")="S ACR=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")) I $P(ACR,U,6)=ACRFDNO,$P(ACRAPV,U)="""",$P(ACRAPV,U,3)="""" W @(""$E(""_DIC_""Y,0),0)"")"
 .D DIC
 Q
DIC I $D(ACRCSIS) D PAUSE^ACRFWARN S ACRQUIT="" Q
 W !
 D EDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 Q
FDTP11 S ACRLBDA=ACRFDNO
 S ACRALCDA=$P(^ACRLOCB(ACRLBDA,0),U,4)
 D ^ACRFDIS
 S ACRQUIT=""
 Q
FDTP12 S ACRFADD=""
 S:$D(ACRLBDA) ACRDISDA=ACRLBDA
 S ACRDISP=""
 D FDTP^ACRFDTP
 K ACRFADD
 Q
SET ;EP;
 S (ACRDIC,ACRDIE)=$P(ACRENTRY,";;",3)
 S ACRGREF=$P(ACRDIC,"(")
 S ACRDR=$P(ACRENTRY,";;",5)
 S ACRDIC("A")=$P(ACRENTRY,";;",6)
 S ACRD=$P(ACRENTRY,";;",7)
 S ACRDIC(0)="AELNZ"
 S ACRRTN="^"_$P(ACRENTRY,";;",4)
 S (ACRY,ACRTYPS)=$P(ACRENTRY,";;",2)
 S ACRENTR2=$P(ACRENTRY," ")
 Q
EDIC S DIC("DR")=""
 I ACRENTRY["OBLAMT" D  I 1
 .D ^ACRFEA1
 .K ACRCONT
 E  D DIC1^ACRFEA2
DICC Q:$D(ACRQUIT)!$D(ACROUT)!'$D(ACRZY)
 Q:($P(ACRZY,U,3)'=1)!$D(ACRPRT)
 I ACRENTRY'["DOC",ACRENTRY'["APP",ACRENTRY'["OBLA" D  Q
 .S DA=ACRZDA
 .S DIE=ACRDIE
 .S DR=$S((ACRENTRY["ALLAMT"):".02",ACRENTRY["LOCB":".04",1:".03")
 .S DR=DR_"////"_ACRFDNO_";2////0.00;3////0.00;800////N"
 .D DIE^ACRFDIC
 I ACRENTRY["OBLA" D
 .S ACRFINSS=""
 .S DA=ACRDOCDA
 .S DIE="^ACRDOC("
 .S DR=".05////"_ACRDOCDA_";.06////"_ACRFDNO
 .D DIE^ACRFDIC
 I ACRENTRY'["OBLA" D
 .S ACRFINSS=""
 .S DA=ACRZDA
 .S DIE=ACRDIE
 .S DR=ACRDR
 .D DIE^ACRFDIC
 Q
ENTRY ;EP;CONTROLS EDITING DEPENDING ON VALUE OF 'ACRENTRY' WHEN ROUTINE CALLED
 S ACRENTRY=$T(@ACRENTRY^ACRFCTL1)
 S ACRZY=""
 G EN
 Q
DISP ;EP;TO DISPLAY FINANCIAL ACCOUNT DATA
 W @IOF
 W ?20,"Current ",@ACRON,ACRFDNY,@ACROF," data:"
 W !
 N DXS,DIP,DC,DN,D0
 S D0=ACRZDA
 D @ACRRTN
 Q
OBL(X) ;EP;DETERMINE IF OBLIGATION HAS BEEN MADE AGAINST THE DOCUMENT      
 Q:'X
 N Y,ACRQUIT
 S Y=0
 S ACRQUIT=""
 F  S Y=$O(^ACRDHR("E",X,Y)) Q:'Y  D
 .I $P($G(^ACRDHR(+Y,1)),U,3,4)="050^1" S ACRQUIT=1
 .I $P($G(^ACRDHR(+Y,1)),U,3,4)="050^2" S ACRQUIT=0
 Q ACRQUIT