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

BARPRF3A.m

Go to the documentation of this file.
BARPRF3A ; IHS/SD/LSL - REFUND COMMAND PROCESSING CONTINUED ; 05/07/2008
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**4**;OCT 26, 2005
 ;
 ;** A/R posting program
 ;   continuation of command processing
 ;
 Q
 ; *********************************************************************
 ;
SETTMP(BARTYP,BARAMT,BARLIN,BARCAT,BARATYP) ;EP;BAR*1.8*4 DD 4.1.7.2
 ;HEAVILY MODIFIED SEE SETTMP0 BELOW FOR ORIGNIAL
 K BARFLG("BARWARN")
 S BARSTOP=0
 S BARDA=$O(^BARTMP($J,"B",BARLIN,""))
 S BARBBAL=$P(^BARTMP($J,BARDA,BARLIN),U,5)
 I BARCAT'=21&(BARCAT'=22) D        ;DON'T CHECK BALANCE FOR PENDING/GEN INFO
 .D CKNEG^BARPST4(BARBBAL,0,BARAMT)
 Q:BARSTOP
 I BARTYP="R" D  Q:BARSTOP          ;ADD REFUND TO ADJ FIELD, NOT PAYMENT
 .S $P(^BARTMP($J,BARDA,BARLIN),U,7)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,7)+BARAMT
 .S BARREF=BARREF+BARAMT
 .S BARADJ=BARADJ+BARAMT
 I BARTYP="A" D
 .S $P(^BARTMP($J,BARDA,BARLIN),U,7)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,7)+BARAMT
 .S BARADJ=BARADJ+BARAMT
 I BARCAT'=21&(BARCAT'=22) D
 .S $P(^BARTMP($J,BARDA,BARLIN),U,5)=$P(^BARTMP($J,BARDA,BARLIN),U,5)-BARAMT
 S BARJ=$O(BARTR(BARLIN,""),-1)
 S BARJ=BARJ+1
 S BARTR(BARLIN,BARJ)=BARTYP_U_BARAMT_U_BARCAT_U_$G(BARATYP)
 Q
 ; *********************************************************************
SETTMP0(BARTYP,BARAMT,BARLIN,BARCAT,BARATYP) ;EP;ORIGINAL CODE ;BAR*1.8*4 DD 4.1.7.2
 K BARFLG("BARWARN")
 S BARSTOP=0
 S BARDA=$O(^BARTMP($J,"B",BARLIN,""))
 I BARTYP="R" D  Q:BARSTOP
 .S $P(^BARTMP($J,BARDA,BARLIN),U,6)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,6)+BARAMT
 .S BARREF=BARREF+BARAMT
 I BARTYP="A" D
 .S $P(^BARTMP($J,BARDA,BARLIN),U,7)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,7)+BARAMT
 .S BARADJ=BARADJ+BARAMT
 S $P(^BARTMP($J,BARDA,BARLIN),U,5)=$P(^BARTMP($J,BARDA,BARLIN),U,5)-BARAMT
 S BARJ=$O(BARTR(BARLIN,""),-1)
 S BARJ=BARJ+1
 S BARTR(BARLIN,BARJ)=BARTYP_U_BARAMT_U_BARCAT_U_$G(BARATYP)
 Q
 ;
 ;
HELP ;
 W $$EN^BARVDF("IOF"),!!
 W "Select one of the following: ",!
 W !?5,"P - Post transactions to A/R."
 W !?5,"M - More transaction processing."
 W !?5,"C - Cancel all transactions and start over."
 W !!,"This is a required response - Please select one to proceed!"
 D EOP^BARUTL(1)
 D HIT1^BARPST2(BARPASS),EOP^BARUTL(2)
 Q
 ; *********************************************************************
 ;
WARN(BARLVL)       ;
 W *7,!,"Warning - Posted amount exceeds the "_$S(BARLVL=1:"batch",BARLVL=2:"item",1:"location")_" balance."
 S BARSTOP=1
 D EOP^BARUTL(1)
 Q
SURE ;
 S BARSTOP=0
 K DIR
 S DIR(0)="Y"
 S DIR("A")="ARE YOU SURE"
 S DIR("B")="NO"
 D ^DIR
 K DIR
 I Y'=1 S BARSTOP=1
 Q
SETTMP1(BARTYP,BARAMT,BARLIN,BARCAT,BARATYP) ;EP
 K BARFLG("BARWARN")
 S BARSTOP=0
 S BARDA=$O(^BARTMP($J,"B",BARLIN,""))
 I BARTYP="R" D  Q:BARSTOP
 .S $P(^BARTMP($J,BARDA,BARLIN),U,6)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,6)+BARAMT
 .S BARREF=BARREF+BARAMT
 I BARTYP="A" D
 .S $P(^BARTMP($J,BARDA,BARLIN),U,7)=$P($G(^BARTMP($J,BARDA,BARLIN)),U,7)+BARAMT
 .S BARADJ=BARADJ+BARAMT
 S $P(^BARTMP($J,BARDA,BARLIN),U,5)=$P(^BARTMP($J,BARDA,BARLIN),U,5)-BARAMT
 S BARJ=$O(BARTR(BARLIN,""),-1)
 S BARJ=BARJ+1
 S BARTR(BARLIN,BARJ)=BARTYP_U_BARAMT_U_BARCAT_U_$G(BARATYP)
 Q