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

BARUFRP2.m

Go to the documentation of this file.
BARUFRP2 ; IHS/SD/TPF - UFMS DS,NS, TRANSACTION REPORTS ; 02/29/2008
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,4,6,14,18**;OCT 22,2008
 ;
 ;NEW ROUTINE ;;BAR*1.8*4               DD ITEM
 ;IHS/SD/TMM  ;;BAR*1.8*14 M1 09/02/09  IGNORE FLAG was still printing on NS Report
 ;--------------------------------------------------------------------------------
 Q
 ;THIS ROUTINE IS CALLED BY OPTION [BAR UFMS RPT 'NOT SENT' REPORT
 ;
NOTSENT ;EP;
 N BARTRDT,BARLINE,BARNOW,BARDELDT,BARCRDEB,BARBILL,BARBIEN,BARENTBY,BARTPIEN,BARTRNTP,BARADJC
 N BARREAS
 ;
ASKFROM ;EP - ASK FROM DATE
 K %DT
 S %DT="AET"
 S %DT("A")="Enter beginning transaction date: "
 W !
 D ^%DT
 Q:X=""!(X[U)
 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 transaction 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 BEGINING DATE" H 2 G ASKFROM
 ;
ASKDEV ;EP - ASK DEVICE 
 S %ZIS="MQ"
 W !
 D ^%ZIS
 Q:POP
 I $D(IO("Q")) D QUE Q
 U IO
 D PRINT
 D ^%ZISC
 Q
QUE ; EP - QUE 'NOT SENT' OR 'DELAY SEND' REPORT
 S ZTRTN="PRINT^BARUFRP2"
 S ZTDESC="NOT SENT TRANSACTION REPORT"
 S ZTSAVE("XREF")=""
 S ZTSAVE("BARTO")=""
 S ZTSAVE("BARFROM")=""
 D ^%ZTLOAD
 I $D(ZTSK)[0 W !!?5,"Report Cancelled!"
 E  W !!?5,"Report task #: ",$G(ZTSK)
 D HOME^%ZIS
 Q
PRINT ;EP - ENTRY POINT FOR REPORT
 K BAR("CNT")
 K BAR("AMT")
 S $P(BARLINE,"-",81)=""
 D NOW^%DTC
 S Y=% X ^DD("DD") S BARNOW=Y
 S BARNOW=Y
 D NOTDET
 S BARESC=0
 S BARTO=BARTO_"."_999999
 S BARTRDT=BARFROM-.000001
 F  S BARTRDT=$O(^BARSESS(DUZ(2),"NS",BARTRDT)) Q:'BARTRDT!(BARESC)!(BARTRDT>BARTO)  D
 .S BARSESID=$O(^BARSESS(DUZ(2),"NS",BARTRDT,""))
 .S BARUDUZ=$O(^BARSESS(DUZ(2),"NS",BARTRDT,BARSESID,""))
 .; ***BEGIN M1***                                      ;TMM M1 09/02/09
 .; Quit if IGNORE FLAG="I"                             ;TMM M1 09/02/09
 .S BARIFLG=$P($G(^BARTR(DUZ(2),BARTRDT,1)),U,12)       ;TMM M1 09/02/09
 .Q:(BARIFLG="I")!(BARIFLG="-I")                        ;TMM M1 09/02/09
 .; ***END M1***                                        ;TMM M1 09/02/09
 .S BARAPPTO=$P($G(^BARSESS(DUZ(2),BARUDUZ,11,BARSESID,2,BARTRDT,0)),U,5)
 .S BARBIEN=$P($G(^BARTR(DUZ(2),BARTRDT,0)),U,4)
 .Q:BARBIEN=""
 .S BARBILL=$P($G(^BARBL(DUZ(2),BARBIEN,0)),U)
 .S BARCBTCH=$P($G(^BARTR(DUZ(2),BARTRDT,0)),U,14)
 .S BARCITEM=$P($G(^BARTR(DUZ(2),BARTRDT,0)),U,15)
 .S BARIPAC=""
 .I BARCBTCH'="",(BARCITEM'="") D
 ..;S BARIPAC=$P($G(^BARCOL(DUZ(2),BARCBTCH,1,BARCITEM,0)),U,20)  ;bar*1.8*6
 ..S BARIPAC=$$GET1^DIQ(90051.1101,BARCITEM_","_BARCBTCH_",",20,"E")   ;bar*1.8*6
 ..S BARCBTCH=$P($G(^BARCOL(DUZ(2),BARCBTCH,0)),U)
 .S BARENTBY=$$GET1^DIQ(90050.03,BARTRDT_",",13,"E")
 .S BARTPIEN=$P($G(^BARBL(DUZ(2),BARBIEN,0)),U,17)
 .S BARTPDUZ=$P($G(^BARBL(DUZ(2),BARBIEN,0)),U,22)
 .S BARVTYP=$P($G(^BARBL(DUZ(2),BARBIEN,1)),U,14)
 .S BARTRNTP=$$GET1^DIQ(90050.03,BARTRDT_",",101,"E")
 .S BARADJC=$$GET1^DIQ(90050.03,BARTRDT_",",102,"E")
 .S BARREAS=$P($G(^BARSESS(DUZ(2),BARUDUZ,11,BARSESID,2,BARTRDT,0)),U,9)
 .S BARCRDEB=$$GET1^DIQ(90050.03,BARTRDT_",",3.5)
 .S:BARREAS="" BARREAS="NULL"  ;1/29/2007 TPF ADDED BECAUSE OF NULL FOUND
 .S BAR("CNT",BARREAS)=+$G(BAR("CNT",BARREAS))+1
 .S BAR("AMT",BARREAS)=+$G(BAR("AMT",BARREAS))+BARCRDEB
 .S Y=BARTRDT X ^DD("DD") S BAREXDT=Y
 .W !,BARBILL_U_BAREXDT_U_BARAPPTO_U_BARREAS_U_BARENTBY_U_BARCRDEB_U_$E(BARTRNTP,1,15)_U_$E(BARADJC,1,10)_U_BARCBTCH_U_BARCITEM_U_BARIPAC_U_BARVTYP
 S BARREAS=""
 N BAREDESC
 ;4/10/2010/SD/AR requirement 10021
 W !!,"Count of entries in Not Sent bucket:"
 F  S BARREAS=$O(BAR("CNT",BARREAS)) Q:BARREAS=""  D
 .W !?5,"Error #",BARREAS," had ",$P($G(BAR("CNT",BARREAS)),U)," entries for ",$J($G(BAR("AMT",BARREAS)),".",2)
 W !
 F  S BARREAS=$O(BAR("CNT",BARREAS)) Q:BARREAS=""  D
 .S BAREDESC=$$GET1^DIQ(90057.1,BARREAS_",",.04)
 .W !,BARREAS," - ",BAREDESC
 ;4/10/2010/SD/AR requirement 10021
 Q
 ;
NOTDET ;EP -
 W "A/R BILL^TRAN. DATE^APPLY TO^REASON NOT SENT^ENTRY BY^CREDIT-DEBIT^TRANTYPE^ADJCAT^COLLECTION BATCH^COLLECTION ITEM^TREASURY DEPOSIT/IPAC^VISIT TYPE"
 Q