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

BARDMXX.m

Go to the documentation of this file.
BARDMXX ; IHS/SD/LSL - Debt Letter Management Report of printed letters;
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**23,24**;OCT 26, 2005;Build 69
 ;IHS/SD/POT New routine 5-SEP-2012 for Debt Letter Management- BAR*1.8*.23
 ;Routine to print report of printed letters for selected date / batch
 ;IHS/SD/POT NOHEAT AUG 2013 ADDED SELECTION BATCH / DATE RANGE - BAR*1.8*.23
 ;IHS/SD/POT HEAT152452 2/10/2014 CHK IF PAR/SAT FILE CORECTLY SET UP  - BAR*1.8*.24
 D INIT
 Q:$G(BARQ)  ;P.OTT HEAT152452 - BAR*1.8*.24
 D BARMODE I BARQ QUIT  ;SELECT REPORT SCOPE
 I BARMODE="B" D SEL I BARQ QUIT  ;SELECT BATCH
 I BARMODE="B" D BUILD(BARBAT),PRINT QUIT
 I BARMODE="D" D ASKFROM I BARQ QUIT  ;SELECT DATE FORM-TO AUG 2013 - BAR*1.8*.23
 ;(1575,"B",3130823.120044) 
 S BARDT=BARFROM\1 F  S BARDT=$O(^BARDMLG(DUZ(2),"B",BARDT)) Q:+BARDT=0!(BARDT\1>BARTO)  D
 . S BARBAT="" F  S BARBAT=$O(^BARDMLG(DUZ(2),"B",BARDT,BARBAT)) Q:+BARBAT=0  D BUILD(BARBAT)
 D PRINT
 Q
INIT ;
 D PAR^BARDMU
 K ^TMP("BARDMQN",$J)
 Q:$G(BARQ)  ;HEAT152452 - BAR*1.8*.24
 Q
SEL ;
 W !!
 S (BARQ,BARREQ)=0
 S DIC="^BARDMLG("_DUZ(2)_","
 S DIC("A")="Enter the Debt Management Batch Date: "
 S DIC(0)="AEQ"
 D ^DIC
 I +Y<1 S BARQ=1 Q
 S BARBAT=+Y
 Q
BARMODE ;
 K DIRUT,DIR,Y
 S (BARQ,BARMODE)=0
 S Y=$$DIR^XBDIR("S^B:Select batch;D:Select date from - to","Select scope of the report ","","","","",1)
 K DA
 I (X[U) S BARQ=1 Q
 S BARMODE=Y
 Q
ASKFROM ;EP - ASK FROM DATE
 ;S BARJOB=$J
 S BARQ=0
 K %DT
 S %DT="AET"
 S %DT("A")="Enter beginning date: "
 W !
 D ^%DT
 I X=""!(X[U) S BARQ=1 Q
 I Y<0 W !,"INVALID DATE. TRY AGAIN!" H 2 G ASKFROM
 S BARFROM=Y
ASKTO ;EP - ASK TO DATE
 K %DT
 S %DT="AET"
 S %DT("A")="Enter ending date: "
 W !
 D ^%DT
 G:X=""!(X[U) ASKFROM
 I Y<0 W !,"INVALID DATE. TRY AGAIN!" H 2 G ASKTO
 S BARTO=Y
 I BARTO<BARFROM W !!,"END DATE MUST BE GREATER THAN BEGINNING DATE" H 2 G ASKFROM
 ;
BUILD(BARBAT) ;
 NEW BARBIEN,BARCNT,BARCY,BARCYCLE,BARD3P,BARD3PD,BARDM,BARDMINS
 S BARCY=0 F  S BARCY=$O(^BARDMLG(DUZ(2),BARBAT,100,BARCY))  Q:'BARCY  D
 . S BARCYCLE=$P(^BARDMLG(DUZ(2),BARBAT,100,BARCY,0),"^",1)
 . S BARCNT=0 F  S BARCNT=$O(^BARDMLG(DUZ(2),BARBAT,100,BARCY,10,BARCNT)) Q:'BARCNT  D
 . . S BARDM=^BARDMLG(DUZ(2),BARBAT,100,BARCY,10,BARCNT,0)
 . . S BARBIEN=$P(^BARDM(DUZ(2),BARDM,0),U)
 . . I '$D(^BARBL(DUZ(2),BARBIEN,0)) QUIT  ;11/19/2013
 . . S BARD3P=$P(^BARBL(DUZ(2),BARBIEN,0),U,17)
 . . S BARD3PD=$P($G(^BARBL(DUZ(2),BARBIEN,0)),U,22)
 . . S BARDMINS=$P($G(^ABMDBILL(BARD3PD,BARD3P,0)),U,8)
 . . S ^TMP("BARDMQN",$J,BARCYCLE,BARDM,1)=BARDMINS
 Q
PRINT D ^BARDMRQN
 Q  ;EOR