AFSLVNV ; GENERATED FROM 'AFSL.VNDLST' PRINT TEMPLATE (#1076) ; 09/29/09 ; (FILE 9999999.11, MARGIN=80)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
I $D(DXS)<9 M DXS=^DIPT(1076,"DXS")
S I(0)="^AUTTVNDR(",J(0)=9999999.11
S X=$G(^AUTTVNDR(D0,0)) D N:$X>0 Q:'DN W ?0,$E($P(X,U,1),1,30)
S X=$G(^AUTTVNDR(D0,11)) D N:$X>31 Q:'DN W ?31,$E($P(X,U,1),1,10)
W ?0,$E($P(X,U,2),1,30)
D N:$X>46 Q:'DN W ?46 S DIP(1)=$S($D(^AUTTVNDR(D0,0)):^(0),1:"") S X=$P(DIP(1),U,5) S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K DIP K:DN Y W X
S X=$G(^AUTTVNDR(D0,11)) W ?57 S Y=$P(X,U,7) W:Y]"" $J(Y,13,2)
S X=$G(^AUTTVNDR(D0,13)) D N:$X>0 Q:'DN W ?0,$E($P(X,U,5),1,20)
D N:$X>0 Q:'DN W ?0,$E($P(X,U,1),1,30)
D N:$X>0 Q:'DN W ?0,$E($P(X,U,2),1,20)
W ", "
S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^DIC(5,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
W " "
W ?0,$E($P(X,U,4),1,10)
D N:$X>34 Q:'DN W ?34 W "YTD PAID:"
S X=$G(^AUTTVNDR(D0,11)) D N:$X>44 Q:'DN W ?44 S Y=$P(X,U,7) W:Y]"" $J(Y,13,2)
D N:$X>56 Q:'DN W ?56 W "1099 PRINTED:"
D N:$X>71 Q:'DN W ?71 S Y=$P(X,U,6) W:Y]"" $S($D(DXS(1,Y)):DXS(1,Y),1:Y)
D N:$X>0 Q:'DN W ?0 W "CONTRACT#"
S I(1)="""CN""",J(1)=9999999.1112 F D1=0:0 Q:$O(^AUTTVNDR(D0,"CN",D1))'>0 X:$D(DSC(9999999.1112)) DSC(9999999.1112) S D1=$O(^(D1)) Q:D1'>0 D:$X>11 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^AUTTVNDR(D0,"CN",D1,0)) D N:$X>11 Q:'DN W ?11,$E($P(X,U,1),1,18)
W ?31 S DIP(1)=$S($D(^AUTTVNDR(D0,"CN",D1,0)):^(0),1:"") S X=$P(DIP(1),U,2) S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K DIP K:DN Y W X
W "-"
S DIP(1)=$S($D(^AUTTVNDR(D0,"CN",D1,0)):^(0),1:"") S X=$P(DIP(1),U,3) S:X X=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3) K DIP K:DN Y W X
S X=$G(^AUTTVNDR(D0,"CN",D1,0)) D N:$X>54 Q:'DN W ?54 S Y=$P(X,U,4) W:Y]"" $J(Y,14,2)
Q
A1R ;
D N:$X>0 Q:'DN W ?0 W "- - - - - - - - - - - - - - - - - - - - "
D N:$X>40 Q:'DN W ?40 W "- - - - - - - - - - - - - - - - - - - - "
K Y
Q
HEAD ;
W !,?31,"EIN# &",?46,"DATE"
W !,?0,"NAME",?31,"SFX.",?46,"INACTIVE",?62,"YTD PAID"
W !,?0,"MAILING"
W !,?0,"ADDRESS-ATTENTION"
W !,?0,"MAILING ADDRESS-STREET"
W !,?0,"MAILING ADDRESS-CITY",?49,"YTD PAID"
W !,?71,"1099"
W !,?71,"(Y/N)"
W !,?59,"AMOUNT OF"
W !,?11,"CONTRACT NUMBER",?31,"BEG.DATE",?60,"CONTRACT"
W !,"--------------------------------------------------------------------------------",!!
AFSLVNV ; GENERATED FROM 'AFSL.VNDLST' PRINT TEMPLATE (#1076) ; 09/29/09 ; (FILE 9999999.11, MARGIN=80)
+1 GOTO BEGIN
N WRITE !
T IF $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
IF '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
IF Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
IF Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 IF '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 IF $DATA(DXS)<9
MERGE DXS=^DIPT(1076,"DXS")
+3 SET I(0)="^AUTTVNDR("
SET J(0)=9999999.11
+4 SET X=$GET(^AUTTVNDR(D0,0))
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0,$EXTRACT($PIECE(X,U,1),1,30)
+5 SET X=$GET(^AUTTVNDR(D0,11))
IF $X>31
DO N
IF 'DN
QUIT
WRITE ?31,$EXTRACT($PIECE(X,U,1),1,10)
+6 WRITE ?0,$EXTRACT($PIECE(X,U,2),1,30)
+7 IF $X>46
DO N
IF 'DN
QUIT
WRITE ?46
SET DIP(1)=$SELECT($DATA(^AUTTVNDR(D0,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,5)
IF X
SET X=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
KILL DIP
IF DN
KILL Y
WRITE X
+8 SET X=$GET(^AUTTVNDR(D0,11))
WRITE ?57
SET Y=$PIECE(X,U,7)
IF Y]""
WRITE $JUSTIFY(Y,13,2)
+9 SET X=$GET(^AUTTVNDR(D0,13))
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0,$EXTRACT($PIECE(X,U,5),1,20)
+10 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0,$EXTRACT($PIECE(X,U,1),1,30)
+11 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0,$EXTRACT($PIECE(X,U,2),1,20)
+12 WRITE ", "
+13 SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^DIC(5,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+14 WRITE " "
+15 WRITE ?0,$EXTRACT($PIECE(X,U,4),1,10)
+16 IF $X>34
DO N
IF 'DN
QUIT
WRITE ?34
WRITE "YTD PAID:"
+17 SET X=$GET(^AUTTVNDR(D0,11))
IF $X>44
DO N
IF 'DN
QUIT
WRITE ?44
SET Y=$PIECE(X,U,7)
IF Y]""
WRITE $JUSTIFY(Y,13,2)
+18 IF $X>56
DO N
IF 'DN
QUIT
WRITE ?56
WRITE "1099 PRINTED:"
+19 IF $X>71
DO N
IF 'DN
QUIT
WRITE ?71
SET Y=$PIECE(X,U,6)
IF Y]""
WRITE $SELECT($DATA(DXS(1,Y)):DXS(1,Y),1:Y)
+20 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "CONTRACT#"
+21 SET I(1)="""CN"""
SET J(1)=9999999.1112
FOR D1=0:0
IF $ORDER(^AUTTVNDR(D0,"CN",D1))'>0
QUIT
IF $DATA(DSC(9999999.1112))
XECUTE DSC(9999999.1112)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>11
DO T
IF 'DN
QUIT
DO A1
+22 GOTO A1R
A1 ;
+1 SET X=$GET(^AUTTVNDR(D0,"CN",D1,0))
IF $X>11
DO N
IF 'DN
QUIT
WRITE ?11,$EXTRACT($PIECE(X,U,1),1,18)
+2 WRITE ?31
SET DIP(1)=$SELECT($DATA(^AUTTVNDR(D0,"CN",D1,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,2)
IF X
SET X=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
KILL DIP
IF DN
KILL Y
WRITE X
+3 WRITE "-"
+4 SET DIP(1)=$SELECT($DATA(^AUTTVNDR(D0,"CN",D1,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,3)
IF X
SET X=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3)
KILL DIP
IF DN
KILL Y
WRITE X
+5 SET X=$GET(^AUTTVNDR(D0,"CN",D1,0))
IF $X>54
DO N
IF 'DN
QUIT
WRITE ?54
SET Y=$PIECE(X,U,4)
IF Y]""
WRITE $JUSTIFY(Y,14,2)
+6 QUIT
A1R ;
+1 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "- - - - - - - - - - - - - - - - - - - - "
+2 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "- - - - - - - - - - - - - - - - - - - - "
+3 KILL Y
+4 QUIT
HEAD ;
+1 WRITE !,?31,"EIN# &",?46,"DATE"
+2 WRITE !,?0,"NAME",?31,"SFX.",?46,"INACTIVE",?62,"YTD PAID"
+3 WRITE !,?0,"MAILING"
+4 WRITE !,?0,"ADDRESS-ATTENTION"
+5 WRITE !,?0,"MAILING ADDRESS-STREET"
+6 WRITE !,?0,"MAILING ADDRESS-CITY",?49,"YTD PAID"
+7 WRITE !,?71,"1099"
+8 WRITE !,?71,"(Y/N)"
+9 WRITE !,?59,"AMOUNT OF"
+10 WRITE !,?11,"CONTRACT NUMBER",?31,"BEG.DATE",?60,"CONTRACT"
+11 WRITE !,"--------------------------------------------------------------------------------",!!