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