source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/PRCABIL2.m@ 1211

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1PRCABIL2 ;SF-ISC/YJK-ENTER BILL INFO ;5/11/94 9:41 AM
2 ;;4.5;Accounts Receivable;**158**;Mar 20, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4EN8 ;Amend the bill returned from Fiscal.
5 N PRCABILN,PRCAKSTA,RCAMEND
6EN80 D SVC^PRCABIL Q:'$D(PRCAP("S")) S DIC("S")="S Z0=$S($D(^PRCA(430.3,+$P(^(0),U,8),0)):$P(^(0),U,3),1:0) I (Z0=230)!(Z0=220),$D(^PRCA(430,Y,100)),+^(100),+$P(^(100),U,2)="_PRCAP("S")
7 D BILLN^PRCAUTL G Q:'$D(PRCABN) S PRCABILN=PRCABN,PRCAKSTA=PRCA("STATUS")
8 I $P(^PRCA(430.3,+PRCAKSTA,0),U,3)=230 S RCAMEND=""
9 D EN^PRCABIL1
10 S PRCABN=PRCABILN K PRCABILN D:",220,230,"[(","_$P(^PRCA(430.3,+PRCAKSTA,0),U,3)_",") EN81 K PRCAKSTA
11 G EN80
12EN81 W !!,"Now amending bill...",!
13 S PRCA("STATUS")=$O(^PRCA(430.3,"AC",205,0))
14 S DIE="^PRCA(430,",DA=PRCABN,DR="33//^S X=DT;35;37;8////"_PRCA("STATUS")_";95////"_+PRCAKSTA D ^DIE K DIE,DR
15 S $P(^PRCA(430,PRCABN,3),U,4)=DUZ Q
16EN ;ENTER NEW BILL IN FILE 430
17 K PRCAP,PRCABN,DA,DIC,DLAYGO Q:'$D(PRCA("SITE"))!('$D(DUZ)) D SVC Q:'$D(PRCAP("S"))
18ENPO ;S DIC="^PRCA(430.4,",DIC(0)="QEMZ",DIC("S")="I +$P(^(0),U,1)=PRCA(""SITE""),+$P(^(0),U,5)=PRCAP(""S"")"
19 R !!,"BILL NO. : ",X:DTIME Q:('$T)!(X="") I X["^" S X="" Q
20 I "Nn"[$E(X) D I $P(X,"^")=-1 W *7,!!,$P(X,"^",2),! G ENPO
21 . S X=$$BNUM^RCMSNUM
22 . I $P(X,"^")'=-1 S X=$P(X,"-",2)
23 I (X'?1U1N5UN) W *7,!!,"Please enter 7 character bill number.",!,"It must be in the following format: K400001, K481234 or '(N)ew' to get",!,"the next available number. (Enter ""^"" to exit)",! G ENPO
24 I ($D(^PRCA(430,"D",X)))!($D(^PRCA(430,"B",PRCA("SITE")_"-"_X))) W *7,!!,"SORRY ! THIS NUMBER HAS BEEN ALREADY ASSIGNED TO A BILL. USE EDIT OPTION",! G ENPO
25 ;W !!,"ENTER YOUR BILL COMMON NUMBERING SERIES: " R X:DTIME G:X=""!(X=U) ENPOQ I $E(X,1)="?"!($L(X)'<4) S D="C" D IX^DIC G ENPO
26EN2 ;I $L(X)<4 S D="C" D IX^DIC G ENPO:Y<0,NUM
27 S X=PRCA("SITE")_"-"_X,DIC(0)="L"
28ENPO1 K DIC("S") S PRCAP("NEW")="",DIC="^PRCA(430,",DIC("DR")="97////^S X=DUZ;101////^S X="_PRCAP("S"),DLAYGO=430 D ^DIC
29 G ENPO:Y<0,W3:'+$P(Y,U,3)
30 S (DA,PRCABN)=+Y,$P(^PRCA(430,DA,100),U,2)=PRCAP("S")
31 W " ... Bill Number '",$P(^PRCA(430,PRCABN,0),"^"),"' assigned"
32 G ENPOQ
33NUM ;L +^PRCA(430.4,+Y,0):1 G:'$T W1 S X=$P(Y,U,2),Z=$S(+$P(Y(0),U,4)<$P(Y(0),U,2):+$P(Y(0),U,2),1:+$P(Y(0),U,4)),L=$L(X)#2-3
34Z ;G:Z>$P(Y(0),U,3) W2 S Z="000"_Z,Z=$E(Z,$L(Z)+L,$L(Z)),X=X_Z I $D(^PRCA(430,"B",X)) S Z=Z+1,X=$P(Y,U,2) G Z
35 ;W !?3,"Are you adding '",X,"' as a new Bill number ",*7 S %=0 D YN^DICN I %'=1 L -^PRCA(430.4,+$G(Y),0) G ENPO
36 ;S $P(^PRCA(430.4,+Y,0),U,4)=Z,DIC(0)="L" L -^PRCA(430.4,+Y,0) G ENPO1
37W1 ;L -^PRCA(430.4,+Y,0) W !?3,"Bill Number series is being edited by another user, try later",*7 G ENPO
38W2 ;L -^PRCA(430.4,+Y,0) W !?3,"UPPER BOUND NOT DEFINED FOR BILL NUMBER SERIES ",$P(Y,U,2),*7 G ENPO
39W3 W " Bill Number already exists, please try again ",*7 G ENPO
40SVC K PRCAP("S") I $D(^VA(200,DUZ,5)),$D(^DIC(49,+^(5),0)) S PRCAP("S")=+^VA(200,DUZ,5) Q
41 W !,"You must have a SERVICE/SECTION assigned to you in the NEW PERSON file.",!?3,"See your Site Manager."
42ENPOQ K DIC,DLAYGO,%DT,L,PRCAP,Z Q
43Q K %,A,B,C,D0,DA,DIC,DIE,DIK,DR,I,PRCA,PRCABC,PRCABN,PRCABT,PRCADFM,PRCAI,PRCAMT,PRCANM,PRCAMT1,PRCAMT2,PRCAQ,PRCAP,PRCAT,PRCATY,PRCAX,X,Y,Z0,ZRTN,ZTSK Q
Note: See TracBrowser for help on using the repository browser.