source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCAEIN.m@ 975

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

initial load of WorldVistAEHR

File size: 4.7 KB
RevLine 
[613]1PRCAEIN ;SF-ISC/YJK-EDIT INCOMPLETE ACCOUNTS RECEIVABLE ;10/17/96 1:07 PM
2V ;;4.5;Accounts Receivable;**57,67,153**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified. ;This edits incomplete accounts receivable. The account is classified
4 ;with category.
5 ;
6 ;===================== EDIT INCOMPLETE AR ===========================
7EDIN ;edit incomplete accounts receivable.
8 K PRCA("CKSITE") D CKSITE G:'$D(PRCA("CKSITE")) END S DIC("S")="S Z0=$S($D(^PRCA(430.3,+$P(^(0),U,8),0)):$P(^(0),U,3),1:0) I Z0=101"
9 D DIC^PRCAUDT G:'$D(PRCABN) END S PRCADIOK=0,PRCA("MESS1")="THE ACCOUNT IS STILL INCOMPLETE",PRCA("MESS2")="*** EDITED AND RELEASED TO ACCOUNTING TECHNICIAN ***"
10 K PRCADINO D EDT I $G(PRCABN),$P(^PRCA(430,PRCABN,0),U,8)=$O(^PRCA(430.3,"AC",102,0)) D PREPAY^RCBEPAYP(PRCABN)
11 D KILLV G EDIN
12EDT D DIE I $D(PRCADINO),($P(^PRCA(430,PRCABN,0),U,2)="")!($P(^(0),U,9)="") S PRCADEL=1 Q
13 ;DIS
14 I $D(PRCADINO) W !!,*7,PRCA("MESS1"),!! Q
15DIP S PRCAT=+$P(^PRCA(430,PRCABN,0),U,2) D:$P(^PRCA(430.2,PRCAT,0),U,3)>0 SEGMT^PRCAEOL S PRCAT=$S($D(^PRCA(430.2,PRCAT,0)):$P(^(0),U,6),1:"") D DISPL,DISPLACC^PRCAFUT S PRCAOK=0 D ASK1 G:$D(PRCA("EXIT")) DIP1
16 I PRCAOK=1 G:'$D(PRCANM) DIP1 S PRCA("STATUS")=$O(^PRCA(430.3,"AC",102,"")),PRCA("SDT")=DT D D UPSEG^PRCAUDT,UPSTATS^PRCAUT2 Q
17 . I $$ACCK^PRCAACC(PRCABN) D ASTAT Q
18 . D EN^PRCAFBD(PRCABN,.ERR)
19 . I +ERR>0 D Q
20 .. W !!,*7,"Error creating FMS Billing Document:",!,?10,$P(ERR,U,2),!,"Bill status remains 'NEW BILL'",!!
21 .. S PRCA("STATUS")=$O(^PRCA(430.3,"AC",104,""))
22 ..Q
23 . S PRCA("STATUS")=$O(^PRCA(430.3,"AC",102,""))
24 . Q
25 D ASK2 I PRCAOK=1 D DIE G DIP
26DIP1 W !!,PRCA("MESS1"),! D KILLV Q ;end of EDIN
27ASTAT ;Set status for accrued bills
28 S PRCA("DEBTOR")=$P(^PRCA(430,PRCABN,0),"^",9) Q:PRCA("DEBTOR")=""
29 S PRCA("STATUS")=$O(^PRCA(430.3,"AC",102,"")),PRCA("MESS2")="** ACCRUED BILL, STATUS IS NOW ACTIVE **" Q
30KILLV L -^PRCA(430,+$G(PRCABN))
31 K PRCADIOK,PRCADEL,DIC,DR,DIE,PRCAT,PRCAGLN,PRCA("CKSITE"),PRCADINO,PRCAOK,PRCA("MESS1"),PRCA("MESS2"),PRCA("EXIT"),PRCABN,PRCAT,PRCANM,PRCADEL,PRCATY,Z1,ZZ,J,D0,D1,PRC Q
32END D KILLV K PRCA Q
33 ;======================= SUBROUTINES ================================
34DIE K PRCAT W ! S DA=PRCABN,DIC="^PRCA(430,",PRCA("LOCK")=0 D LOCKF^PRCAWO1 Q:PRCA("LOCK")=1 S DIE=DIC,DR="[PRCA CAT SET]" D ^DIE K DR,DIE,DA
35 I ($P(^PRCA(430,PRCABN,0),U,2)="")!($D(Y)) W:$P(^(0),U,2)="" !,*7," You should enter a category.",! S PRCADINO="" Q
36 S PRCAT=$P(^PRCA(430.2,+$P(^PRCA(430,PRCABN,0),U,2),0),U,6),PRCAGLN=$P(^(0),U,4) S:$P(^(0),U,7)=24 PRCAT("C")=1
37D1 S DIE="^PRCA(430,",DA=PRCABN,DR="[PRCA SET]" D ^DIE I $D(Y) S PRCA("EXIT")="",PRCADINO="" Q
38 D MTIFY I $D(PRCA("EXIT")) S PRCADIN0="" Q
39 K DR D:'$$ACCK^PRCAACC(PRCABN) CPLK^PRCAFUT(PRCABN) I $D(PRCA("EXIT")) S PRCADINO="" Q
40 D COMMENTS^PRCAUT3 I $D(PRCA("EXIT")) S PRCADINO="" Q
41 I +$P(^PRCA(430,PRCABN,0),U,5)'>0 W !,*7,?3,"The 'Bill Resulting From' input does not exist.",! S PRCADINO="" Q
42 Q
43DISPL ;display the accounts receivable data user has entered.
44 Q:'$D(PRCABN) I '$D(IOF) S IOP="" D ^%ZIS
45 W @IOF S D0=PRCABN K ^UTILITY($J,"W"),DXS D ^PRCATO2,WOBIL^PRCAUDT1 K DXS Q
46ASK2 S %=2 W !!,"DO YOU WANT TO EDIT THE DATA" D YN^DICN I %=0 D M2^PRCAMESG G ASK2
47 Q:%'=1 S PRCAOK=1 Q
48ASK1 S %=2 W !!,"IS THIS DATA CORRECT" D YN^DICN I %<0 S PRCA("EXIT")="" Q
49 I %=0 D M1^PRCAMESG G ASK1
50 Q:%'=1 S PRCAOK=1,DA=PRCABN D SIG^PRCASIG,NOW^%DTC
51 I $D(PRCANM) D ORAMT S PRCANM=$P($G(^VA(200,DUZ,20)),"^",2) D EN^PRCASIG(.PRCANM,DUZ,DA_+$P(^PRCA(430,PRCABN,0),U,3)) S $P(^PRCA(430,PRCABN,9),U,1,3)=+DUZ_U_PRCANM_U_%
52 Q
53CKSITE ;check site parameter and user number.
54 D:'$D(PRCA("SITE")) CKSITE^PRCAUDT
55 I ('$D(PRCA("SITE"))) Q
56 S PRCA("CKSITE")=1 Q
57DELETE ;delete new AR without category and debtor field.
58 S PRCACOMM="USER CANCELED" D DELETE^PRCABIL4 K PRCACOMM
59 W *7,!,"The entry has been deleted!",! Q
60ORAMT ;Update original amount.
61 Q:'$D(^PRCA(430,PRCABN,2)) S PRCAMT=0,PRCAORA=0
62 F Z0=0:0 S PRCAORA=$O(^PRCA(430,PRCABN,2,PRCAORA)) Q:+PRCAORA'>0 S PRCAMT=PRCAMT+$P(^(PRCAORA,0),U,2)
63 S $P(^PRCA(430,PRCABN,0),U,3)=PRCAMT,$P(^PRCA(430,PRCABN,7),U,1)=PRCAMT
64 K Z0,PRCAORA,PRCAMT Q
65RESULT Q:'$D(PRCABN)
66 I $P(^PRCA(430,PRCABN,0),U,5)>0,$D(^PRCA(430.6,+$P(^(0),U,5),0)) W !!,"BILL RESULTING FROM: ",$P(^(0),U,2) Q
67 Q
68MTIFY ;CHECK TO SEE IF ONE FY IS ENTERED PER BILL
69 N DA,DIE,DR,PRCAI,PRCAMT,PRCAMT1
70MTCHK S PRCAMT1=0 F PRCAI=0:0 S PRCAI=$O(^PRCA(430,PRCABN,2,PRCAI)) Q:'PRCAI S PRCAMT=+$P($G(^(PRCAI,0)),"^",8) I PRCAMT S PRCAMT1=PRCAMT1+1
71 I PRCAMT1=1 G MTIFYQ
72 W !!,?3,"** Currently, just one Fiscal Year amount is sent to FMS."
73 W !,?3,"** Please enter just one Fiscal Year for this bill. (",PRCAMT1,") entered",!!
74 S DIE="^PRCA(430,",DA=PRCABN,DR="1",DR(2,430.01)=".01;7" D ^DIE
75 G MTCHK
76MTIFYQ Q
Note: See TracBrowser for help on using the repository browser.