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