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

IBCERP1.m

Go to the documentation of this file.
IBCERP1 ;ALB/CXW - BILL AWAITING RESUBMISSION REPORT ;20-APR-99
 ;;2.0;INTEGRATED BILLING;**137**;21-MAR-94
 Q
INC ; Report of bill awaiting resubmission/cancel
 N DIR,Y,IBSORT,DIRUT,DIROUT,DTOUT,DUOUT
 S DIR(0)="SBM^B:BILL NUMBER;L:LAST SENT DATE;A:BILLED AMOUNT;N:BATCH NUMBER"
 S DIR("A")="SORT REPORT BY",DIR("B")="BILL NUMBER"
 S DIR("?")="Select the order you want the report sorted in" D ^DIR K DIR
 Q:$D(DTOUT)!($D(DUOUT))
 S IBSORT=Y
 ;
 N %ZIS,ZTSAVE,ZTRTN,ZTDESC
 S %ZIS="QM" D ^%ZIS Q:POP
 I $D(IO("Q")) K IO("Q") S ZTRTN="EN^IBCERP1",ZTSAVE("IBSORT")="",ZTDESC="IB - Bills Awaiting Resubmission Report" D ^%ZTLOAD K ZTSK D HOME^%ZIS Q
 U IO
EN ; Queued job entrypoint
 N IBSTOP,IBPAGE,IBLINE,IB,IB0,IB1,IBB,IBB0,IBB1,IBBIL,IBHDRDT,DIR,Y
 W:$E(IOST,1,2)["C-" @IOF ;Only initial form feed for print to screen
 K ^TMP($J,"IBSORT")
 S IB=0 F  S IB=$O(^IBA(364.1,"AINC",1,IB)) Q:'IB  D
 . S IBLDT=+$P($G(^IBA(364.1,IB,1)),"^",3)
 . S IBB=0 F  S IBB=$O(^IBA(364,"C",IB,IBB)) Q:'IBB  S IBB0=$G(^IBA(364,IBB,0)) D
 .. ;Q:$$LAST364^IBCEF4(+IBB0)'=IBB
 .. S ^TMP($J,"IBSORT",$S(IBSORT="B":$$BN1^PRCAFN(+IBB0),IBSORT="L":IBLDT,IBSORT="A":-$P($G(^DGCR(399,+IBB0,"U1")),U),1:IB),IBB)=IB
LIST ;display
 S (IBSTOP,IBPAGE)=0 D HDR1
 I '$D(^TMP($J,"IBSORT")) D  G INCQ
 . W !,?7,"No entries found for this report"
 S IBB1="" F  S IBB1=$O(^TMP($J,"IBSORT",IBB1)) Q:IBB1=""!(IBSTOP)  S IBB=0 F  S IBB=$O(^TMP($J,"IBSORT",IBB1,IBB)) Q:'IBB  D  Q:IBSTOP
 . S IB0=$G(^IBA(364.1,+$G(^TMP($J,"IBSORT",IBB1,IBB)),0)),IB1=$G(^(1))
 . S IB=$G(^IBA(364,IBB,0)),IBBIL=$$BN1^PRCAFN(+IB)
 . S:IBBIL=-1 IBBIL=""
 . I ($Y+5)>IOSL D HDR1 Q:IBSTOP
 . W !,?0,IBBIL,?13,$P(IB0,U),?25,$$FMTE^XLFDT($P(IB1,U,3),2),?41,$E($$EXPAND^IBTRE(364,.03,$P(IB,U,3)),1,24),?67,"$"_$J(+$G(^DGCR(399,+IB,"U1")),0,2)
 W !
 G:IBSTOP INCQ
 I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR
INCQ K ^TMP($J,"IBSORT")
 I $D(ZTQUEUED) S ZTREQ="@"
 I '$D(ZTQUEUED) W ! D ^%ZISC
 Q
HDR1 ;
 N DIR,Y
 I 'IBPAGE S IBHDRDT=$$HTE^XLFDT($H,"2")
 I IBPAGE D  Q:IBSTOP
 . I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR S IBSTOP=('Y) Q:IBSTOP
 . W @IOF
 S IBPAGE=IBPAGE+1
 W !,?23,"BILLS AWAITING RESUBMISSION REPORT",?65,"PAGE: ",IBPAGE,!,?27,"RUN DATE: ",IBHDRDT,!
 W !,?2,"SORT BY: ",$S(IBSORT="B":"BILL NUMBER",IBSORT="L":"LAST SENT DATE",IBSORT="A":"BILLED AMOUNT",1:"BATCH NUMBER"),!
 W !,?13,"LAST SENT",?25,"LAST SENT",?67,"BILLED"
 W !,"BILL NUMBER",?13,"IN BATCH #",?25,"DATE/TIME",?41,"BILL TRANSMISSION STATUS",?67,"AMOUNT"
 W !,$TR($J("",80)," ","-"),!
 Q
 ;