ACRFSS5 ;IHS/OIRM/DSD/THL,AEF - EDIT FLIGHT SCHEDULE; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;CONTINUATION OF ACRFFSS4
EN K ACRQUIT
N ACRJ
F D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRAL,ACRAL1,ACRALDA,ACRALCST,ACRALACT,ACRALAR,ACRALCMP,ACRALDAT,ACRDA,ACRY,ACRI,ACRX,ACRQUIT,ACRALDAY,ACRALDCT,ACRALGTR,ACRALLV,ACRALNO,ACRALST
I $D(^ACRAL("E",ACRDOCDA)) D GOVCC
Q
EN1 D DISPLAY
K ACRQUIT
I ACRJ=0 S DIR(0)="SO^2:Add Airline Flight"
E S DIR(0)="SO^1:Edit Airline Flight;2:Add Airline Flight;3:Delete Airline Flight"
S DIR("A")="Which Option ===> "
D DIR^ACRFDIC
Q:$D(ACRQUIT)!$D(ACROUT)
I Y=1 D EDIT^ACRFSS51 K ACRQUIT Q
I Y=2 D ADD^ACRFSS51 K ACRQUIT Q
I Y=3 D DELETE^ACRFSS51 K ACRQUIT Q
Q
DISPLAY ;EP;
D HEAD
S (ACRALDA,ACRJ,ACRALTOT)=0
I '$D(^ACRAL("E",ACRDOCDA)) D Q
.W !?10,"NO AIRLINE FLIGHTS RECORDED FOR THIS TRAVEL ORDER."
F S ACRALDA=$O(^ACRAL("E",ACRDOCDA,ACRALDA)) Q:'ACRALDA D DP1:$D(^ACRAL(ACRALDA,0))
W !,"---"
W ?4,"------"
W ?11,"-------------------"
W ?31,"----"
W ?36,"-----"
W ?42,"----------"
W ?53,"----"
W ?58,"---------"
W ?68,"-----------"
W !?35,"TOTAL AIRLINE EXPENSE: "
W ?58,$J($FN(ACRALTOT,"P",2),9)
I $D(ACRPRT),$E(IOST,1,2)="C-" D PAUSE^ACRFWARN W @IOF
Q
DP1 S ACRJ=ACRJ+1
S ACRAL=ACRALDA_U_^ACRAL(ACRALDA,0)
S ACRAL1=$G(^ACRAL(ACRALDA,"DT"))
S ACRALDAY=$P(ACRAL,U,2)
I ACRALDAY'=ACRJ D
.S DA=ACRALDA
.S DIE="^ACRAL("
.S DR=".01///"_ACRJ
.D DIE^ACRFDIC
S ACRAL(ACRJ)=ACRAL
S ACRALDAT=$E($P($P(ACRAL1,U,4),","),4,7)
S ACRALNO=$P(ACRAL1,U,3),Y=$P(ACRAL1,U,4)
X ^DD("DD")
S ACRALLV=$P(Y,"@",2)
S Y=$P(ACRAL1,U,6)
X ^DD("DD")
S ACRALAR=$P(Y,"@",2)
S ACRALCMP=$S($P(ACRAL1,U,2)]"":$E($P(^ACRACOMP($P(ACRAL1,U,2),0),U),1,18),1:"")
S ACRALDCT=$S($P(ACRAL1,U,5)]"":$E($P(^ACRPD($P(ACRAL1,U,5),0),U),1,10),1:"")
S ACRALACT=$S($P(ACRAL1,U,7)]"":$E($P(^ACRPD($P(ACRAL1,U,7),0),U),1,10),1:"")
S ACRALST=$P(ACRAL1,U,8)
S ACRALCST=$P(ACRAL1,U,9),ACRALGTR=$P(ACRAL1,U,10)
W !,ACRJ
W ?4,ACRALNO
W ?11,ACRALCMP
W ?31,ACRALDAT
W ?36,ACRALLV
W ?42,ACRALDCT
W ?53,ACRALST
W ?58,$J($FN(ACRALCST,"P",2),9)
W ?68,ACRALGTR
W !?36,ACRALAR
W ?42,ACRALACT
S ACRALTOT=ACRALTOT+ACRALCST
Q
HEAD I $E(IOST,1,2)="C-" D
.W @IOF
.W !?10,@ACRON,"AIRLINE FLIGHTS",@ACROF," FOR DOCUMENT: "
.W @ACRON,ACRDOC,@ACROF
W !,"FLT"
W ?4,"FLT NO"
W ?11,"AIRLINE"
W ?31,"DATE"
W ?36,"LV/AR"
W ?42,"CITY"
W ?53,"SEAT"
W ?58,"COST"
W ?70,"GTR NO."
W !,"---"
W ?4,"------"
W ?11,"-------------------"
W ?31,"----"
W ?36,"-----"
W ?42,"----------"
W ?53,"----"
W ?58,"---------"
W ?68,"-----------"
Q
GOVCC ;INDICATE WHETHER AIRLINE TICKET WILL BE CHARGED TO THE TRAVELER'S
;GOVERNMENT CREDIT CARD
S DIR(0)="YO"
S DIR("A",1)="Charge Airline Ticket to Traveler's"
S DIR("A")="Government Credit Card"
S DIR("B")=$S($P($G(^ACRDOC(+$G(ACRDOCDA),"TOAU")),U,5)=1!($P(^ACRSYS(ACRADA,"DT"),U,18)=1):"YES",1:"NO")
W !
D DIR^ACRFDIC
Q:'$D(Y)#2
S DA=ACRDOCDA
S DIE="^ACRDOC("
S DR="130174////"_$S(+Y=1:1,1:0)
D DIE^ACRFDIC
Q
ACRFSS5 ;IHS/OIRM/DSD/THL,AEF - EDIT FLIGHT SCHEDULE; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;CONTINUATION OF ACRFFSS4
EN KILL ACRQUIT
+1 NEW ACRJ
+2 FOR
DO EN1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
EXIT KILL ACRAL,ACRAL1,ACRALDA,ACRALCST,ACRALACT,ACRALAR,ACRALCMP,ACRALDAT,ACRDA,ACRY,ACRI,ACRX,ACRQUIT,ACRALDAY,ACRALDCT,ACRALGTR,ACRALLV,ACRALNO,ACRALST
+1 IF $DATA(^ACRAL("E",ACRDOCDA))
DO GOVCC
+2 QUIT
EN1 DO DISPLAY
+1 KILL ACRQUIT
+2 IF ACRJ=0
SET DIR(0)="SO^2:Add Airline Flight"
+3 IF '$TEST
SET DIR(0)="SO^1:Edit Airline Flight;2:Add Airline Flight;3:Delete Airline Flight"
+4 SET DIR("A")="Which Option ===> "
+5 DO DIR^ACRFDIC
+6 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+7 IF Y=1
DO EDIT^ACRFSS51
KILL ACRQUIT
QUIT
+8 IF Y=2
DO ADD^ACRFSS51
KILL ACRQUIT
QUIT
+9 IF Y=3
DO DELETE^ACRFSS51
KILL ACRQUIT
QUIT
+10 QUIT
DISPLAY ;EP;
+1 DO HEAD
+2 SET (ACRALDA,ACRJ,ACRALTOT)=0
+3 IF '$DATA(^ACRAL("E",ACRDOCDA))
Begin DoDot:1
+4 WRITE !?10,"NO AIRLINE FLIGHTS RECORDED FOR THIS TRAVEL ORDER."
End DoDot:1
QUIT
+5 FOR
SET ACRALDA=$ORDER(^ACRAL("E",ACRDOCDA,ACRALDA))
IF 'ACRALDA
QUIT
IF $DATA(^ACRAL(ACRALDA,0))
DO DP1
+6 WRITE !,"---"
+7 WRITE ?4,"------"
+8 WRITE ?11,"-------------------"
+9 WRITE ?31,"----"
+10 WRITE ?36,"-----"
+11 WRITE ?42,"----------"
+12 WRITE ?53,"----"
+13 WRITE ?58,"---------"
+14 WRITE ?68,"-----------"
+15 WRITE !?35,"TOTAL AIRLINE EXPENSE: "
+16 WRITE ?58,$JUSTIFY($FNUMBER(ACRALTOT,"P",2),9)
+17 IF $DATA(ACRPRT)
IF $EXTRACT(IOST,1,2)="C-"
DO PAUSE^ACRFWARN
WRITE @IOF
+18 QUIT
DP1 SET ACRJ=ACRJ+1
+1 SET ACRAL=ACRALDA_U_^ACRAL(ACRALDA,0)
+2 SET ACRAL1=$GET(^ACRAL(ACRALDA,"DT"))
+3 SET ACRALDAY=$PIECE(ACRAL,U,2)
+4 IF ACRALDAY'=ACRJ
Begin DoDot:1
+5 SET DA=ACRALDA
+6 SET DIE="^ACRAL("
+7 SET DR=".01///"_ACRJ
+8 DO DIE^ACRFDIC
End DoDot:1
+9 SET ACRAL(ACRJ)=ACRAL
+10 SET ACRALDAT=$EXTRACT($PIECE($PIECE(ACRAL1,U,4),","),4,7)
+11 SET ACRALNO=$PIECE(ACRAL1,U,3)
SET Y=$PIECE(ACRAL1,U,4)
+12 XECUTE ^DD("DD")
+13 SET ACRALLV=$PIECE(Y,"@",2)
+14 SET Y=$PIECE(ACRAL1,U,6)
+15 XECUTE ^DD("DD")
+16 SET ACRALAR=$PIECE(Y,"@",2)
+17 SET ACRALCMP=$SELECT($PIECE(ACRAL1,U,2)]"":$EXTRACT($PIECE(^ACRACOMP($PIECE(ACRAL1,U,2),0),U),1,18),1:"")
+18 SET ACRALDCT=$SELECT($PIECE(ACRAL1,U,5)]"":$EXTRACT($PIECE(^ACRPD($PIECE(ACRAL1,U,5),0),U),1,10),1:"")
+19 SET ACRALACT=$SELECT($PIECE(ACRAL1,U,7)]"":$EXTRACT($PIECE(^ACRPD($PIECE(ACRAL1,U,7),0),U),1,10),1:"")
+20 SET ACRALST=$PIECE(ACRAL1,U,8)
+21 SET ACRALCST=$PIECE(ACRAL1,U,9)
SET ACRALGTR=$PIECE(ACRAL1,U,10)
+22 WRITE !,ACRJ
+23 WRITE ?4,ACRALNO
+24 WRITE ?11,ACRALCMP
+25 WRITE ?31,ACRALDAT
+26 WRITE ?36,ACRALLV
+27 WRITE ?42,ACRALDCT
+28 WRITE ?53,ACRALST
+29 WRITE ?58,$JUSTIFY($FNUMBER(ACRALCST,"P",2),9)
+30 WRITE ?68,ACRALGTR
+31 WRITE !?36,ACRALAR
+32 WRITE ?42,ACRALACT
+33 SET ACRALTOT=ACRALTOT+ACRALCST
+34 QUIT
HEAD IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:1
+1 WRITE @IOF
+2 WRITE !?10,@ACRON,"AIRLINE FLIGHTS",@ACROF," FOR DOCUMENT: "
+3 WRITE @ACRON,ACRDOC,@ACROF
End DoDot:1
+4 WRITE !,"FLT"
+5 WRITE ?4,"FLT NO"
+6 WRITE ?11,"AIRLINE"
+7 WRITE ?31,"DATE"
+8 WRITE ?36,"LV/AR"
+9 WRITE ?42,"CITY"
+10 WRITE ?53,"SEAT"
+11 WRITE ?58,"COST"
+12 WRITE ?70,"GTR NO."
+13 WRITE !,"---"
+14 WRITE ?4,"------"
+15 WRITE ?11,"-------------------"
+16 WRITE ?31,"----"
+17 WRITE ?36,"-----"
+18 WRITE ?42,"----------"
+19 WRITE ?53,"----"
+20 WRITE ?58,"---------"
+21 WRITE ?68,"-----------"
+22 QUIT
GOVCC ;INDICATE WHETHER AIRLINE TICKET WILL BE CHARGED TO THE TRAVELER'S
+1 ;GOVERNMENT CREDIT CARD
+2 SET DIR(0)="YO"
+3 SET DIR("A",1)="Charge Airline Ticket to Traveler's"
+4 SET DIR("A")="Government Credit Card"
+5 SET DIR("B")=$SELECT($PIECE($GET(^ACRDOC(+$GET(ACRDOCDA),"TOAU")),U,5)=1!($PIECE(^ACRSYS(ACRADA,"DT"),U,18)=1):"YES",1:"NO")
+6 WRITE !
+7 DO DIR^ACRFDIC
+8 IF '$DATA(Y)#2
QUIT
+9 SET DA=ACRDOCDA
+10 SET DIE="^ACRDOC("
+11 SET DR="130174////"_$SELECT(+Y=1:1,1:0)
+12 DO DIE^ACRFDIC
+13 QUIT