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

BARUFER.m

Go to the documentation of this file.
BARUFER ; IHS/SD/TPF - UFMS ERROR RESOLUTION ; 10/24/2008
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,7,8,23**;OCT 26, 2005
 Q
 ;
LKUP ;EP - LOOK UP ERROR REPORTED BY UFMS
 N SEARCH,TARGET,CHOICE,ITEM,MAX,LINE,ESC
 D ERRHDR
 S $P(LINE,"-",81)=""
 K DIR,DIC,DIE,DR,DA
 S DIR("?",1)="Enter an 'APPLY TO' value. This corresponds to the 3P invoice #,"
 S DIR("?",2)="or Enter a partial 'APPLY TO' value,"
 S DIR("?")="or enter a '*' to get a list of all 'APPLY TO' values on file"
 S DIR("A")="Enter an 'APPLY TO' value: "
 S DIR(0)="FO^1:20"
 D ^DIR
 Q:$D(DIRUT)!$D(DTOUT)!$D(DUOUT)!(Y="")
 ;
 S TARGET=Y
 K CHOICES
 I Y="*" S SEARCH="",TARGET=""
 E  S SEARCH=TARGET-1
 S (MAX,ESC,CHOICE)=0
 F ITEM=1:1 S SEARCH=$O(^BARSESS(DUZ(2),"E",SEARCH)) Q:SEARCH=""!($E(SEARCH,1,$L(TARGET))'=TARGET)!(ESC)!(CHOICE)  D  ;MRS:BAR*1.8*8 HEAT739
 .;F ITEM=1:1 S SEARCH=$O(^BARSESS(DUZ(2),"E",SEARCH)) Q:SEARCH=""!(ESC)!(CHOICE)  D  ;MRS:BAR*1.8*8 HEAT739
 .S CHOICES(ITEM)=SEARCH
 .S MAX=MAX+1
 .W !,ITEM_". "_CHOICES(ITEM)
 .I '(ITEM#10)!('$O(^BARSESS(DUZ(2),"E",SEARCH))) K DIR S DIR(0)="NO^1:"_MAX W ! D ^DIR Q:Y=""  S ESC=$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q:ESC  S CHOICE=CHOICES(+Y)
 I '$D(CHOICES) W "   ??" H 2 G LKUP
 I ITEM=2,$D(CHOICES) D ARTRAN(CHOICES(1)) G LKUP
 G:ESC!'(CHOICE) LKUP
 D ARTRAN(CHOICE)
 G LKUP
 Q
 ;
ARTRAN(APPLYTO) ;EP - PULL TRANSACTION DATA
 N TRDATE,EXDATE,BILL,BILLIEN,TPBIEN,TRANTYP,ADJCAT,ENTRYBY
 S PAGE=0
 D LKUPHDR(APPLYTO)
 D TRDETAIL
 S TRDATE="",ESC=0
 F  S TRDATE=$O(^BARSESS(DUZ(2),"E",APPLYTO,TRDATE)) Q:'TRDATE!(ESC)  D
 .S CREDIT=$$GET1^DIQ(90050.03,TRDATE_",",2)
 .S DEBIT=$$GET1^DIQ(90050.03,TRDATE_",",3)
 .S BILL=$$GET1^DIQ(90050.03,TRDATE_",",4)
 .S BLLIEN=$$GET1^DIQ(90050.03,TRDATE_",",4,"I")
 .S ENTRYBY=$$GET1^DIQ(90050.03,TRDATE_",",13,"E")
 .S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
 .S TRANTYP=$$GET1^DIQ(90050.03,TRDATE_",",101,"E")
 .S ADJCAT=$$GET1^DIQ(90050.03,TRDATE_",",102,"E")
 .S SESSID=$O(^BARSESS(DUZ(2),"E",APPLYTO,TRDATE,""))
 .S UDUZ=$O(^BARSESS(DUZ(2),"E",APPLYTO,TRDATE,SESSID,""))
 .W !,BILL
 .S Y=TRDATE X ^DD("DD") S EXDATE=Y
 .W ?18,EXDATE
 .W ?50,SESSID
 .;W ?65,$E($P($G(^VA(200,DUZ,0)),U),1,15)  ;MRS;BAR*1.8*7
 .W ?65,$E($P($G(^VA(200,UDUZ,0)),U),1,15)  ;MRS;BAR*1.8*7
 .W !?10,ENTRYBY
 .W ?30,$J(CREDIT,10,2)
 .W ?40,$J(DEBIT,10,2)
 .W ?52,$E(TRANTYP,1,15)
 .W ?70,$E(ADJCAT,1,10)
 .I $Y>(IOSL-4) W ! K DIR S DIR(0)="E" D ^DIR S ESC=$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q:ESC  D LKUPHDR(APPLYTO),TRDETAIL
 .S DELSEND=$$GET1^DIQ(90057.110102,TRDATE_","_SESSID_","_UDUZ_",",.08,"E")
 .I DELSEND'="" D
 ..W !?15,"FILE SENT IN DELAYED MODE:"
 ..W !?20,DELSEND
 .;SESSION TRANSMISSION DATES
 .S TRANSDT=0  ;TRANSMISSION DATE
 .F CNT=1:1 S TRANSDT=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,TRANSDT)) Q:'TRANSDT!ESC  D
 ..S IENS=TRANSDT_","_SESSID_","_UDUZ_","
 ..S EXTRANS=$$GET1^DIQ(90057.210101,IENS,.01,"E")
 ..W:CNT=1 !?15,"SESSION TRANSMISSION DATE: ",EXTRANS
 ..I $Y>(IOSL-4) W ! K DIR S DIR(0)="E" D ^DIR S ESC=$D(DIRUT)!$D(DTOUT)!$D(DUOUT) Q:ESC  D TRANSHDR
 ..S FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
 ..S BY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
 ..W !?15,"IN FILE: ",FILENAME
 ..W !?15,"     BY: ",BY
 Q:ESC
 K DIR
 S DIR(0)="E"
 W !
 D ^DIR
 Q
 ;
