You are on page 1of 53

RE610

Advanced Database Schema

This document, presentation and/or video (collectively, document) is protected


by copyright, trademark and other intellectual property laws. Use of this
document is subject to the terms and conditions of an authorized Yardi
Systems, Inc. software license or other agreement including, but not limited to,
restrictions on its use, copying, disclosure, distribution and decompilation. No
part of this document may be disclosed or reproduced in any form by any
means without the prior written authorization of Yardi Systems, Inc. This
document contains proprietary information about software and service
processes, algorithms, and data models which is confidential and constitutes
trade secrets. This document is intended for utilization solely in connection
with Yardi software licensees use of Yardi software and for no other purpose.
Yardi, Yardi Systems, Inc., the Yardi Logo, and the names of Yardi products
and services are trademarks or registered trademarks of Yardi Systems, Inc. in
the United States and may be protected as trademarks in other countries. All
other product, service, or company names mentioned in this document are
claimed as trademarks and trade names by their respective companies.
2014 Yardi Systems, Inc. All Rights Reserved.

Transaction Data Schema Outline


TransactionTables
TRANStable
DETAILtable

Containstransactionheaderdata
Containstransactionlineitemdetaildata

Summary/ReportingTables
TOTAL(orGLTOTAL) Containstrialbalancedata
GLDetail
ContainsDR/CRdetailspertransaction

Trans Table
The TRANS table is the hub of all transactional data in the
system.
The transaction (TRANS) table contains header data for all
transactions and also batch data. The iType field in the
TRANS table is used to identify the type of the record
(Batch Header, Charge, Journal etc.)
iType is set to 15 until AFTER the transaction is posted
(important if you are reviewing un-posted transactions)

DetailTable
Detailtablecontainsthelineitemdetailsof
transactions
Chargesareunusualinthattheyarestoredin
onlytheTranstable.Othertransactions
(Receipt,Payable,Payment,Journal)have
recordsintheDetailtable.

Transaction Types
Transaction

Shorthand

iType

Charge

C-

Receipt

R-

Payable/Invoice

P-

Deposit

Payment

K-

Journal Entry

J-

10

Job Cost Adjustment

17

Bank Adjustment

18

Un-posted Transaction

15

Batch Transactions
Batch Transaction
Payment Header
Payable/Invoice Header
Receipt Header

iType
9
11
12

Journal Entry Header


Charge Header

13
16

Primary / Foreign Keys


Trans Table
Primary Key starts with the iType, then sequential number padded to 8 digits
with 0.
C-

iType = 7

hmy = 7xxxxxxxx (i.e. 700000328)

Ctrl# 328

J-

iType = 10

hmy = 10xxxxxxxx (i.e. 1000004776)

Ctrl# 4776

Detail Table
Primary key is sequential number
Foreign Key(s) hInvOrRec / hChkOrChg point to hmy of Trans table

TRANS Table Selected Columns


hMy Primary Key
hParent1 Pointer to related transaction (i.e. Reversing
Tran, Deposit, Bank Adj)
hParent2 Pointer to Batch Header
hPerson Pointer to Person or Bank record
bOpen Open Transaction
sTotalAmount Total Amount of Transaction
sAmountPaid Amount paid for C- and P- records
uPostDate Post Month

DETAIL Table Selected Columns


hInvOrRec Pointer to Invoice, Receipt, or Journal TRANS
record
hChkOrChg Pointer to Check, Charge or $0 Receipt TRANS
record
sAmount Dollar amount (for Journals, Positive value =
Debit, Negative = Credit)
CashPost Post Month affecting Cash Books
AccrualPost Post Month affecting Accrual Books

Charge Form

Table Relationship - Charge


CHARGE
TRANSTable
ChargeBatch
HeaderRecord
iType =16

BatchTrans.hMy =ChargeTrans.hParent2
ChargeRecord
iType =7

