Upload
ranga-reddy
View
347
Download
55
Embed Size (px)
DESCRIPTION
Yardi DB
Citation preview
RE610Advanced 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 Tables•TRANS table ‐ Contains transaction header data
•DETAIL table ‐ Contains transaction line item detail data
•Summary / Reporting Tables•TOTAL (or GLTOTAL) ‐ Contains trial balance data
•GL Detail ‐ Contains DR/CR details per transaction
Transaction Data Schema Outline
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)
Detail Table
• Detail table contains the line item details of transactions
• Charges are unusual in that they are stored in only the Trans table. Other transactions (Receipt, Payable, Payment, Journal) have records in the Detail table.
Transaction Types
Transaction Shorthand iTypeCharge C- 7
Receipt R- 6Payable/Invoice P- 3
Deposit 5Payment K- 2
Journal Entry J- 10Job Cost Adjustment 17
Bank Adjustment 18
Un-posted Transaction 15
Batch Transactions
Batch Transaction iTypePayment Header 9
Payable/Invoice Header 11Receipt Header 12
Journal Entry Header 13Charge Header 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
Charge Batch Header RecordiType = 16
Charge RecordiType = 7
Batch Trans.hMy = Charge Trans.hParent2
TRANS TableCHARGE
Table Relationship - Charge
Charge Queryselect p.scode as property,pe.ucode as Person,tr.hmy ‐ 700000000 as 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.hparent2 ‐1600000000 as batchnum,tr.itype as iTypefrom trans tr inner join property p on tr.hprop = p.hmyinner join person pe on pe.hmy = tr.hpersoninner join chargtyp ct on ct.hmy = tr.hretentionacctinner join acct a on a.hmy = tr.hoffsetacctinner join acct ar on ar.hmy = tr.haccrualacctwhere tr.hmy = 700000000 + 48759
Receipt Form
Table RelationshipCharge - Receipt
Charge Batch Header RecordiType = 16
Charge RecordiType = 7
Batch Trans.hMy = Charge Trans.hParent2
TRANS Table
Receipt Batch Header RecordiType = 12
Receipt RecordiType = 6
Batch Trans.hMy = Receipt Trans.hParent2
TRANS Table
Detail Records
DETAIL Table
Trans.hMy = Detail.hChkorChg Detail.hInvOrRec = Trans.hMy
CHARGE RECEIPT
Receipt Queryselect p.scode as property,pe.ucode as Person,tr.hmy ‐ 600000000 as CTRL_No,d.samount as amount,a.scode as CashAccount,tr.sdateoccurred as DateReceived,tr.upostdate as postmonth,tr.sUserDefined1 as CheckNum,tr.hparent2 ‐1200000000 as batchnum,d.hChkOrChg as Charge,tr.itype as iTypefrom trans tr inner join detail d on tr.hmy = d.hinvorrecinner join property p on d.hprop = p.hmyinner join person pe on pe.hmy = tr.hpersoninner join acct a on a.hmy = tr.hoffsetacctwhere tr.hmy = 600000000 + 25229
Receipt Form – Deposit
Table RelationshipCharge – Receipt - Deposit
Charge Batch Header RecordiType = 16
Charge RecordiType = 7
Trans.hMy = Trans.hParent2
TRANS Table
Receipt Batch Header RecordiType = 12
Receipt RecordiType = 6
Trans.hMy = Trans.hParent2
TRANS Table
Detail Records
DETAIL Table
Trans.hMy = Detail.hChkOrChg Detail.hInvOrRec = Trans.hMy
TRANS Table
Deposit RecordiType = 5
Receipt Trans.hParent1 = Deposit Trans.hMy
ReceiptCharge Deposit
Deposit Queryselect tr.hmy ‐ 500000000 as CTRL_No,tr.stotalamount as amount,tr.sdateoccurred as DepositDate,tr.uref as DepositNum,tr.itype as iTypefrom trans trwhere tr.hmy = 500000000 + 1099
Payable/Invoice Form
Table RelationshipPayable/Invoice
Payable Batch Header RecordiType = 11
Payable RecordiType = 3
TRANS TablePAYABLE/INVOICE
Detail Records
Trans.hMy = Detail.hInvOrRec
Trans.hMy = Trans.hParent2
DETAIL Table
Payable/Invoice Queryselect p.scode as property,pe.ucode as Person,tr.hmy ‐ 300000000 as 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.hparent2 ‐1100000000 as batchnum,tr.itype as iTypefrom trans tr inner join detail d on tr.hmy = d.hinvorrecinner join property p on d.hprop = p.hmyinner join person pe on pe.hmy = tr.hpersoninner join acct a on a.hmy = d.hacctinner join acct ac on ac.hmy = tr.hoffsetacctinner join acct ap on ap.hmy = tr.haccrualacctwhere tr.hmy = 300000000 + 12289
Payment Form
Payable/Invoice - Payment Relationship
Check RecordiType = 2
TRANS TableDETAIL TableCHECK
Detail.hChkOrChg = Trans.hMy
Payable Batch Header RecordiType = 11
Payable RecordiType = 3
TRANS TablePAYABLE/INVOICE
Detail Records
Trans.hMy = Detail.hInvOrRec
Trans.hMy = Trans.hParent2
Check Batch Header RecordiType = 9
Trans.hMy = Trans.hParent2
Payment Queryselect p.scode as property,pe.ucode as Person,b.sCode as Bank,pe.uLastName as PayeeName,tr.hmy ‐ 200000000 as 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 ‐ 300000000 as Payable_Ctrl,tr.itype as iTypefrom trans tr inner join detail d on tr.hmy = d.hchkorchginner join trans trp on d.hinvorrec = trp.hmyinner join property p on d.hprop = p.hmyinner join person pe on pe.hmy = tr.hAccrualAcctinner join acct a on a.hmy = trp.hoffsetacctinner join bank b on b.hmy = tr.hPersonwhere tr.hmy = 200000000 + 5790
Journal Entry Form
Table RelationshipJournal Entry
Journal EntryHeader RecordiType = 13
Journal RecordItype = 10
TRANS TableJOURNAL ENTRY
Detail Records
Trans.hMy = Detail.hInvOrRec
Trans.hMy = Trans.hParent2
DETAIL Table
Journal Entry Queryselect tr.hmy ‐ 1000000000 as CtrlNum,p.scode as Property,isnull(b.BookName, 'Both') as Book,tr.uRef Ref,tr.sOtherDate1 as JEDate,tr.uPostDate as PostMonth,a.scode as Account,d.sAmount as Amount,d.sSegment1 as Seg1from trans tr inner join detail d on tr.hmy = d.hinvOrRecinner join property p on d.hprop = p.hmyleft join books b on b.book = tr.itype2inner join acct a on a.hmy = d.hacctwhere tr.hmy = 1000000000 + 2524order by d.hmy
Prepayments
A Prepayment is a tenant receipt that doesn’t 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 - Queryselect p.scode as property,pe.ucode as Person,tr.hmy ‐ 600000000 as CTRL_No,tr.stotalamount as ReceiptTotal,d.samount as amount,a.scode as CashAccount,tr.upostdate as postmonth,tr.sUserDefined1 as CheckNum,tr.hparent2 ‐1200000000 as batchnum,tr.itype as iType,tr.bOpen as PrepayAvailable,tr.originatePrepay as PrepayReceipt,d.hchkorchg as AssociatedChargefrom trans tr inner join detail d on tr.hmy = d.hinvorrecinner join property p on d.hprop = p.hmyinner join person pe on pe.hmy = tr.hpersoninner join acct a on a.hmy = tr.hoffsetacctwhere tr.hmy = 600000000 + 25229order by d.hmy
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 – Receipts
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 – NSF
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
Bank Transactions
• Checks (2), Deposits (5), and Bank Adjustments (18)• TRANS.hPerson points to BANK.hMy• Unreconciled: bOpen = ‐1 • Reconciled: bOpen = 0• Cleared: BankRec = ‐1• Uncleared: BankRec = 0• sOtherDate1 = Clear date• For Bank Adjustments, hParent1 points to originating transaction (NSF Receipt or Journal to Cash Acct)
Receivable Queries
Use sAmountPaid to calculate balance Notesselect p.ucode Tenant, tr.hmy‐700000000 Ctrl_No,
tr.stotalamount ‐ tr.samountpaid Balancefrom trans tr inner join person p
on tr.hperson = p.hmywhere tr.itype=7 and tr.stotalamount<>tr.samountpaidorder by 1,2
Not date‐sensitiveIgnores prepayments
Use Receipts to offset Charges
select t.scode Tenant,sum(case tr.itypewhen 7 then tr.stotalamountelse ‐tr.stotalamount end) Balancefrom trans tr inner join tenant t
on t.hmyperson = tr.hpersonwhere tr.itype in (6,7)Group by t.scode
Not date‐sensitiveIncludes prepayments
Receivable Queries
Aggregate Detail amounts – Charges Only NotesSelect t.scode Tenant, tr.hmy - 700000000 Ctl_No,
tr.stotalamount - sum(isnull(d.samount,0)) BalanceFrom tenant t
inner join trans tr on t.hmyperson = tr.hpersonleft outer join detail d on d.hchkorchg = tr.hmy
Where tr.itype=7Group by t.scode,tr.stotalamount,tr.hmyHaving tr.stotalamount<>sum(isnull(d.samount,0))
Can be date sensitiveIgnores prepaymentsHandles bill‐to tenants
Aggregate Detail amounts – Full LedgerSelect t.scode Tenant, tr.iType, case tr.itype when 6 then tr.hmy-600000000else tr.hmy-700000000 end Ctl_No,
sum(case tr.iType when 7 then tr.stotalamount else isnull(-d.samount,0) end) BalanceFrom tenant t
inner join trans tr on t.hmyperson = tr.hpersonleft outer join detail d on d.hInvOrRec = tr.hmy
Where tr.itype in (6,7)Group by t.scode,tr.hmy, tr.iType
Can be date sensitiveIncludes prepaymentsHandles bill‐to tenants
Payable QueriesUse sAmountPaid to calculate balance Notes
select v.ucode Vendor, tr.hmy-300000000 Ctrl_No,tr.stotalamount – tr.samountpaid Balancefrom vendor v inner join trans tr on v.hmyperson = tr.hpersonwhere tr.itype=3and tr.stotalamount <> tr.samountpaidorder by 1,2
Not date‐sensitive
Use Checks to offset Invoicesselect v.ucode Vendor,sum(case tr.itypewhen 3 then tr.stotalamountelse -tr.stotalamount end) Balance
from vendor v inner join trans tr on v.hmyperson = (case tr.itypewhen 3 then tr.hperson else tr.haccrualacct end)where tr.itype in (3,2)Group by v.ucode
Not date‐sensitive
Payable QueriesAggregate Detail amounts – Unpaid Invoices NotesSelect 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.hpersonleft outer join detail d on d.hinvorrec = tr.hmy
Where tr.itype=3Group by v.ucode,tr.stotalamount,tr.hmyHaving tr.stotalamount<>sum(case when d.hchkorchg is not
null then d.samount else 0 end)
Can be date‐sensitive
Aggregate Detail amounts – Full LedgerSelect v.ucode Vendor, tr.hmy – tr.iType*100000000 Ctl_No,
sum(case tr.iType when 3 then d.samount else –d.samountend) 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
Can be date‐sensitive
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 TableA/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 TableA/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