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

BARUFPRP.m

Go to the documentation of this file.
BARUFPRP ; IHS/SD/TPF - REPORT TO WRITE OUT REPORT FILE ;01/26/2009
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**4,10,24**;OCT 26, 2005;Build 69
EN ;EP;NEW ROUTINE STANDALONE UTILITY TO WRITE OUT BARBOB FILE;MRS:02/04/2008
 ;
 ;    ENTERS WITH
 ;          BARU = CASHIER WHO CREATED BOB
 ;          BARA = DUZ(2)
 ;          BARB = BATCH IEN
 ;          BARC = BATCH ITEM
 ;          BARD = TRANSACTION
 ;
 ;JULY 2013 IHS/SD/POTT HEAT118656 BELCOURT SKIP UNDEF ENTRY IN ^BARCOL BAR*1.8*24
 ;
 N BARA,BARB,BARC,BARD,BARTMP,BARTXT,BARU,BAREND
 S BARU=DUZ
 D OLD(.BARU)
 I '$D(^BARBOB("BARZ",+BARU)) D
 .; Ask user if want to create file
 .W !
 .K DIR
 .S DIR(0)="Y"
 .S DIR("A")="NO DATA IN BOB, DO YOU WANT TO GENERATE THE FILE NOW?"
 .S DIR("B")="N"
 .D ^DIR
 .I Y=1 D
 ..D ASKFROM
 ..Q:BARFROM=""
 ..;W !!,"Please be have patience, this might take a few minutes"  ;MRS:BAR*1.8*10 H2437
 ..W !!,"Please have patience, this might take a few minutes"  ;MRS:BAR*1.8*10 H2437
 ..D PRE^BARUFEX5(BARFROM,DUZ)
 ..S BARU=DUZ
 Q:'$D(^BARBOB("BARZ",+BARU))
 ;
BEGIN S %ZIS="MQ"
 W !
 D ^%ZIS
 Q:POP
 I $D(IO("Q")) D QUE Q
 U IO
 D HDR
 S BARA=0 F  S BARA=$O(^BARBOB("BARZ",BARU,BARA)) Q:'BARA  D
 .S BARB=0 F  S BARB=$O(^BARBOB("BARZ",BARU,BARA,BARB)) Q:'BARB  D
 . . I '$D(^BARCOL(BARA,BARB)) D  Q  ;BELCOURT HEAT118656 BAR*1.8*24
 . . . I $P($G(^VA(200,DUZ,0)),U,4)'="@" Q
 . . . W !,"ENTRY IN COLLECTION BATCH FILE MISSING: BARCOL(",BARA,",",BARB
 ..S BARCOLB=$P(^BARCOL(BARA,BARB,0),U,1) ;A/R COLLECTION BATCH NAME
 ..S BARC=0
 ..F  S BARC=$O(^BARBOB("BARZ",BARU,BARA,BARB,BARC)) Q:'BARC  D
 ...S BARTMP=$G(^BARBOB("BARZ",BARU,BARA,BARB,BARC))
 ...S BARTXT="**REVERSAL BATCH**"
 ...S:BARTMP=1 BARTXT="**PAYMENTS ONLY**"
 ...S:BARTMP=2 BARTXT="**PAYMENT BATCH WITH MINUS CODE"
 ...S:BARTMP=3 BARTXT="**REVERSAL BATCH WITH MINUS CODE**"
 ...W !,BARA,U,BARCOLB,U,BARC,U,BARTXT
 ...S BARD=0
 ...F  S BARD=$O(^BARBOB("BARZ",BARU,BARA,BARB,BARC,BARD)) Q:'BARD  D
 ....S BARD0=^BARBOB("BARZ",BARU,BARA,BARB,BARC,BARD)
 ....S P1=$P(BARD0,U)           ;DOLLAR AMOUNT
 ....S P2=$P(BARD0,U,2)         ;SCHEDULE NUMBER
 ....S P3=$P(BARD0,U,3)         ;BILL IEN
 ....S P4=$P(BARD0,U,4)         ;BILL NUMBER
 ....S P5=$P(BARD0,U,5)         ;PAIR FLAG (0,1,2,-3,-4,-6,-7,-25,-I)
 ....S P6=$P(BARD0,U,6)         ;PAIRED COLL BATCH IEN
 ....S P7=$P(BARD0,U,7)         ;PAIRED ITEM NUMBER
 ....S P8=$P(BARD0,U,8)         ;PARIED TRANSACTION
 ....S:P6]"" P6=$P(^BARCOL(BARA,P6,0),U,1) ;A/R COLLECTION BATCH NAME
 ....W !,BARA,U,BARCOLB,U,BARC,U,BARD,U
 ....W P1,U,P2,U,P3,U,P4,U,P5,U,P6,U,P7,U,P8
 D ^%ZISC
 Q
HDR ;
 W U_"BOB REPORT FOR ENDING DATE "_$G(^BARBOB("BARZ",BARU,"END"))
 W !,"DUZ(2)",U,"COLLECTION BATCH",U,"BATCH ITEM NUMBER",U
 W "TRANSACTION",U,"AMOUNT",U,"TDN/IPAC",U,"BILL IEN",U,"A/R BILL"
 W U_"PAIR FLAG"_U_"PAIRED BATCH"_U_"PAIRED ITEM"_U_"PAIRED TX"
 W !
 Q
QUE ; EP - QUE 'NOT SENT' OR 'DELAY SEND' REPORT
 S ZTRTN="^BARUFPRP"
 S ZTDESC="BOB PAYMENT REPORT"
 S ZTSAVE("XREF")=""
 D ^%ZTLOAD
 I $D(ZTSK)[0 W !!?5,"Report Cancelled!"
 E  W !!?5,"Report task #: ",$G(ZTSK)
 D HOME^%ZIS
 Q
OLD(OLDDUZ) ;FIND MOST RECENT 
 ;^BARBOB("BARZ",1234,"BEGIN")=3080227.100406
 ;                   "COUNT")=24903
 ;                    "END")=3080227.100614
 N A,OLDDT,OLDDUZ
 S (OLDDT,OLDDUZ)=""
 S A=0
 F  S A=$O(^BARBOB("BARZ",A)) Q:'A  D
 .S END=$G(^BARBOB("BARZ",A,"END"))
 .I END>OLDDT S OLDDUZ=A
 Q
ASKFROM ;EP - ASK FROM DATE
 S BARFROM=""
 K %DT
 S %DT="AET"
 S %DT("A")="Enter beginning session date: "
 W !
 D ^%DT
 Q:X=""!(X[U)
 I Y<0 W !,"INVALID DATE. TRY AGAIN!" H 2 G ASKFROM
 S BARFROM=Y
 Q  ;EOR