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

ACRFTRX.m

Go to the documentation of this file.
ACRFTRX ;IHS/OIRM/DSD/THL,AEF - DOCUMENT TRANSACTION HISTORY DISPLAY AND EDIT; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE USED FOR DOCUMENT TRANSACTION HISTORY DISPLAY AND EDIT
EN F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRJ,ACRX,ACRDOCDA,ACRDOCDA,ACRTTYP,ACRTX,ACRTX1,ACRX,ACRDELM,ACRDOC
 K ACRLBDA,ACRNOW,ACROBL,ACRQUIT,ACRSPT,ACRTXAMT,ACRTXCOD,ACRTXDA
 K ACRTXDAT,ACRTXDA
 Q
EN1 D DISPLAY
 D SELECT
 Q
DISPLAY W @IOF
 S ACRTX=$O(^ACRTRX("C",ACRDOCDA,""))
 S ACRTX=^ACRTRX(ACRTX,0)
 I ACRTX="" S ACRQUIT="" Q
 S ACRDOCDA=$P(ACRTX,U,2)
 S ACRDOCDA=$P(ACRTX,U,3)
 S ACRLBDA=$P(ACRTX,U,4)
 S ACROBL=$P(^ACROBL(ACRDOCDA,0),U)
 S ACRSPT=$P(^ACROBL(ACRDOCDA,"DT"),U,2)
 S ACRDOC=$S($P(^ACRDOC(ACRDOCDA,0),U)]""&'$D(ACRREQST):$P(^(0),U,2),1:$P(^(0),U))
 S ACRX="DOCUMENT TRANSACTION HISTORY"
 W !!?80-$L(ACRX)\2,ACRX
 K ACRX
 W !!?38,"TOTAL"
 W ?50,"TOTAL"
 W !?20,"DOCUMENT NO."
 W ?35,"REQUEST"
 W ?49,"PAYMENT"
 W !?20,"------------"
 W ?35,"----------"
 W ?47,"-----------"
 W !?20,ACRDOC
 W ?35,$J(ACROBL,10)
 W ?$X+3,$J(ACRSPT,10)
 W !!?29,"TRANSACTION"
 W ?42,"TRANSACTION"
 W ?55,"TRANSACTION"
 W !?2,"NO."
 W ?7,"TRANSACTION TYPE"
 W ?31,"AMOUNT"
 W ?46,"DATE"
 W ?59,"CODE"
 W !?2,"---"
 W ?7,"--------------------"
 W ?29,"-----------"
 W ?42,"-----------"
 W ?55,"-----------"
 S (ACRTTYP,ACRJ)=0
 F  S ACRTTYP=$O(^ACRTRX("AC",ACRDOCDA,ACRTTYP)) Q:'ACRTTYP  D
 .S ACRTXDA=0
 .F  S ACRTXDA=$O(^ACRTRX("AC",ACRDOCDA,ACRTTYP,ACRTXDA)) Q:'ACRTXDA  D
 ..S ACRJ=ACRJ+1
 ..D DISP1
 Q
DISP1 Q:ACRTTYP="O"
 S ACRTX=ACRTXDA_"^"_^ACRTRX(ACRTXDA,0)
 S ACRTX1=^ACRTRX(ACRTXDA,"DT")
 S ACRTX(ACRJ)=ACRTX
 S ACRTXAMT=$P(ACRTX1,U)
 S ACRTXCOD=$P(ACRTX1,U,2)
 S ACRTXDAT=$P(ACRTX,U,11)
 S Y=ACRTXDAT
 X ^DD("DD")
 S ACRTXDAT=Y
 K Y
 S ACRX=$P(^DD(9002192,.01,0),U,3)
 S ACRDELM=ACRTTYP_":"
 S ACRTXDA=$P(ACRX,ACRDELM,2)
 S ACRTXDA=$P(ACRTXDA,";")
 W !?2,$J(ACRJ,3)
 W ?7,ACRTXDA
 W ?29,$J(ACRTXAMT,10)
 W ?42,$E(ACRTXDAT,1,11)
 W ?55,ACRTXCOD
 Q
SELECT S DIR(0)="SO^1:Edit one of the above;2:Add another transaction^K:X'?1N!(X<1)!(X>2) X"
 S DIR("A")="Your choice ==> "
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 I X=1 D EDIT Q
 D ADD
 Q
EDIT S DIR(0)="NOA^1:"_ACRJ_"^K:X'?1N.2N!(X<1)!(X>ACRJ)!'$D(ACRSS(X)) X"
 S DIR("A")="Transaction NO. ==> "
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 S ACRX=ACRTX(X)
 S ACRTXDA=$P(ACRX,U)
 S ACRTTYP=$P(ACRX,U,2)
 I "I"[ACRTTYP S ACROBL=ACROBL-$P(^ACRTRX(ACRTXDA,"DT"),U) D DIE
 I "D"[ACRTTYP S ACROBL=ACROBL+$P(^ACRTRX(ACRTXDA,"DT"),U) D DIE
 I "C"[ACRTTYP D DIE
 I "APF"[ACRTTYP D
 .S ACRSPT=ACRSPT-$P(^ACRTRX(ACRTXDA,"DT"),U)
 .S:ACRSPT'["." ACRSPT=ACRSPT_".00"
 .D DIE
 D DIE^ACRFDIC
 Q
ADD S DIR(0)="9002192,.01"
 S DIR("A")="Transation type"
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 S (X,ACRTTYP)=X
 S DIC="^ACRTRX("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";.04////"_ACRLBDA
 D FILE^ACRFDIC
 S ACRTXDA=+Y
 D EDIE
 Q
EDIE W !!
 D NOW^%DTC
 S ACRNOW=%
 S DA=ACRTXDA
 S DIE="^ACRTRX("
 S DR="10T;1T;2////"_ACRNOW_";3////"_DUZ
 S DIE("NO^")="NO"
 D DIE^ACRFDIC
 I "I"[ACRTTYP D
 .S ACROBL=ACROBL+$P(^ACRTRX(ACRTXDA,"DT"),U)
 .S:ACROBL'["." ACROBL=ACROBL_".00"
 .D DIE
 I "D"[ACRTTYP D
 .S ACROBL=ACROBL-$P(^ACRTRX(ACRTXDA,"DT"),U)
 .S:ACROBL'["." ACROBL=ACROBL_".00"
 .D DIE
 I "C"[ACRTTYP D DIE
 I "PF"[ACRTTYP D
 .S ACRSPT=ACRSPT+$P(^ACRTRX(ACRTXDA,"DT"),U)
 .S:ACRSPT'["." ACRSPT=ACRSPT_".00"
 .D DIE
 Q
DIE S:ACROBL'["." ACROBL=ACROBL_".00"
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR=".01///"_ACROBL
 I "C"[ACRTTYP S DR=".01///0;2////0.00"
 I "APF"[ACRTTYP S DR="2///"_ACRSPT
 D DIE^ACRFDIC
 Q