LKUPHDR(APPLYTO) ;
 N PARENT,SATELITE
 W @IOF
 S PAGE=$G(PAGE)+1
 S X="VIEWING TRANSACTIONS ASSOCIATED WITH 'APPLY TO'"
 S X=$J("",IOM-$L(X)\2-$X)_X
 W !,X
 W ?70,"PAGE ",PAGE
 W !
 W $$CJ^XLFSTR("FIELD OF "_APPLYTO,IOM)
 S PARENT=$E(APPLYTO,1,6)
 S SATELITE=$E(APPLYTO,7,12)
 K DIC,DIR,DIE,DA,DR
 S DIC="^AUTTLOC("
 S D="CTOO"
 S DIC(0)=""
 S X=PARENT
 D IX^DIC
 I Y<0 D
 .S D="C"
 .S DIC(0)=""
 .S X=PARENT
 .D IX^DIC
 I Y<0 S PARENTNM="CAN'T BE FOUND"
 E  S PARENTNM=$$GET1^DIQ(9999999.06,+Y_",",.01,"E")
 K DIC,DIR,DIE,DA,DR
 S DIC="^AUTTLOC("
 S D="CTOO"
 S DIC(0)=""
 S X=SATELITE
 D IX^DIC
 I Y<0 D
 .S D="C"
 .S DIC(0)=""
 .S X=SATELITE
 .D IX^DIC
 I Y<0 S SATNAME="CAN'T BE FOUND"
 E  S SATNAME=$$GET1^DIQ(9999999.06,+Y_",",.01,"E")
 K DIC,DIR,DIE,DA,DR
 W $$CJ^XLFSTR("PARENT:   "_PARENTNM,IOM)
 W $$CJ^XLFSTR("SATELLITE: "_SATNAME,IOM)
 Q
 ;
TRDETAIL ;
 W !!?3,"A/R BILL"
 W ?18,"TRAN. DATE"
 W ?50,"SESSION ID"
 W ?65,"SENT BY"
 W !?10,"ENTRY BY"
 W ?35,"CREDIT"
 W ?45,"DEBIT"
 W ?52,"TRANTYPE"
 W ?70,"ADJCAT"
 W !,LINE
 Q
 ;
ERRHDR ;EP - ERROR SCREEN HEADER
 W @IOF
 W !!,$$CJ^XLFSTR("TRANSACTION LOOKUP BY 'APPLY TO' FIELD",IOM)
 W !
 Q
 ;
TRANSHDR ;EP - TRANSMISSION HEADER
 W @IOF
 W !?15,"SESSION TRANSMISSION DATE: ",EXTRANS
 Q