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

ACRFIV4.m

Go to the documentation of this file.
ACRFIV4 ;IHS/OIRM/DSD/THL,AEF - ARMS TO 1166 PAYMENT INTERFACE;  [ 07/21/2005  2:43 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**2,16,17**;JUL 31, 2001
 ;;
 ;UTILITY TO EDIT PAYMENT DATA AFTER INVOICE AUDIT COMPLETED
 ; ENTERED FROM THE TOP BY: ACRFRR11, ACRFPAY1
 ;
EN ;
 ;S ACRVDA=$S('$G(ACRDOCDA):$G(ACRVDA),$P($G(^ACRDOC(ACRDOCDA,5)),U,5):$P(^(5),U,5),1:$P(^ACRDOC(ACRDOCDA,"PO"),U,5))  ;ACR*2.1*16.06 IM15505
 N ACRDOC5,ACRDOCPO                              ;ACR*2.1*16.06 IM15505
 S ACRDOCDA=$G(ACRDOCDA)                         ;ACR*2.1*16.06 IM15505
 S ACRDOC5=$P($G(^ACRDOC(+ACRDOCDA,5)),U,5)      ;ACR*2.1*16.06 IM15505
 S ACRDOCPO=$P($G(^ACRDOC(+ACRDOCDA,"PO")),U,5)  ;ACR*2.1*16.06 IM15505
 S ACRVDA=$S('$G(ACRDOCDA):$G(ACRVDA),ACRDOC5]"":ACRDOC5,1:ACRDOCPO)  ;ACR*2.1*16.06 IM15505
 I 'ACRVDA D  Q
 .W !!,"No VENDOR has been selected for this order."
 .D PAUSE^ACRFWARN
 D PAYDATE^ACRFIV41
 Q:$D(ACROUT)!($G(ACRPEN)="")
 S ACRBTYP="V"
 D SCHT          ;Commented out in ;ACR*2.1*16.06 IM15505; restored in ACR*2.1*17.07 IM17139
 ;D SCHT(.ACRACHX,.ACRACH,ACRBTYP,ACRVDA,.ACRDUZ,.ACRQUIT)  ;Added in ACR*2.1*16.06 IM15505; Commented out in ACR*2.1*17.07 IM17139
 Q:$D(ACROUT)!($G(ACRPEN)="")
 S ACRBTYP="V"
 Q:$D(ACROUT)
 D WHICH
 Q:$D(ACROUT)
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 D VERIFY:$G(ACRDOCDA)&'$D(ACRQUIT)&'$D(ACROUT)
EXIT K ACRPEN,ACRDATE,ACRIVDAT,ACRRRDAT,ACRPAY,ACRDATE,ACRTYPE,ACRDT
 Q
EN1 K ACRIV
 S ACRIV=""
 W @IOF
 W !?10,"Payment Processing"
 S DIR(0)="SO^1:Reset Payment Date;2:Edit Discounts/Penalties;3:Review Payment Summary;4:Change Vendor Remit to Address"
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 I +Y=1 D PAYDATE^ACRFIV41 K ACRQUIT Q
 I +Y=2 D WHICH K ACRQUIT Q
 I +Y=3 D ^ACRFIV41 K ACRQUIT Q
 I +Y=4 D VENDOR^ACRFRR K ACRQUIT
 Q
DISCOUNT ;EP;DISCOUNT TERMS
 ;ALL DISCOUNT SUBROUTINES MOVED TO NEW ACRFIV42  ACR*2.1*16.06 IM15505
 Q
WHICH ;SELECT TYPE OF ACTION
 F  D W1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT,ACRDT
 Q
W1 W @IOF
 ;D PAY^ACRFIV41                             ;ACR*2.1*16.06 IM15505
 ;S DIR(0)="S^1:Discount Taken;2:Discount Lost;3:Interest Penalty;4:No Discounts (Taken or Lost) No Penalties;5:Discount/Penalty Adjustments Complete"   ;ACR*2.1*16.06 IM15505
 N ACRTMP                                    ;ACR*2.1*16.06 IM15505
 D PAY^ACRFIV43(.ACRIVPAY,.ACRIVT,.ACRTERMS,.ACRT)  ;ACR*2.1*16.06 IM15505
 S ACRTMP="S^1:Discount Taken"               ;ACR*2.1*16.06 IM15505
 S ACRTMP=ACRTMP_";2:Discount Lost **UNAVAILABLE**"  ;ACR*2.1*16.06 IM15505
 S ACRTMP=ACRTMP_";3:Interest Penalty"       ;ACR*2.1*16.06 IM15505
 S ACRTMP=ACRTMP_";4:No Discounts (Taken or Lost) No Penalties"  ;ACR*2.1*16.06 IM15505
 S ACRTMP=ACRTMP_";5:Discount/Penalty Adjustments Complete"  ;ACR*2.1*16.06 IM15505
 S DIR(0)=ACRTMP                             ;ACR*2.1*16.06 IM15505
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 I '+Y!$D(ACRQUIT)!$D(ACROUT) Q
 S ACRWHICH=+Y
 ;I Y=1 D DISCOUNT S Y=1                     ;ACR*2.1*16.06 IM15505
 ;I Y=2 D LOST^ACRFIV41 Q                    ;ACR*2.1*16.06 IM15505
 ;I Y=3 D INTEREST^ACRFIV41 S Y=3            ;ACR*2.1*16.06 IM15505
 ;I Y=4 S ACRWHICH=0,ACRQUIT="" K ACRIVDC,ACRP,ACRPCNT,ACRLOST,ACRTERMS,ACRPPEN,ACRTYPE,ACRDT,ACRT Q   ;ACR*2.1*16.06 IM15505
 ;I Y=5 D DCAN:$G(ACRT)]""&($G(ACRIVDC)!$G(ACRP)) S ACRQUIT="" Q   ;ACR*2.1*16.06 IM15505
 I Y=1 D DISCOUNT^ACRFIV42(.ACRTERMS,.ACRDT,.ACROUT,.ACRQUIT,.ACRIVPAY) S Y=1  ;ACR*2.1*16.06 IM15505
 I Y=2 D LOST^ACRFIV42(.ACRTERMS) Q            ;ACR*2.1*16.06 IM15505
 I Y=3 D INTEREST^ACRFIV41 S Y=3               ;ACR*2.1*16.06 IM15505
 I Y=4 D  Q      ;No Penalties/Discounts(Taken or Lost) ;ACR*2.1*16.06 IM15505
 .S ACRWHICH=0,ACRQUIT=""                      ;ACR*2.1*16.06 IM15505
 .K ACRIVDC,ACRP,ACRPCNT,ACRTERMS,ACRPPEN,ACRTYPE,ACRDT,ACRT  ;ACR*2.1*16.06 IM15505
 ;
 I Y=5 D  Q   ;Discount/Penalty Adjustments Complete ;ACR*2.1*16.06 IM15505
 .S ACRQUIT=""                                 ;ACR*2.1*16.06 IM15505
 ;
 I $D(ACRQUIT)!$D(ACROUT)!'$D(ACRTERMS) K ACRQUIT Q
 Q
SCHT ;EP;DEFINE SCHEDULE TYPE  ;Commented out in ACR*2.1*16.06 IM15505; restored in ACR*2.1*17.07 IM17139
 I $G(ACRACHX)]"" S ACRACH=ACRACHX K ACRACHX Q
 N X
 S X=$S(ACRBTYP="V":$G(^AUTTVNDR(ACRVDA,19)),1:$G(^ACRAU(ACRDUZ,19)))
 ;S DIR(0)="SO^1:ACH-Grouped;2:ACH Non-Grouped;3:Check-Grouped;4:NO-Check;5:Check-Not Grouped" ;ACR*2.1*2.1;ACR*2.1*17.13 IM17827
 S DIR(0)="SO^2:ACH Non-Grouped;3:Check-Grouped;4:NO-Check;5:Check-Not Grouped"  ;ACR*2.1*2.01;ACR*2.1*17.13 IM17827
 S DIR("A")="Type of Payment"
 S:'$D(DIR("B")) DIR("B")="ACH Non-Grouped"
 I $P(X,U)=""!($P(X,U,2)="")!($P(X,U,3)="") D  I 1
 .S DIR("B")="Check"
 .W !!,"BANK ACCOUNT information NOT on file."
 .S DIR(0)=DIR(0)_";6:Add BANK ACCOUNT information"
 E  S:'$D(DIR("B")) DIR("B")="ACH Non-Grouped" W !!,"ACCOUNT TYPE: ",$S($E(X)="C":"CHECKING",1:"SAVINGS"),!,"Bank routing and account data on file."
 W !
 D DIR^ACRFDIC
 Q:$D(ACROUT)
 I '+Y S ACRQUIT="" Q
 S ACRACH=$S(+Y=1:"A",+Y=2:"B",+Y=3:"C",+Y=4:"G",+Y=5:"N",1:"")
 I +Y=6 D  G SCHT
 .S DA=$S(ACRBTYP="V":ACRVDA,1:ACRDUZ)
 .S DIE=$S(ACRBTYP="V":"^AUTTVNDR(",1:"^ACRAU(")
 .S DR="1901T;1902T;1903T;1904T;1905T"
 .W !
 .D DIE^ACRFDIC
 Q
 ;NEW SUB-ROUTINE         ;Added in ACR*2.1*16.06 IM15505; removed in ACR*2.1*17.07 IM17139
 ;SCHT(ACRACHX,ACRACH,ACRBTYP,ACRVDA,ACRDUZ,ACRQUIT)  ;EP; CALLED BY ACRFPRC5
 ; LOCAL ENTRY FROM EN 
 ;DEFINE SCHEDULE TYPE
 ;
 ;I $G(ACRACHX)]"" S ACRACH=ACRACHX K ACRACHX Q
 ;N X,ACRTMP
 ;S X=$S(ACRBTYP="V":$G(^AUTTVNDR(ACRVDA,19)),1:$G(^ACRAU(ACRDUZ,19)))
 ;S DIR(0)="SO^2:ACH Non-Grouped;3:Check-Grouped;4:NO-Check;5:Check-Not Grouped"  ;ACR*2.1*2.01
 ;S DIR(0)="SO^1:ACH-Grouped;2:ACH Non-Grouped;3:Check-Grouped;4:NO-Check;5:Check-Not Grouped"  ;ACR*2.1*2.01
 ;S DIR("A")="Type of Payment"
 ;S:'$D(DIR("B")) DIR("B")="ACH Non-Grouped"
 ;I $P(X,U)=""!($P(X,U,2)="")!($P(X,U,3)="") D  I 1
 ;.S DIR("B")="Check"
 ;.W !!,"BANK ACCOUNT information NOT on file."
 ;.S DIR(0)=DIR(0)_";6:Add BANK ACCOUNT information"
 ;E  I '$D(DIR("B")) D
 ;.S DIR("B")="ACH Non-Grouped"
 ;.W !!,"ACCOUNT TYPE: "
 ;.W $S($E(X)="C":"CHECKING",1:"SAVINGS")
 ;.W !,"Bank routing and account data on file."
 ;W !
 ;D DIR^ACRFDIC
 ;Q:$D(ACROUT)
 ;I '+Y S ACRQUIT="" Q
 ;S ACRACH=$S(+Y=1:"A",+Y=2:"B",+Y=3:"C",+Y=4:"G",+Y=5:"N",1:"")
 ;I +Y=6 D  G SCHT
 ;.S DA=$S(ACRBTYP="V":ACRVDA,1:ACRDUZ)
 ;.S DIE=$S(ACRBTYP="V":"^AUTTVNDR(",1:"^ACRAU(")
 ;.S DR="1901T;1902T;1903T;1904T;1905T"
 ;.W !
 ;.D DIE^ACRFDIC
 ;Q
