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

ASUCORUN.m

Go to the documentation of this file.
  1. ASUCORUN ; IHS/ITSC/LMH -UPDATE UTILITY FUNCTIONS ;
  1. ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
  1. ;This routine is the primary control routine for assuring that
  1. ;closeouts are run in logical sequence. Based on flags set in the
  1. ;Site file, daily closeouts may run only if the previous monthly
  1. ;closeout was completed within a selected time frame. A yearly
  1. ;closeout is allowed only if the previous closeout was for the month
  1. ;of September.
  1. ;The status of the previous closeout is also checked to assure
  1. ;that it was correctly completed before a new closeout is allowed.
  1. ;All of these functions are controlled by flags in the Site file.
  1. I ASUP("STS")="N"!(ASUP("CKP")>0) D Q:'ASUP("OK")
  1. .I ASUP("TYP")'=ASUP("LSTY") D Q
  1. ..D EN2^ASUCOSTS
  1. ..W *7,!!,"You have selected a '",$S(ASUP("TYP")=1:"monthly closeout",ASUP("TYP")=2:"yearly closeout",1:"daily closeout"),"'. The earlier run must first be completed."
  1. ..W !!,"Contact your Supervisor or select a '",ASUP("LSTN"),"' to resolve the problem.",*7,!
  1. ..K DIR S DIR(0)="E" D ^DIR
  1. ..S ASUP("HLT")=1,ASUP("OK")=0
  1. .S ASUP("RE*")=1
  1. .D EN2^ASUCOSTS
  1. .S DIR("?")="Enter 'Y' to restart or 'N' to cancel this closeout run."
  1. .S DIR("A")="This will 'RESTART' that run, OK"
  1. .S DIR("B")="Y"
  1. .S DIR(0)="Y"
  1. .D ^DIR
  1. .I $D(DUOUT)!($D(DTOUT)) S ASUP("HLT")=1,ASUP("RE*")=0,ASUP("OK")=0 Q
  1. .S ASUP("OK")=Y
  1. .I ASUP("OK") D
  1. ..S ASUP("HLT")=0,ASUP("RE*")=1
  1. ..S:ASUP("TYP")=1 ASUP("MO")=$E(ASUP("LSMO"),1,2),ASUP("MOYR")=ASUP("LSMO"),ASUP("YR")=$E(ASUP("MOYR"),3,4)
  1. .E D
  1. ..S ASUP("HLT")=1,ASUP("RE*")=0
  1. S ASUP("RE*")=+$G(ASUP("RE*"))
  1. I ASUP("RE*") Q
  1. I ASUP("STR")="N"!(ASUP("CKS")>0) D
  1. .W !,"Standard Reports from Previous Closeout not Sucessfully Printed I will now print them",!,"You will then need to run this Closeout again after they have printed"
  1. .S ASUP("OK")=1,ASUP("RE*")=1
  1. I ASUP("IVR")="N"!(ASUP("CKI")>0) D
  1. .W !,"Invoice Reports from Previous Closeout not Sucessfully Printed",!,"Print them and run this Closeout after they are printed"
  1. .S ASUP("OK")=1,ASUP("RE*")=1
  1. I ASUP("HLT") S ASUP("OK")=0
  1. S ASUP("OK")=$G(ASUP("OK")) S:ASUP("OK")="" ASUP("OK")=1
  1. Q
  1. ASK ;EP ;GET RUN DATE
  1. K DIR S DIR(0)="P^9002039.98",DIR("A")="Enter Run Date" D ^DIR
  1. I $D(DUOUT)!($D(DTOUT)) S ASUP("HLT")=1 Q
  1. S ASUP("MO")=$E($P(Y,U,2),4,5),ASUP("YR")=$E($P(Y,U,2),2,3),ASUP("MOYR")=ASUP("MO")_ASUP("YR")
  1. Q
  1. SETRUN ;EP ; -SET RUN DATE EQUAL DATE
  1. I '$D(ASUP("NXMO")) D SETCTRL^ASUCOSTS
  1. S X=(ASUP("NXMO")*.01)+.01,ASUP("MO")=$P(X,".",2)
  1. S:ASUP("MO")="13" ASUP("MO")=12
  1. I ASUP("MO")="09",9'=+ASUK("DT","MO") D
  1. .S ASUP("YR")=ASUK("DT","PFY")
  1. E D
  1. .S ASUP("YR")=ASUK("DT","CFY")
  1. S ASUP("MOYR")=ASUP("MO")_ASUP("YR")
  1. Q
  1. KILL ;EP; COMMON TRANSACTION PROCESSING ROUTINE VARIABLE KILL
  1. K ASU,ASUM,ASUS,ASUT,ASUV,ASUSV
  1. K DA,DIC,DIE,DR,X,Y
  1. Q