Charge Query
select p.scode as property,
pe.ucode as Person,
tr.hmy 700000000as CTRL_No,
ct.scode as chargecode,
tr.stotalamount as amount,
a.scode as account,
ar.scode as AR_Account,
tr.sdateoccurred as ChargeDate,
tr.upostdate as postmonth,
tr.hparent21600000000as batchnum,
tr.itype as iType
from transtr inner join property pon tr.hprop = p.hmy
inner join personpe on pe.hmy = tr.hperson
inner join chargtyp ct on ct.hmy = tr.hretentionacct
inner join acctaon a.hmy = tr.hoffsetacct
inner join acctar on ar.hmy = tr.haccrualacct
where tr.hmy = 700000000+ 48759

Receipt Form

Table Relationship
Charge - Receipt
CHARGE
TRANSTable

DETAILTable

ChargeBatch
HeaderRecord
iType=16

ReceiptBatch
HeaderRecord
iType=12

BatchTrans.hMy =
ChargeTrans.hParent2

ChargeRecord
iType =7
Trans.hMy =Detail.hChkorChg

RECEIPT
TRANSTable

BatchTrans.hMy =
ReceiptTrans.hParent2

DetailRecords

ReceiptRecord
iType =6
Detail.hInvOrRec=Trans.hMy

Receipt Query
select p.scode as property,
pe.ucode as Person,
tr.hmy 600000000as CTRL_No,
d.samount as amount,
a.scode as CashAccount,
tr.sdateoccurred as DateReceived,
tr.upostdate as postmonth,
tr.sUserDefined1as CheckNum,
tr.hparent21200000000as batchnum,
d.hChkOrChg as Charge,
tr.itype as iType
from transtr inner join detaildon tr.hmy = d.hinvorrec
inner join property pon d.hprop = p.hmy
inner join personpe on pe.hmy = tr.hperson
inner join acctaon a.hmy = tr.hoffsetacct
where tr.hmy = 600000000+ 25229

Receipt Form Deposit

Table Relationship
Charge Receipt - Deposit
Charge
TRANS Table

DETAIL Table

ChargeBatch
HeaderRecord
iType =16

Deposit
TRANS Table

ReceiptBatch
HeaderRecord
iType =12

Trans.hMy = Trans.hParent2

ChargeRecord
iType =7

Receipt
TRANS Table

Trans.hMy = Trans.hParent2

DetailRecords

Trans.hMy = Detail.hChkOrChg

ReceiptRecord
iType =6

Detail.hInvOrRec = Trans.hMy

DepositRecord
iType =5
Receipt Trans.hParent1 =
Deposit Trans.hMy

Deposit Query
select tr.hmy 500000000as CTRL_No,
tr.stotalamount as amount,
tr.sdateoccurred as DepositDate,
tr.uref as DepositNum,
tr.itype as iType
from transtr
where tr.hmy = 500000000+ 1099

Payable/Invoice Form

Table Relationship
Payable/Invoice
PAYABLE/INVOICE
TRANS Table
DETAIL Table
PayableBatch
HeaderRecord
iType =11
Trans.hMy = Trans.hParent2

PayableRecord
iType =3

DetailRecords

Trans.hMy = Detail.hInvOrRec

Payable/Invoice Query
select p.scode as property,
pe.ucode as Person,
tr.hmy 300000000as CTRL_No,
tr.uref as InvoiceNum,
tr.stotalamount as TotalAmount,
d.samount as amount,
a.scode as ExpAccount,
ac.scode as CashAccount,
ap.scode as AP_Account,
tr.sdateoccurred as InvDate,
tr.upostdate as postmonth,
tr.hparent21100000000as batchnum,
tr.itype as iType
from transtr inner join detaildon tr.hmy = d.hinvorrec
inner join property pon d.hprop = p.hmy
inner join personpe on pe.hmy = tr.hperson
inner join acctaon a.hmy = d.hacct
inner join acctacon ac.hmy = tr.hoffsetacct
inner join acctap on ap.hmy = tr.haccrualacct
where tr.hmy = 300000000+ 12289

Payment Form

Payable/Invoice - Payment Relationship


PAYABLE/INVOICE
TRANS Table

DETAIL Table

PayableBatch
HeaderRecord
iType =11

