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

BARUFLTR.m

Go to the documentation of this file.
BARUFLTR ; IHS/SD/TPF - UFMS LETTERS ;
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,4,17**;OCT 22, 2008
 Q
 ;
 ;LETTER(BARAMT,BARCOL,BARCHK,BARSCHED,BARINS,BARLTR) ;EP - PRINT LETTER
LETTER(BARAMT,BARCOL,BARCHK,BARSCHED,BARINS,BARLTR,BARRETYP,BARADJT) ;EP - PRINT LETTER ;BAR*1.8*4
 S BARSAVE=1
LETTER1 ;EP -
 S Y=DT X ^DD("DD")
 S BAREXNOW=Y
 ;S BARDUZ=DUZ
 ;S BARDUZ2=DUZ(2)
 S:'$G(BARDUZ) BARDUZ=DUZ      ;BAR*1.8*4 IF THESE ARE SET THE CALL IF FROM THE REPRINT OPTION
 S:'$G(BARDUZ2) BARDUZ2=DUZ(2)
 W !!,"Select device to print Finance letter..."
 S %ZIS("B")=""
 S %ZIS="MQO"
 D ^%ZIS
 Q:POP
 ;I IO=IO(0) W !!,"CAN'T PRINT LETTER TO THE SCREEN!!" H 2 G LETTER1  ;BAR*1.8*4 SCR56
 I $D(IO("Q")) D QUE Q
 U IO
 D PRINT
 W @IOF
 D ^%ZISC
 Q
QUE ; EP - QUE 'NOT SENT' OR 'DELAY SEND' REPORT
 S ZTRTN="PRINT^BARUFLTR"
 S ZTDESC=BARLTR
 S ZTSAVE("BAR*")=""
 D ^%ZTLOAD
 I $D(ZTSK)[0 W !!?5,"Report Cancelled!"
 E  W !!?5,"Report task #: ",$G(ZTSK)
 D HOME^%ZIS
 Q
 ;
PRINT ;EP - PRINT THE LETTER
 N LTRIEN,LINE
 K DIC,DIR,DR,DA,DIE
 S X=BARLTR
 S DIC="^BAR(90052.03,"
 S DIC(0)="QELM"
 D ^DIC
 I Y<0 W !,"CANNOT FIND '"_BARLTR_" IN A/R LETTERS & TEXT FILE" Q
 ;TRAVERSE THE LETTER
 S LTRIEN=+Y
 S LINE=0
 F  S LINE=$O(^BAR(90052.03,LTRIEN,1,LINE)) Q:'LINE  D
 .S LINETXT=^BAR(90052.03,LTRIEN,1,LINE,0)
 .Q:$E(LINETXT)=";"  ;COMMENT LINE
 .I $E(LINETXT)="~" X $P(LINETXT,"~",2)
 .E  W !,LINETXT
 I $F("789",LTRIEN)&$G(BARPRTQ)=1 D PUCCMT  ; BAR1.8*17 PKD 2/24/2010
 Q:'BARSAVE  ;BAR*1.8*4 DO NOT SAVE IF THIS IS A REPRINT
 D SAVE(BARAMT,BARCOL,BARCHK,BARSCHED,BARINS,LTRIEN,$G(BARRETYP),$G(BARADJT))  ;BAR*1.8*4 SAVE DATA INTO A/R PRINTED LETTERS FILE
 Q
 ;
 ; BEGIN NEW CODE BAR*1.8.*17
PUCCMT ;
 ; IF COMMENTS FOR PUC ITEMS, RETRIEVE & PRINT	BAR*1.8*17 pkd 2/24/2010
 N CMT,DSH,LN
 S CMT=0 Q:$G(^BARCOL(DUZ(2),BARTX(14,"I"),1,BARTX(15,"I"),7,0))=""
 M CMT=^BARCOL(DUZ(2),BARTX(14,"I"),1,BARTX(15,"I"),7)
 S CMT=$P(CMT(0),"^",3) Q:'CMT
 S $P(DSH,"=",79)=""
 W !!,DSH,!,"Comments:" F LN=1:1:CMT W !,CMT(LN,0)
 Q
 ;
 ;BAR*1.8*4
SAVE(BARAMT,BARCOL,BARCHK,BARSCHED,BARINS,LTRIEN,BARRETYP,BARADJT) ;
 D NOW^%DTC
 S (DINUM,X)=%
 S DIC(0)=""
 S DIC="^BAR(90052,"
 S DIC("DR")=".02////^S X=BARDUZ;"
 S DIC("DR")=DIC("DR")_".03////^S X=BARDUZ2;"
 S DIC("DR")=DIC("DR")_".04////^S X=BARAMT;"
 S DIC("DR")=DIC("DR")_".05////^S X=BARCOL;"
 S DIC("DR")=DIC("DR")_".06////^S X=BARCHK;"
 S DIC("DR")=DIC("DR")_".07////^S X=BARSCHED;"
 S DIC("DR")=DIC("DR")_".08////^S X=BARINS;"
 S DIC("DR")=DIC("DR")_".09////^S X=LTRIEN;"
 I BARLTR["UNBILLED" S DIC("DR")=DIC("DR")_".11////^S X=BARRETYP"
 E  S DIC("DR")=DIC("DR")_".12////^S X=BARRETYP"
 K DO D FILE^DICN
 Q
 ;
REPRINT ;EP - REPRINT ALREADY PRINTED LETTERS
 N BARAMT,BARCOL,BARCHK,BARSCHED,BARINS,BARLTR,BARRETYP,BAREXTYP
 K NOSAVE
 K DIC,DIR,DIE,DA,DR
 S DIC(0)="AEMQ"
 S DIC="^BAR(90052,"
 S DIC("W")="D ID^BARUFLTR"
 W !!
 D ^DIC
 Q:Y<0
 S IENS=+Y_","
 S BARDUZ=$$GET1^DIQ(90052,IENS,.02,"I")
 S BARDUZ2=$$GET1^DIQ(90052,IENS,.03,"I")
 S BARAMT=$$GET1^DIQ(90052,IENS,.04,"I")
 S BARCOL=$$GET1^DIQ(90052,IENS,.05,"I")
 S BARCHK=$$GET1^DIQ(90052,IENS,.06,"I")
 S BARSCHED=$$GET1^DIQ(90052,IENS,.07,"I")
 S BARINS=$$GET1^DIQ(90052,IENS,.08,"I")
 S BARLTR=$$GET1^DIQ(90052,IENS,.09,"E")
 S BARRETYP=$$GET1^DIQ(90052,IENS,.11,"I")
 S BARRETYP=BARRETYP_" "_$$GET1^DIQ(90052,IENS,.11,"E")
 S BARSAVE=0
 D LETTER1
 Q
 ;
ID ;EP- DISPLAY LIST FOR 'A/R PRINTED LETTERS'
 ;+Y IS INTERNAL IEN
 N TYPE
 S TYPE=$$GET1^DIQ(90052,+Y_",",.09,"E")
 W ?22,$P(TYPE," LETTER")  ;TYPE OF LETTER
 W ?45,$J($$GET1^DIQ(90052,+Y_",",.04,"E"),10,2)  ;AMOUNT
 W !?27,$S(TYPE["UNBILLED":$$GET1^DIQ(90052,+Y_",",.11,"I"),1:$$GET1^DIQ(90052,+Y_",",.12,"I"))  ;TYPE OF REIMBURSEMENT OR ADJUSTMENT TYPE
 W !?6,$$GET1^DIQ(90052,+Y_",",.05,"I")
 W ?60,$$GET1^DIQ(90052,+Y_",",.02,"E")  ;USER
 Q