source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCADEL.m@ 1087

Last change on this file since 1087 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1PRCADEL ;SF-ISC/YJK-PRINT DELINQUENT REPORTS ;6/8/93 1:59 PM
2V ;;4.5;Accounts Receivable;;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;THIS PRINTS THE DELINQUENT ACCOUNTS IN A/R FILE
5EN1 ;This prints Delinquent accounts between 31 and 90 days
6 S PRCAFT="31",PRCALAST="90" D DIP Q
7EN2 ;This prints Delinquent accounts between 91 and 180 days
8 S PRCAFT="91",PRCALAST="180" D DIP Q
9EN3 ;This prints Delinquent accounts between 181 and 365 days
10 S PRCAFT="181",PRCALAST="365" D DIP Q
11EN4 ;This prints Delinquent accounts more than 365 days
12 S PRCAFT="366",PRCALAST="",PRCAHDR="OVER 365 DAYS DELINQUENT ACCOUNTS RECEIVABLE" D DIP1 Q
13EN5 ;This prints all Delinquent accounts
14 S PRCAFT="31",PRCALAST="",PRCAHDR="ALL DELINQUENT ACCOUNTS RECEIVABLE" D DIP1 Q
15DIP S PRCAHDR=PRCAFT_" - "_PRCALAST_" DAYS DELINQUENT ACCOUNTS RECEIVABLE"
16DIP1 W !!,"Select a Category range to print.",!
17 S FR="102,?,"_PRCAFT_",",TO="102,?,"_PRCALAST_",",DHD=PRCAHDR
18SET S L=0,DIC="^PRCA(430,",BY="@CURRENT STATUS:STATUS NUMBER,+CATEGORY;S2,DELINQUENT DAYS,BILL NO.",FLDS="[PRCAD DELINQ]" D EN1^DIP
19END K PRCA,PRCAHDR,PRCAFT,PRCALAST,DIC,DHD,BY,FR,TO,L,FLDS Q
20ACT(Y) ;Return date of last activity
21 NEW BN0,X,Z,LST
22 I $G(Y)="" S Y=-1 G ACTQ
23 S BN0=$G(^PRCA(430,Y,0)) I BN0']"" S Y=-1 G ACTQ
24 I "^220^102^110^104^112^107^113^240^230^205^"'[("^"_$P($G(^PRCA(430.3,+$P(BN0,"^",8),0)),"^",3)_"^") S Y=-1 G ACTQ
25 S Z=0 F X=0:0 S X=$O(^PRCA(433,"C",Y,X)) Q:'X I $P($G(^PRCA(433,X,1)),"^",2)'=$O(^PRCA(430.3,"AC",13,0)) S Z=$S(+$P($G(^PRCA(433,X,1)),"^",9):$P(^(1),"^",9),1:+$G(^PRCA(433,X,1)))
26 S LST(9999999-Z)=""
27 S Z=$G(^PRCA(430,Y,6)) F X=3:-1:1 I $P(Z,"^",X) S LST(9999999-$P(Z,"^",X))="" Q
28 S LST(9999999-$P(BN0,U,10))="",LST(9999999-$P(BN0,"^",14))=""
29 S Z=9999999-$O(LST(0)) S:'Z Z=2910101
30 S Y=Z
31ACTQ Q $P(Y,".")
32LAST ;Print last activity
33 NEW DIC,FLDS,FR,TO,L,%DT,END
34 S %DT("A")="Show Outstanding Bills with 'Last Activty' Before: ",%DT="EA" D ^%DT G:Y<0 Q1 S END=X_"^"_Y
35 S X1=DT,X2=Y D ^%DTC I X<180 W *7,!!,"WARNING: You picked a date less than 180 days ago!",!
36 S DHD="Report of AR Last Activity before "_$$SLH^RCFN01($P(END,"^",2)),DIC="^PRCA(430,",FR="?,T-10000",TO="?,"_$P(END,"^"),L=0,(BY,FLDS)="[PRCA LAST ACTIVITY]" D EN1^DIP
37Q1 Q
Note: See TracBrowser for help on using the repository browser.