EN70P96 ;ALB/CXW - EN V7.0 POST INIT, NX BOC Update; 05/05/14 1:03 pm
;;7.0;ENGINEERING;**96**;Aug 17, 1993;Build 5
Q
;
POST ; entry point for post-init
; Updates to the NX BOC file (#6914.4)
N ENX
D MSG(" EN*7.0*96 Post-Install .....")
D UPBOC
D MSG(" EN*7.0*96 Post-Install Complete")
Q
;
UPBOC ; add 1 new BOC and deactivate 3 BOCs
N U,ENI,ENBOC,ENBOC1,ENDDT,ENDDT1,ENRC,ENSGL,ENSGL1,ENTL,DIC,DIE,DR,X,Y,DA
S U="^" D MSG("")
D MSG(">>> Updating Budget Object Code (BOC) in the NX BOC file (#6914.4)...")
F ENI=1:1 S ENRC=$P($T(NXBOC+ENI),";;",2) Q:ENRC="QUIT" D
. S ENBOC=$P(ENRC,U)
. S ENBOC1=$O(^ENG(6914.4,"B",ENBOC,0))
. S ENTL=$P(ENRC,U,2)
. S ENDDT=$P(ENRC,U,4)
. S ENSGL=$P(ENRC,U,3)
. S ENSGL1=$O(^ENG(6914.3,"B",ENSGL,0))
. ; add a new code
. I 'ENBOC1 D Q
.. I 'ENSGL1 D MSG(" >> SGL "_ENSGL_" for BOC "_ENBOC_" not defined in the NX SGL file (#6914.3), no update") Q
.. ; the old code should already exist in the file
.. I ENDDT D MSG(" >> "_ENBOC_" not defined in the NX BOC file (#6914.4). no update") Q
.. S X=ENBOC,DIC="^ENG(6914.4,",DIC(0)="" D FILE^DICN
.. I Y<0 D MSG(" >> ERROR when adding "_ENBOC_" to the file, Log a Remedy ticket!") Q
.. S DA=+Y,DIE=DIC,DR="1///"_$P(ENRC,U,2)_";2///"_ENSGL1 D ^DIE
.. D MSG(" >> "_ENBOC_" "_ENTL_" added")
. S ENRC=$G(^ENG(6914.4,ENBOC1,0))
. S ENDDT1=$P(ENRC,U,5)
. ; deactivate the code
. I ENDDT'=ENDDT1 D Q
.. S DA=ENBOC1,DIE="^ENG(6914.4,",DR="4///"_ENDDT D ^DIE
.. D MSG(" >> "_ENBOC_" "_ENTL_" deactivated with date "_$$FMTE^XLFDT(ENDDT))
. D MSG(" >> "_ENBOC_" "_ENTL_" has already been "_$S(ENDDT:"deactivated in",1:"added to")_" the file")
D MSG("")
Q
;
MSG(ENX) ;
D MES^XPDUTL(ENX)
Q
;
NXBOC ; capitalized budget object code^boc title^corresponding sgl^deactivated date
;;3105^TRUST EQUIPMENT^1750^3080828
;;3122^OFFICE AUTOMATION/WORD PROCESSING, PURCHASED^1750^3140508
;;3123^ADP EQUIPMENT^1751^3140508
;;3138^IT HARDWARE-CAPITALIZED^1751
;;QUIT
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEN70P96 2034 printed Nov 22, 2024@17:01:35 Page 2
EN70P96 ;ALB/CXW - EN V7.0 POST INIT, NX BOC Update; 05/05/14 1:03 pm
+1 ;;7.0;ENGINEERING;**96**;Aug 17, 1993;Build 5
+2 QUIT
+3 ;
POST ; entry point for post-init
+1 ; Updates to the NX BOC file (#6914.4)
+2 NEW ENX
+3 DO MSG(" EN*7.0*96 Post-Install .....")
+4 DO UPBOC
+5 DO MSG(" EN*7.0*96 Post-Install Complete")
+6 QUIT
+7 ;
UPBOC ; add 1 new BOC and deactivate 3 BOCs
+1 NEW U,ENI,ENBOC,ENBOC1,ENDDT,ENDDT1,ENRC,ENSGL,ENSGL1,ENTL,DIC,DIE,DR,X,Y,DA
+2 SET U="^"
DO MSG("")
+3 DO MSG(">>> Updating Budget Object Code (BOC) in the NX BOC file (#6914.4)...")
+4 FOR ENI=1:1
SET ENRC=$PIECE($TEXT(NXBOC+ENI),";;",2)
if ENRC="QUIT"
QUIT
Begin DoDot:1
+5 SET ENBOC=$PIECE(ENRC,U)
+6 SET ENBOC1=$ORDER(^ENG(6914.4,"B",ENBOC,0))
+7 SET ENTL=$PIECE(ENRC,U,2)
+8 SET ENDDT=$PIECE(ENRC,U,4)
+9 SET ENSGL=$PIECE(ENRC,U,3)
+10 SET ENSGL1=$ORDER(^ENG(6914.3,"B",ENSGL,0))
+11 ; add a new code
+12 IF 'ENBOC1
Begin DoDot:2
+13 IF 'ENSGL1
DO MSG(" >> SGL "_ENSGL_" for BOC "_ENBOC_" not defined in the NX SGL file (#6914.3), no update")
QUIT
+14 ; the old code should already exist in the file
+15 IF ENDDT
DO MSG(" >> "_ENBOC_" not defined in the NX BOC file (#6914.4). no update")
QUIT
+16 SET X=ENBOC
SET DIC="^ENG(6914.4,"
SET DIC(0)=""
DO FILE^DICN
+17 IF Y<0
DO MSG(" >> ERROR when adding "_ENBOC_" to the file, Log a Remedy ticket!")
QUIT
+18 SET DA=+Y
SET DIE=DIC
SET DR="1///"_$PIECE(ENRC,U,2)_";2///"_ENSGL1
DO ^DIE
+19 DO MSG(" >> "_ENBOC_" "_ENTL_" added")
End DoDot:2
QUIT
+20 SET ENRC=$GET(^ENG(6914.4,ENBOC1,0))
+21 SET ENDDT1=$PIECE(ENRC,U,5)
+22 ; deactivate the code
+23 IF ENDDT'=ENDDT1
Begin DoDot:2
+24 SET DA=ENBOC1
SET DIE="^ENG(6914.4,"
SET DR="4///"_ENDDT
DO ^DIE
+25 DO MSG(" >> "_ENBOC_" "_ENTL_" deactivated with date "_$$FMTE^XLFDT(ENDDT))
End DoDot:2
QUIT
+26 DO MSG(" >> "_ENBOC_" "_ENTL_" has already been "_$SELECT(ENDDT:"deactivated in",1:"added to")_" the file")
End DoDot:1
+27 DO MSG("")
+28 QUIT
+29 ;
MSG(ENX) ;
+1 DO MES^XPDUTL(ENX)
+2 QUIT
+3 ;
NXBOC ; capitalized budget object code^boc title^corresponding sgl^deactivated date
+1 ;;3105^TRUST EQUIPMENT^1750^3080828
+2 ;;3122^OFFICE AUTOMATION/WORD PROCESSING, PURCHASED^1750^3140508
+3 ;;3123^ADP EQUIPMENT^1751^3140508
+4 ;;3138^IT HARDWARE-CAPITALIZED^1751
+5 ;;QUIT
+6 ;
+7 QUIT