CheckBatch
HeaderRecord
iType =9

Trans.hMy = Trans.hParent2

PayableRecord
iType =3

CHECK
TRANS Table

DetailRecords

Trans.hMy = Detail.hInvOrRec

Trans.hMy = Trans.hParent2

CheckRecord
iType =2
Detail.hChkOrChg = Trans.hMy

Payment Query
select p.scode as property,
pe.ucode as Person,
b.sCode as Bank,
pe.uLastName as PayeeName,
tr.hmy 200000000as CTRL_No,
tr.uref as CheckNum,
tr.stotalamount as TotalAmount,
d.samount as amount,
a.scode as CashAccount,
tr.sdateoccurred as ChkDate,
tr.upostdate as PostMonth,
trp.hmy 300000000as Payable_Ctrl,
tr.itype as iType
from transtr inner join detaildon tr.hmy = d.hchkorchg
inner join transtrp on d.hinvorrec = trp.hmy
inner join property pon d.hprop = p.hmy
inner join person pe on pe.hmy = tr.hAccrualAcct
inner join acctaon a.hmy = trp.hoffsetacct
inner join bankbon b.hmy = tr.hPerson
where tr.hmy = 200000000+ 5790

Journal Entry Form

Table Relationship
Journal Entry
JOURNAL ENTRY
TRANS Table

DETAIL Table

JournalEntry
HeaderRecord
iType =13
Trans.hMy = Trans.hParent2

JournalRecord
Itype =10

DetailRecords

Trans.hMy = Detail.hInvOrRec

Journal Entry Query


select tr.hmy 1000000000as CtrlNum,
p.scode as Property,
isnull(b.BookName, 'Both') as Book,
tr.uRef Ref,
tr.sOtherDate1as JEDate,
tr.uPostDate as PostMonth,
a.scode as Account,
d.sAmount as Amount,
d.sSegment1as Seg1
from transtr inner join detaildon tr.hmy = d.hinvOrRec
inner join property pon d.hprop = p.hmy
left join booksbon b.book = tr.itype2
inner join acctaon a.hmy = d.hacct
where tr.hmy = 1000000000+ 2524
order by d.hmy

Prepayments
A Prepayment is a tenant receipt that doesnt pay a
Charge
For prepayment transactions, detail.hChkOrChg = NULL
Receipt record Trans.bOpen is set to -1 until the prepay is
used
*scode in Detail Notes indicates which Charge Code
prepayment is held

Prepayments
As Prepay amounts are allocated to Charges
A new $0 Receipt Tran is created, with two offsetting Detail items
Trans.sTotalAmount shows zero
For Detail with positive sAmount, hChkOrChg points to the Charge
being paid
For Detail with negative sAmount, hChkOrChg points to the original
Receipt
New Detail records added to original Receipt trans
hInvOrRec points to the original Receipt
hChkOrChg points to the zero-dollar Receipt created above
hChkOrChg is null if amount still unapplied

Prepayment Receipt

Prepayment Receipt - Query


select p.scode as property,
pe.ucode as Person,
tr.hmy 600000000as CTRL_No,
tr.stotalamount as ReceiptTotal,
d.samount as amount,
a.scode as CashAccount,
tr.upostdate as postmonth,
tr.sUserDefined1as CheckNum,
tr.hparent21200000000as batchnum,
tr.itype as iType,
tr.bOpen as PrepayAvailable,
tr.originatePrepay as PrepayReceipt,
d.hchkorchg as AssociatedCharge
from transtr inner join detaildon tr.hmy = d.hinvorrec
inner join property pon d.hprop = p.hmy
inner join personpe on pe.hmy = tr.hperson
inner join acctaon a.hmy = tr.hoffsetacct
where tr.hmy = 600000000+ 25229
order by d.hmy

Reversing Transactions Receipts

Reversing Transactions Receipts

Creates new Trans record with negative amount


Creates new Detail records with negative amounts
Both Trans records show Void = -1
Original Trans shows Voided = -1
Reverser shows Voider = -1
Link between Tran records only shown in sNotes field

Reversing Transactions NSF

