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

ASURM75P.m

Go to the documentation of this file.
ASURM75P ; IHS/ITSC/LMH -STOCK ISSUES/BUDGET ANAL SUMMARY ; 
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;This routine formats and prints report 75, Stock Issues / Budget
 ;Analysis Summary Report.
EN ;EP;PRIMARY ENTRY POINT FOR REPORT 75
 Q  ;WAR 5/21/99
 I '$D(IO) D HOME^%ZIS
 I '$D(DUZ(2)) W !,"Report must be run from Kernel option" Q
 I '$D(ASUL(1,"AR","AP")) D SETAREA^ASULARST
 S ASUK("PTRSEL")=$G(ASUK("PTRSEL")) I ASUK("PTRSEL")]"" G PSER
 S ZTRTN="PSER^ASURM75P",ZTDESC="SAMS RPT 75" D O^ASUUZIS
 I POP S IOP=$I D ^%ZIS Q
 I ASUK(ASUK("PTR"),"Q") Q
PSER ;EP;FOR TASKMAN QUEUE OF PRINT
 D U^ASUUZIS
 S ASUF("HDR")=1
 S ASUC("LN")=0
 S X=$O(^XTMP("ASUR","R75",0))
 I X']"" D CLS^ASUUHDG W !!,"NO DATA FOR REPORT 75" G K
 S ASUV("TOT")="""TOT"""
 F ASUU(11)=1:1:9 S ASUT=$P($T(COLNAM+ASUU(11)),";",3) D
 .F ASUU(12)=1:1:4 S ASURZ="ASUA("_ASUV("TOT")_","_ASUU(12)_","_ASUT_")",@ASURZ=0
 S (ASUV("DT","FM"),Y)=$P(^XTMP("ASUR","R74",0),U,2) X ^DD("DD") S ASUV("DT")=Y,ASUC("PG")=0
 S ASUX("SSA")=0
 F  S ASUX("SSA")=$O(^XTMP("ASUR","R75",ASUX("SSA"))) Q:ASUX("SSA")=""  Q:$D(DTOUT)  D  Q:$D(DUOUT)
 .S ASUA("SSA")=^XTMP("ASUR","R75",ASUX("SSA"))
 .S ASUX("ACC")="",ASUF("ACC")=0
 .F  S ASUX("ACC")=$O(^XTMP("ASUR","R75",ASUX("SSA"),ASUX("ACC"))) Q:ASUX("ACC")=""  Q:$D(DTOUT)  D  Q:$D(DUOUT)
 ..S ASUX("SST")=""
 ..S ASUF("ACC")=1
 ..S ASUK("ACC","NM")=^XTMP("ASUR","R75",ASUX("SSA"),ASUX("ACC"))
 ..F  S ASUX("SST")=$O(^XTMP("ASUR","R75",ASUX("SSA"),ASUX("ACC"),ASUX("SST"))) Q:ASUX("SST")=""  Q:$D(DTOUT)  D
 ...S ASUA("SST")=$P($P(^XTMP("ASUR","R75",ASUX("SSA"),ASUX("ACC"),ASUX("SST")),U)," -",2)
 ...S ASULA=^XTMP("ASUR","R75",ASUX("SSA"),ASUX("ACC"),ASUX("SST"))
 ...S ASUA("BASE")=$P(ASULA,U,2)
 ...S ASUA("ADJS")=$P(ASULA,U,3)
 ...S ASUA("BUDG")=ASUA("BASE")+ASUA("ADJS")
 ...S ASUA("ALOT")=$P(ASULA,U,4)
 ...S ASUA("YTD")=$P(ASULA,U,6)
 ...S ASUA("NOR")=$P(ASULA,U,7)
 ...S ASUA("TYTD")=ASUA("YTD")+ASUA("NOR")
 ...S ASUA("BAL")=ASUA("ALOT")-(ASUA("YTD")+ASUA("NOR"))
 ...I ASUA("BUDG")=0,ASUA("BAL")=0 D
 ....S ASUA("PROJ")=0
 ...E  D  Q:$D(DUOUT)
 ....S ASUA("DIV")=$E(ASUV("DT","FM"),4,5)+3 S:ASUA("DIV")>12 ASUA("DIV")=ASUA("DIV")-12
 ....S ASUA("PROJ")=ASUA("BUDG")-(((ASUA("YTD")/ASUA("DIV"))*12)+ASUA("NOR"))
 ...S ASUC("LN")=ASUC("LN")+1 S:ASUC("LN")>58 ASUF("HDR")=1
 ...D:ASUF("HDR") HEADER Q:$D(DUOUT)
 ...I ASUF("ACC") W !," ACC ",ASUX("ACC")
 ...W ?18,ASUA("SST")
 ...S ASUF("TOT")=0 D PRLINE
 ...I ASUF("ACC") W !," ",ASUK("ACC","NM") S ASUF("ACC")=0 Q
 ...W !
 ..Q:$D(DTOUT)
 ..S ASUF("TOT")=1 D
 ...S ASUC("LN")=ASUC("LN")+1
 ...F ASUU(14)=1:1:7 S X=(ASUU(14)*12)+27 W ?X," -----------"
 ...W !,ASUK("ACC","NM")," " D PRTOTL
 .Q:$D(DTOUT)
 .S ASUF("TOT")=2 W !,ASUA("SSA")," " D PRTOTL
 .S ASUF("HDR")=1
 G:$D(DTOUT)!('ASUF("HDR")) K
 S ASUF("TOT")=3 W ! D PRTOTL
K ;
 K ASUU(11),ASUU(12),ASUU(13),ASUU(14),ASUC,ASUF,ASULA,ASUT,ASUV,ASUX,ASURZ,ASURZA,ASURZW
 K DFOUT,DLOUT,DTOUT,DUOUT
 K X,X2,X3,Y
 D PAZ^ASUURHDR
 I ASUK("PTRSEL")]"" W @IOF Q
 D C^ASUUZIS
 Q
