1 | RCFMOBR2 ;WASH-ISC@ALTOONA,PA/RWT-BILL RECONCILIATIONS LIST ;12/9/96 2:05 PM
|
---|
2 | V ;;4.5;Accounts Receivable;**53,73,107**;Mar 20, 1995
|
---|
3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | ; OBR Data Structure used by this routine
|
---|
6 | ; ^TMP("OBR",$J,SITE,"NOT IN AR")=NextRec^TotalItems^TotalFMSAmt
|
---|
7 | ; ^TMP("OBR",$J,SITE,"NOT IN FMS")=NextRec^TotalItems^TotalARAmt
|
---|
8 | ; ^TMP("OBR",$J,SITE,"DISCREPANCY")=NextRec^TotalItems^TotalFMSAmt^TotalARAmt
|
---|
9 | ; ^TMP("OBR",$J,"BN",BILLNUMBER)=[423.6 rec] <-- x-ref of FMS Bills
|
---|
10 | ; ^TMP("OBR",$J,"REPORT","1")="LINE 1"
|
---|
11 | ; ^TMP("OBR",$J","REPORT,"2")="LINE 2"
|
---|
12 | ;
|
---|
13 | ; Descriptions of modules:
|
---|
14 | ; BUILDRPT - Prepares report in global ^TMP("OBR",$J,"REPORT")
|
---|
15 | ;
|
---|
16 | BUILDRPT(PARENT) N Y,SN,N,ARTOTAL,FMSTOTAL,DIFF,N1,N2,N3,TB,MULTSN,DATE,TMP
|
---|
17 | S N=1,SN=$O(^TMP("OBR",$J,0)),MULTSN=$O(^TMP("OBR",$J,SN))'=0
|
---|
18 | ;
|
---|
19 | D NOW^%DTC,YX^%DTC S DATE=$P(Y,"@")
|
---|
20 | S ^TMP("OBR",$J,"REPORT",N)="Date of Report: "_DATE,N=N+1
|
---|
21 | S ^TMP("OBR",$J,"REPORT",N)="NOTE: This report compares your current A/R records with data received from",N=N+1
|
---|
22 | S ^TMP("OBR",$J,"REPORT",N)=" FMS on the last day of the previous accounting period.",N=N+1
|
---|
23 | D BLANKLN(1)
|
---|
24 | ;
|
---|
25 | I '+$G(SN) S ^TMP("OBR",$J,"REPORT",N)="FMS and AR are in balance." Q
|
---|
26 | S SN="" F S SN=$O(^TMP("OBR",$J,SN)) Q:+SN=0 D
|
---|
27 | .I MULTSN D
|
---|
28 | ..S ^TMP("OBR",$J,"REPORT",N)=$P(^DIC(4,$P(^RC(342,1,0),U),0),U)
|
---|
29 | ..S N=N+1
|
---|
30 | .;
|
---|
31 | .; - FMS Bills not in AR
|
---|
32 | .D BLANKLN(1)
|
---|
33 | .S TB="",$P(TB," ",21)=""
|
---|
34 | .S ^TMP("OBR",$J,"REPORT",N)=" FMS BILLS NOT IN AR",N=N+1
|
---|
35 | .S ^TMP("OBR",$J,"REPORT",N)=TB_" AMOUNT",N=N+1
|
---|
36 | .I '$D(^TMP("OBR",$J,SN,"NOT IN AR")) S N1="1^0^0"
|
---|
37 | .I $D(^TMP("OBR",$J,SN,"NOT IN AR")) D
|
---|
38 | ..S N1=^TMP("OBR",$J,SN,"NOT IN AR")
|
---|
39 | ..F I=1:1:$P(N1,U,2) D
|
---|
40 | ...S ^TMP("OBR",$J,"REPORT",N)=^TMP("OBR",$J,SN,"NOT IN AR",I)
|
---|
41 | ...S N=N+1
|
---|
42 | .D BLANKLN(1)
|
---|
43 | .; - Summarize FMS Bills not in AR
|
---|
44 | .S TMP=$P(N1,U,2)_$S($P(N1,U,2)=1:" Bill",1:" Bills")
|
---|
45 | .S TB="",$P(TB," ",15-$L(TMP))=""
|
---|
46 | .S ^TMP("OBR",$J,"REPORT",N)=" "_TMP_TB_$J($P(N1,U,3),10,2),N=N+1
|
---|
47 | .;
|
---|
48 | .; - AR Bills not in FMS
|
---|
49 | .D BLANKLN(2)
|
---|
50 | .S TB="",$P(TB," ",46)=""
|
---|
51 | .S ^TMP("OBR",$J,"REPORT",N)=" AR BILLS NOT IN FMS",N=N+1
|
---|
52 | .S ^TMP("OBR",$J,"REPORT",N)=TB_" AMOUNT",N=N+1
|
---|
53 | .I '$D(^TMP("OBR",$J,SN,"NOT IN FMS")) S N2="1^0^0"
|
---|
54 | .I $D(^TMP("OBR",$J,SN,"NOT IN FMS")) D
|
---|
55 | ..S N2=^TMP("OBR",$J,SN,"NOT IN FMS")
|
---|
56 | ..F I=1:1:$P(N2,U,2) D
|
---|
57 | ...S ^TMP("OBR",$J,"REPORT",N)=^TMP("OBR",$J,SN,"NOT IN FMS",I)
|
---|
58 | ...S N=N+1
|
---|
59 | .D BLANKLN(1)
|
---|
60 | .; - Summarize Bills not if FMS
|
---|
61 | .S TMP=$P(N2,U,2)_$S($P(N2,U,2)=1:" Bill",1:" Bills")
|
---|
62 | .S TB="",$P(TB," ",40-$L(TMP))=""
|
---|
63 | .S ^TMP("OBR",$J,"REPORT",N)=" "_TMP_TB_$J($P(N2,U,3),10,2),N=N+1
|
---|
64 | .;
|
---|
65 | .; - Discrepancies
|
---|
66 | .D BLANKLN(2)
|
---|
67 | .S ^TMP("OBR",$J,"REPORT",N)=" DISCREPANCIES",N=N+1
|
---|
68 | .S TB="",$P(TB," ",44)=""
|
---|
69 | .S ^TMP("OBR",$J,"REPORT",N)=TB_"FMS AMOUNT AR AMOUNT DIFFERENCE",N=N+1
|
---|
70 | .I '$D(^TMP("OBR",$J,SN,"DISCREPANCY")) S N3="1^0^0^0"
|
---|
71 | .I $D(^TMP("OBR",$J,SN,"DISCREPANCY")) D
|
---|
72 | ..S N3=^TMP("OBR",$J,SN,"DISCREPANCY")
|
---|
73 | ..F I=1:1:$P(N3,U,2) D
|
---|
74 | ...S ^TMP("OBR",$J,"REPORT",N)=^TMP("OBR",$J,SN,"DISCREPANCY",I)
|
---|
75 | ...S N=N+1
|
---|
76 | ..D BLANKLN(1)
|
---|
77 | .; - Summarize Discrepancy Totals
|
---|
78 | .S DIFF=$P(N3,U,4)-$P(N3,U,3)
|
---|
79 | .S TMP=$P(N3,U,2)_$S($P(N3,U,2)=1:" Bill",1:" Bills")
|
---|
80 | .S TB="",$P(TB," ",40-$L(TMP))=""
|
---|
81 | .S ^TMP("OBR",$J,"REPORT",N)=" "_TMP_TB_$J($P(N3,U,3),10,2)_" "_$J($P(N3,U,4),10,2)_" "_$J($S(DIFF>0:"+",1:"")_$J(DIFF,0,2),12),N=N+1
|
---|
82 | .D BLANKLN(2)
|
---|
83 | .;
|
---|
84 | .; - Summary of Totals
|
---|
85 | .S ARTOTAL=$P(N2,U,3)+$P(N3,U,4)
|
---|
86 | .S FMSTOTAL=$P(N1,U,3)+$P(N3,U,3)
|
---|
87 | .S DIFF=ARTOTAL-FMSTOTAL
|
---|
88 | .S ^TMP("OBR",$J,"REPORT",N)="Total FMS Amount : $"_$J(FMSTOTAL,10,2),N=N+1
|
---|
89 | .S ^TMP("OBR",$J,"REPORT",N)="Total AR Amount : $"_$J(ARTOTAL,10,2),N=N+1
|
---|
90 | .S ^TMP("OBR",$J,"REPORT",N)="Total Discrepancy : "_"$"_$J(DIFF,10,2),N=N+1
|
---|
91 | .I +$O(^TMP("OBR",$J,SN))'=0 D BLANKLN(3)
|
---|
92 | .D ^RCFMOBR3
|
---|
93 | Q
|
---|
94 | BLANKLN(LINES) ;
|
---|
95 | N I
|
---|
96 | F I=1:1:LINES S ^TMP("OBR",$J,"REPORT",N)="",N=N+1
|
---|
97 | Q
|
---|