VERIFY ;VERIFY THAT ALL DATA IS CORRECT
 ;D PAY^ACRFIV41                                   ;ACR*2.1*16.06 IM15505
 D PAY^ACRFIV43(.ACRIVPAY,.ACRIVT,.ACRTERMS,.ACRT) ;ACR*2.1*16.06 IM15505
 S DIR(0)="Y"
 S DIR("A")="Record this payment now"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$D(ACROUT)
 I '+Y S ACRQUIT="" K ACRTERMS,ACRP,ACRIVDC Q
 I +Y=1 S ACRPAYME="" K ACRQUIT,ACROUT
 Q
DOC() ;EP;TO PRINT DOCUMENT NO
 Q:'$D(ACRDOCDA)
 S X=$S($P(^ACRDOC(ACRDOCDA,0),U,2)]"":$P(^(0),U,2),1:$P(^(0),U))
 Q X
OBL ;EP;TO PRINT AMOUNT OBLIGATED
 Q:'$D(ACRDOCDA)
 D SETDOC^ACRFEA1
 S ACRREFX=$S($D(ACRRRNO):499,1:ACRREF)
 S ACRPAY=""
 D ^ACRFPSS
 K ACRREFX
 Q
CAN() ;EP;TO PRINT CAN
 S X="CAN NUMBER"
 Q X