Reversing Transactions NSF

Creates new Trans record with negative amount


Creates new Detail records with negative amounts
Both Trans records show Void = 0, Voided = 0, Voider = 0
Both Trans records show NSF = -1
Link between Tran records only shown in sNotes field
hParent1 of NSF Tran points to Bank Adjustment

Reversing Transactions Invoices

Reversing Transactions Invoices

Creates new Trans record with negative amount


Creates new Detail records with negative amounts
Both Trans records show Void = -1
Original Trans shows Voided = -1
Reverser shows Voider = -1
hParent1 of each Tran points to the other

Reversing Transactions
Voided Checks

Reversing Transactions
Voided Checks
Creates new Trans record with negative amount
Creates new Detail records with negative amounts
Creates new Detail records against the Payable with
positive amounts
Both Trans records show Void = -1
Original Trans shows Voided = -1
Reverser shows Voider = -1
hParent1 of each Tran points to the other

BankTransactions

Checks(2),Deposits(5),andBankAdjustments(18)
TRANS.hPerson pointstoBANK.hMy
Unreconciled:bOpen =1
Reconciled:bOpen =0
Cleared:BankRec =1
Uncleared:BankRec =0
sOtherDate1=Cleardate
ForBankAdjustments,hParent1pointstooriginating
transaction(NSFReceiptorJournaltoCashAcct)

ReceivableQueries
UsesAmountPaid tocalculatebalance

Notes

selectp.ucode Tenant,tr.hmy700000000Ctrl_No,
tr.stotalamount tr.samountpaid Balance
fromtranstr innerjoinpersonp
ontr.hperson =p.hmy
wheretr.itype=7andtr.stotalamount<>tr.samountpaid
orderby1,2

Notdatesensitive
Ignoresprepayments

UseReceiptstooffsetCharges
selectt.scode Tenant,
sum(casetr.itype
when7thentr.stotalamount
elsetr.stotalamount end)Balance
from trans trinner join tenantt
ont.hmyperson =tr.hperson
wheretr.itype in(6,7)
Groupbyt.scode

Notdatesensitive
Includesprepayments

ReceivableQueries
AggregateDetailamounts ChargesOnly

Notes

Select t.scode Tenant, tr.hmy - 700000000 Ctl_No,


tr.stotalamount - sum(isnull(d.samount,0)) Balance
From tenant t
inner join trans tr on t.hmyperson = tr.hperson
left outer join detail d on d.hchkorchg = tr.hmy
Where tr.itype=7
Group by t.scode,tr.stotalamount,tr.hmy
Having tr.stotalamount<>sum(isnull(d.samount,0))

Canbedatesensitive
Ignoresprepayments
Handlesbilltotenants

AggregateDetailamounts FullLedger
Select t.scode Tenant, tr.iType, case tr.itype when 6 then
tr.hmy-600000000
else tr.hmy-700000000 end Ctl_No,
sum(case tr.iType when 7 then tr.stotalamount else
isnull(-d.samount,0) end) Balance
From tenant t
inner join trans tr on t.hmyperson = tr.hperson
left outer join detail d on d.hInvOrRec = tr.hmy
Where tr.itype in (6,7)
Group by t.scode,tr.hmy, tr.iType

Canbedatesensitive
Includesprepayments
Handlesbilltotenants

PayableQueries
UsesAmountPaid tocalculatebalance
select v.ucode Vendor, tr.hmy-300000000 Ctrl_No,
tr.stotalamount tr.samountpaid Balance
from vendor v
inner join trans tr on v.hmyperson = tr.hperson
where tr.itype=3
and tr.stotalamount <> tr.samountpaid
order by 1,2

Notes
Notdatesensitive

UseCheckstooffsetInvoices
select v.ucode Vendor,
sum(case tr.itype
when 3 then tr.stotalamount
else -tr.stotalamount end) Balance
from vendor v
inner join trans tr on v.hmyperson = (case tr.itype
when 3 then tr.hperson else tr.haccrualacct end)
where tr.itype in (3,2)
Group by v.ucode

Notdatesensitive

