RMPRPIXB ;HINCIO/ODJ - SUB TRANSACTION FILE 661.69 APIs ;3/8/01
;;3.0;PROSTHETICS;**61**;Feb 09, 1996
Q
;
; CRE - Create a stock reconciliation gain/loss record (661.69)
CRE(RMPR6) ;
N RMPRERR,RMPRFDA,RMPRFME,RMPRIEN,X,Y,DA
S RMPRERR=0
S RMPRFDA(661.69,"+1,",.01)=RMPR6("TRANS IEN")
S RMPRFDA(661.69,"+1,",2)=RMPR6("GAIN/LOSS")
S RMPRFDA(661.69,"+1,",3)=RMPR6("GAIN/LOSS VALUE")
D UPDATE^DIE("","RMPRFDA","RMPRIEN","RMPRFME")
I $D(RMPRFME) S RMPRERR=99 G CREX
CREX Q RMPRERR
;
; UPD - Update a stock reconciliation gain/loss record
UPD(RMPR69) ;
N RMPRERR,RMPRFDA,RMPRIEN,RMPRFME,X,Y,DA
S RMPRERR=0
S RMPRIEN=$O(^RMPR(661.69,"B",RMPR69("TRANS IEN"),""))
S RMPRIEN=RMPRIEN_","
S:$D(RMPR69("GAIN/LOSS")) RMPRFDA(661.69,RMPRIEN,2)=RMPR69("GAIN/LOSS")
S:$D(RMPR69("GAIN/LOSS VALUE")) RMPRFDA(661.69,RMPRIEN,3)=RMPR69("GAIN/LOSS VALUE")
D:$D(RMPRFDA) FILE^DIE("","RMPRFDA","RMPRFME")
I $D(RMPRFME) S RMPRERR=3
UPDX Q RMPRERR
;
; GET - Get a stock reconciliation gain/loss record
GET(RMPR6) ;
N RMPRERR,RMPRFME,RMPROUP,RMPRIEN,X,Y,DA
S RMPRERR=0
I $G(RMPR6("TRANS IEN"))="" S RMPRERR=1 G GETX
S RMPRIEN=$O(^RMPR(661.69,"B",RMPR6("TRANS IEN"),""))
I RMPRIEN="" S RMPRERR=1 G GETX
S RMPR6("IEN")=RMPRIEN
S RMPRIEN=RMPRIEN_","
D GETS^DIQ(661.69,RMPRIEN,"*","","RMPROUP","RMPRFME")
I $D(RMPRFME) S RMPRERR=1 G GETX
S RMPR6("GAIN/LOSS")=RMPROUP(661.69,RMPRIEN,2)
S RMPR6("GAIN/LOSS VALUE")=RMPROUP(661.69,RMPRIEN,3)
GETX Q RMPRERR
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRMPRPIXB 1495 printed Dec 13, 2024@02:36:40 Page 2
RMPRPIXB ;HINCIO/ODJ - SUB TRANSACTION FILE 661.69 APIs ;3/8/01
+1 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
+2 QUIT
+3 ;
+4 ; CRE - Create a stock reconciliation gain/loss record (661.69)
CRE(RMPR6) ;
+1 NEW RMPRERR,RMPRFDA,RMPRFME,RMPRIEN,X,Y,DA
+2 SET RMPRERR=0
+3 SET RMPRFDA(661.69,"+1,",.01)=RMPR6("TRANS IEN")
+4 SET RMPRFDA(661.69,"+1,",2)=RMPR6("GAIN/LOSS")
+5 SET RMPRFDA(661.69,"+1,",3)=RMPR6("GAIN/LOSS VALUE")
+6 DO UPDATE^DIE("","RMPRFDA","RMPRIEN","RMPRFME")
+7 IF $DATA(RMPRFME)
SET RMPRERR=99
GOTO CREX
CREX QUIT RMPRERR
+1 ;
+2 ; UPD - Update a stock reconciliation gain/loss record
UPD(RMPR69) ;
+1 NEW RMPRERR,RMPRFDA,RMPRIEN,RMPRFME,X,Y,DA
+2 SET RMPRERR=0
+3 SET RMPRIEN=$ORDER(^RMPR(661.69,"B",RMPR69("TRANS IEN"),""))
+4 SET RMPRIEN=RMPRIEN_","
+5 if $DATA(RMPR69("GAIN/LOSS"))
SET RMPRFDA(661.69,RMPRIEN,2)=RMPR69("GAIN/LOSS")
+6 if $DATA(RMPR69("GAIN/LOSS VALUE"))
SET RMPRFDA(661.69,RMPRIEN,3)=RMPR69("GAIN/LOSS VALUE")
+7 if $DATA(RMPRFDA)
DO FILE^DIE("","RMPRFDA","RMPRFME")
+8 IF $DATA(RMPRFME)
SET RMPRERR=3
UPDX QUIT RMPRERR
+1 ;
+2 ; GET - Get a stock reconciliation gain/loss record
GET(RMPR6) ;
+1 NEW RMPRERR,RMPRFME,RMPROUP,RMPRIEN,X,Y,DA
+2 SET RMPRERR=0
+3 IF $GET(RMPR6("TRANS IEN"))=""
SET RMPRERR=1
GOTO GETX
+4 SET RMPRIEN=$ORDER(^RMPR(661.69,"B",RMPR6("TRANS IEN"),""))
+5 IF RMPRIEN=""
SET RMPRERR=1
GOTO GETX
+6 SET RMPR6("IEN")=RMPRIEN
+7 SET RMPRIEN=RMPRIEN_","
+8 DO GETS^DIQ(661.69,RMPRIEN,"*","","RMPROUP","RMPRFME")
+9 IF $DATA(RMPRFME)
SET RMPRERR=1
GOTO GETX
+10 SET RMPR6("GAIN/LOSS")=RMPROUP(661.69,RMPRIEN,2)
+11 SET RMPR6("GAIN/LOSS VALUE")=RMPROUP(661.69,RMPRIEN,3)
GETX QUIT RMPRERR