OBJ() ;EP;TO PRINT AMOUNT OBLIGATED
 S X="OBJC"
 Q X
 ;
 ;Rewrote and moved SUB-ROUTINE DCAN to ACRFIV42  ;ACR*2.1*16.06 IM15505
DCAN ;DETERMINE WHICH CAN SHOULD BE USED FOR THE DISCOUNT OR PENALTY
 ;N ACR,ACRJ
 ;S (ACR,ACRJ)=0
 ;F  S ACR=$O(ACRIVPAY(ACR)) Q:'ACR  D
 ;.S ACRJ=$G(ACRJ)+1
 ;.S ACR(ACRJ)=ACR
 ;I ACRJ=1 S Y=1 D C1 Q
 ;W !!?10,"Select the CAN for DISCOUNT or INTEREST PENALTY"
 ;W !!?10,"---",?15,"-------"
 ;S (ACR,ACRJ)=0
 ;F  S ACR=$O(ACRIVPAY(ACR)) Q:'ACR  D
 ;.S ACRJ=$G(ACRJ)+1
 ;.W !?10,ACRJ,?15,$P(^AUTTCAN(ACR,0),U)
 ;S DIR(0)="N^1:"_ACRJ
 ;S DIR("A")=$S(ACRT>0:"Deduct DISCOUNT from",1:"Charge INTEREST PENALTYTO")_" which CAN: "
 ;W !
 ;D DIR^ACRFDIC
 ;I '+Y K ACRQUIT Q
C1 ;S ACRCANDA=ACR(Y)
 ;S ACROBJDA=$S(ACRT>0:1,ACRT=0:1,1:$O(^AUTTOBJC("C",4319,0)))
 ;Q:'ACRCANDA!'ACROBJDA
 ;S ACRIVDIS(ACRCANDA,ACROBJDA)=$S(ACRT>0!(ACRT=0):ACRIVDC,1:ACRP)
 ;S ACRIVDIS(ACRCANDA,ACROBJDA,$S(ACRT>0!(ACRT=0):"D",1:"P"))=$S(ACRT>0!(ACRT=0):ACRIVDC,1:ACRP)
 ;S ACRIVDIS(ACRCANDA,$S(ACRT>0!(ACRT=0):"D",1:"P"))=$S(ACRT>0!(ACRT=0):ACRIVDC,1:ACRP)
 ;Q
 ;End of old DCAN sub-routine        ;ACR*2.1*16.06 IM15505