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

BARTDO.m

Go to the documentation of this file.
  1. BARTDO ; IHS/SD/LSL - ROUTINE TO PERFORM TRANSACTIONS ; 12/12/2007
  1. ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,5**;JUN 22, 2008
  1. ;;
  1. ;given the da of a transaction, this will pull the data
  1. ;from the transaction and perform the setting of fields
  1. ;in the related files.
  1. ; to reverse an entry pass BARUNDO=1
  1. ;
  1. ; IHS/SD/SDR - 4/18/02 - V1.6 P2 - Update for new trans. type
  1. ; Updated to include new transaction type FLAT RATE ADJUSTMENT.
  1. ; It should be treated the same as BILL NEW.
  1. ;
  1. ; IHS/SD/LSL - 03/04/03 - V1.7 Patch 1 - Remove call to BARPSDAT
  1. ; Routine was deleted as Period Summary Data File no longer exists
  1. ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. TR(BARTRDA,BARUNDO) ; EP
  1. ; Pull the transaction and perform the sets per the type of transaction
  1. S:'$D(BARUNDO) BARUNDO=0
  1. ;
  1. I $D(UFMSESID) D
  1. .S X=$$TRANTRIG^BARUFUT(DUZ,UFMSESID,BARTRDA) ;BAR*1.8*3 UFMS ;IF ERA POSTING FLAG IS SET
  1. ;
  1. ;
  1. K BART
  1. D ENP^XBDIQ1(90050.03,BARTRDA,".01;3.5;4;5;6;10;11;14;15;101;102;103","BART(","I")
  1. S BARTYP=BART(101,"I")
  1. Q:BARTYP=""
  1. K BARX
  1. ;F X=39,40,41,43,49,108,503 S BARX(X)=""
  1. F X=138,139,39,40,41,43,108,503 S BARX(X)="" ;BAR*1.8*5 SRS-80 IHS/SD/TPF 4/15/2008 INCLUDE 'PAYMENT CREDIT'
  1. I '$D(BARX(BARTYP)) Q
  1. S BARAMT=BART(3.5)
  1. S:BARUNDO BARAMT=-BARAMT ; reverse or back out
  1. ;
  1. I BARTYP D @BARTYP ; types as set in the element tables for transactions
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 138 ;BAR*1.8*5 SRS-80 IHS/SD/TPF 4/15/2008 INCLUDE 'CREDIT TO OTHER BILL' - ACT LIKE ADJUST
  1. ; Payment credit (act like adjustment)
  1. D 43
  1. Q
  1. ; ********************************************************************
  1. 139 ;BAR*1.8*5 SRS-80 IHS/SD/TPF 4/15/2008 INCLUDE 'CREDIT FROM OTHER BILL' - ACT LIKE ADJUST
  1. ; Payment credit (act like adjustment)
  1. D 43
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 39 ;
  1. ; Refund (act like adjustment)
  1. D 43
  1. Q
  1. ; ********************************************************************
  1. ;
  1. 40 ;
  1. ; payment to a bill /account
  1. N DIC,DIE,DR,DA,BARBLV
  1. S BARACC=BART(6,"I")
  1. S BARBL=BART(4,"I")
  1. ;update account fields un-posted, current a/r ballance
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.02)
  1. S DA=BARACC
  1. G:'$D(^BARAC(DUZ(2),DA,0)) BILL40
  1. S BARBLV(301)=$$GET1^DIQ(90050.02,DA,301,"I")
  1. S BARBLV(302)=$$GET1^DIQ(90050.02,DA,302,"I")
  1. S DR="301////^S X=BARBLV(301)-BARAMT;302////^S X=BARBLV(302)-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. ; -------------------------------
  1. ;
  1. BILL40 ;
  1. ; update bill amount field
  1. N DIC,DIE,DR,DA,BARBLV
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.01)
  1. S DA=BARBL
  1. S BARBLV(15)=$$GET1^DIQ(90050.01,DA,15)
  1. S DR="15////^S X=BARBLV(15)-BARAMT"
  1. ;
  1. I ;
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. ; -------------------------------
  1. ;
  1. BATCH ;** update batch
  1. ; Replaced by triggers in Collection Batch
  1. ; -------------------------------
  1. ;
  1. BLVL ;** batch level
  1. ; Replaced by triggers in Collection Batch
  1. ; -------------------------------
  1. ;
  1. ILVL ;** batch item level
  1. N DIC,DIE,DR,DA,BARUN
  1. S (DIC,DIE)=$$DIC^XBSFGBL(90051.1101)
  1. K DA
  1. S DA(1)=BART(14,"I")
  1. S DA=BART(15,"I")
  1. S BARUN(18)=$$VALI^XBDIQ1(DIC,.DA,18)
  1. S DR="18////^S X=BARUN(18)+BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. ; -------------------------------
  1. ;
  1. SLVL ;** batch item sub eob level
  1. ; to be coded when sub item is put into transactions
  1. Q
  1. ; *********************************************************************
  1. ;
  1. Q40 ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 41 ;cancellation of a bill/account
  1. N DIC,DIE,DR,DA,BARBLV
  1. ;adjust account field current a/r balance
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.02)
  1. S DA=BART(6,"I")
  1. G:'$D(^BARAC(DUZ(2),DA,0)) BILL41
  1. S BARBLV(301)=$$GET1^DIQ(90050.02,DA,301,"I")
  1. S DR="301////^S X=BARBLV(301)-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. ; -------------------------------
  1. ;
  1. BILL41 ;update bill amount field
  1. N DIE,DR,DA,BARBLV
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.01)
  1. S DA=BART(4,"I")
  1. S BARBLV(15)=$$GET1^DIQ(90050.01,DA,15)
  1. S DR="15////^S X=BARBLV(15)-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. Q41 ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 43 ;adjustment to a bill/account
  1. N DIC,DIE,DR,DA,BARBLV
  1. ;adjust account field current a/r balance
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.02)
  1. S DA=BART(6,"I")
  1. G:'$D(^BARAC(DUZ(2),DA,0)) BILL43
  1. S BARBLV(301)=$$GET1^DIQ(90050.02,DA,301,"I")
  1. S DR="301////^S X=BARBLV(301)-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. ; -------------------------------
  1. ;
  1. BILL43 ;update bill amount field
  1. N DIE,DR,DA,BARBLV
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.01)
  1. S DA=BART(4,"I")
  1. S BARBLV(15)=$$GET1^DIQ(90050.01,DA,15)
  1. S DR="15////^S X=BARBLV(15)-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. Q43 ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 49 ;bill new / account
  1. N DIC,DIE,DA,DR,BARACV
  1. S (DIC,DIE)=$$DIC^XBDIQ1(90050.02)
  1. S DA=BART(6,"I")
  1. Q:'$D(^BARAC(DUZ(2),DA,0))
  1. S BARACV=$$GET1^DIQ(90050.02,DA,301,"I")
  1. S DR="301////^S X=BARACV-BARAMT"
  1. S DIDEL=90050
  1. D ^DIE
  1. K DIDEL
  1. Q49 ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 108 ; 3P credit - edit cr field and then same sequence as an adjustment
  1. N DIE,DA,DR
  1. S DIE=$$DIC^XBDIQ1(90050.01)
  1. S DA=BARBLDA
  1. S DR="20////^S X=BARAMT"
  1. D ^DIE
  1. D 43
  1. Q108 ;
  1. Q
  1. ; *********************************************************************
  1. ;
  1. 503 ; Flat Rate Adjustment
  1. D 49 ;FRA should be treated the same as BILL NEW
  1. Q