PRTOTL ;
 S ASUC("LN")=ASUC("LN")+2
 W $P($T(TOTNAM+ASUF("TOT")),";",3)
 D PRLINE
 W !
 F ASUU(14)=1:1:7 S X=(ASUU(14)*12)+27 W ?X," ==========="
 Q
PRLINE ;
 F ASUU(11)=1:1:7 S ASUT=$P($T(COLNAM+ASUU(11)),";",3) D
 .S X=(ASUU(11)*12)+27,ASUU(13)=ASUF("TOT")+1
 .S ASURZ="ASUA("_ASUT_")"
 .S:ASUF("TOT")>0 ASURZ="ASUA("_ASUV("TOT")_","_ASUF("TOT")_","_ASUT_")"
 .S ASURZA="ASUA("_ASUV("TOT")_","_ASUU(13)_","_ASUT_")"
 .S ASURZW="W ?X,$J($FN("_ASURZ_","",+T"",0),12)"
 .X ASURZW
 .S @ASURZA=@ASURZA+@ASURZ,@ASURZ=0
 I ASUF("TOT")=0!(ASUF("TOT")=3) Q
 W ! S ASUC("LN")=ASUC("LN")+1
 I ASUF("TOT")=2 W ! S ASUC("LN")=ASUC("LN")+1
 Q
 S ASUC("PG")=ASUC("PG")+1 D:ASUC("PG")>1 PAZ^ASUURHDR Q:$D(DUOUT)  W @IOF
 W !,"REPORT #75 SUMMARY OF STORES STOCK ISSUES/BUDGET ANALYSIS",?65,"AS OF: ",ASUV("DT"),?99,"PAGE:",$J(ASUC("PG"),3)
 W !!,"SUB-SUB ACTIVITY: ",ASUA("SSA")
 W !!!?43,"ANNUAL",?55,"BUDGET",?67,"ADJUSTED",?79,"ALLOTMENT",?91,"TOTAL",?103,"CURRENT",?115,"PROJECTED"
 W !?43,"BASE",?55,"ADJUST",?67,"ANNUAL",?79,"TO",?91,"ISSUES",?103,"FUND",?115,"YEAR END"
 W !,"ACCOUNT",?20,"LOCATION",?43,"BUDGET",?55,"+ OR -",?67,"BUDGET",?79,"DATE",?91,"Y-T-D",?103,"BALANCE",?115,"BALANCE",!!
 S ASUC("LN")=11,ASUF("HDR")=0,ASUF("ACC")=1
 Q
COLNAM ;
 ;;"BASE"
 ;;"ADJS"
 ;;"BUDG"
 ;;"ALOT"
 ;;"TYTD"
 ;;"BAL"
 ;;"PROJ"
 ;;"CMO"
 ;;"YTD"
 ;;"NOR"
TOTNAM ;;
 ;;ACC TOT
 ;;SSA TOT
 ;;AREA TOT