PayableQueries
AggregateDetailamounts UnpaidInvoices

Notes

Select v.ucode Vendor, tr.hmy - 300000000 Ctl_No,


tr.stotalamount - sum(case when d.hchkorchg is not null
then d.samount else 0 end) Balance
From vendor v
inner join trans tr on v.hmyperson = tr.hperson
left outer join detail d on d.hinvorrec = tr.hmy
Where tr.itype=3
Group by v.ucode,tr.stotalamount,tr.hmy
Having tr.stotalamount<>sum(case when d.hchkorchg is not
null then d.samount else 0 end)

Canbedatesensitive

AggregateDetailamounts FullLedger
Select v.ucode Vendor, tr.hmy tr.iType*100000000 Ctl_No,
sum(case tr.iType when 3 then d.samount else d.samount
end) Balance
From vendor v inner join trans tr on v.hmyperson = (case
tr.itype when 3 then tr.hperson else tr.haccrualacct end)
left outer join detail d on (tr.iType = 3 and d.hinvorrec
= tr.hMy) or (tr.iType=2 and d.hChkOrChg=tr.hMy)
Where tr.itype in (2,3 )
Group by v.ucode, tr.stotalamount, tr.hmy, tr.iType

Canbedatesensitive

Total / GLTotal Table


If GL Segments are configured GLTotal table is used
instead of Total table
Total / GLTotal table holds aggregated transaction
information for Financial Statement Reporting
Holds General Ledger account balances and Stores
budget information by Property / Month / Book / Account
(/Segment)
Table is rebuilt through Rebuild Totals function (VWA or
Voyager)
If you make changes to prior period transactions you
must rebuild the TOTAL table.

TOTAL Table Selected Columns


hPpty Pointer to PROPERTY record
uMonth Accounting Period (always the first of the
month)
iBook Pointer to Books (0 Cash, 1 Accrual, 2+
Other Books)
hAcct Pointer to GL Acct
sBegin Beginning Balance
sMTD Activity in this period
sBeginBudget Budget Beginning Balance
sBudget Budget value for this period

GLDETAIL Table
The GLDETAIL table was introduced in Voyager 6.0 to
allow for faster report processing of G/L activity.
When transactions are posted, a GLDETAIL record is
created for each Debit/Credit made to the general ledger.
The GLDETAIL table is indexed to provide optimal
searching efficiency, only holding pertinent information.
While TRANS and DETAIL tables hold raw data, the
GLDETAIL table is the expanded result of the
TRANS/DETAIL tables, showing the posted transactions
impact on the general ledger.

GLDETAIL Table
One TRANS record or one DETAIL record will create
multiple GLDETAIL records depending on
transaction type
Key columns for filtering are hProp, hAcct, iBook,
and dtPost
Key columns for selection are dAmount, sTranNum,
hPerson, sRef, sNotes, dtDate
iBook: 0 is Cash, 1 is Accrual
Other books: only on JE
No iBook of 1000 in GLDetail table

GLDETAIL Table
A/R
Charge (iType=7): 2 records per Trans
Debit Accounts Receivable (iBook=1)
Credit Income Account (iBook=1)

Receipt (iType=6): 4 records per Detail


Credit Accounts Receivable (iBook=1)
Debit Cash (iBook=1)
Credit Income Account (iBook=0)
Debit Cash (iBook=0)

GLDETAIL Table
A/P
Payable (iType=3): 2 records per Detail
Credit Accounts Payable (iBook=1)
Debit Expense Account (iBook=1)

Check (iType=2): 4 records per Detail


Debit Accounts Payable (iBook=1)
Credit Cash (iBook=1)
Debit Expense Account (iBook=0)
Credit Cash (iBook=0)
JE - Journal (iType=10): 1 Record per Detail or 2 if Both
books

TIPS
Use Yardi Data Dictionary
Use the Transaction Table Document
sp_help, sp_helptext and sp_tables
commands
The Object Browser and Object Search in
Query Analyzer
In Query Analyzer F8 key

THANK YOU FOR


ATTENDING

You might also like