Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RMPRPIXB

RMPRPIXB.m

Go to the documentation of this file.
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