01
About this dashboard
Four tiles give revenue and net income this year, cash in bank, and the number of journal entries waiting for approval. Below them are revenue this year against last year by month, cash by bank account, net income by month, and the full income statement. The statement is a Statement widget with sections, subtotals, a Total column, and lines for cost of sales and expenses as a percentage of income.
The Month filter starts at the last 12 months and applies to the statement and the net income chart. The tiles and the year-on-year chart keep their own periods. Amounts are in base currency from the primary accounting book.
02
What it carries
The dashboard reads 5 reports. They travel in the same file, so the import creates them first.
- ReportProfit and loss summary by monthRevenue, cost of sales, gross profit, operating expenses and net income per month, with margins.
- ReportCash position by bank accountThe ledger balance of each bank account today, with money in and out over the last 30 days.
- ReportJournal entries pending approvalJournal entries waiting for approval, with who created them, the period and the amount.
- ReportIncome statement by monthIncome and expense accounts by posting period for two years, laid out for the Statement widget with sections and net income.
- ReportGeneral ledger postingsEvery posted general ledger line of the last two years, with account, document, name and memo.
03
Sample preview
Fictional figures in the shape you will see. Yours come from your account.
| Widget | Kind | Reads |
|---|---|---|
| Revenue, this year | stat | Profit and loss summary by month |
| Net income, this year | stat | Profit and loss summary by month |
| Cash in bank | stat | Cash position by bank account |
| Journals awaiting approval | stat | Journal entries pending approval |
| Revenue, this year against last year | compare | Profit and loss summary by month |
| Cash by bank account | hbar | Cash position by bank account |
| Net income by month | line | Profit and loss summary by month |
| Income statement | statement | Income statement by month |
04
The SuiteQL
This is the query each report runs. Read it, copy it, or change it after import.
SELECT period,
revenue,
cost_of_sales,
revenue - cost_of_sales AS gross_profit,
operating_expenses,
other_net,
revenue - cost_of_sales - operating_expenses + other_net AS net_income,
(revenue - cost_of_sales) / NULLIF(revenue, 0) AS gross_margin,
(revenue - cost_of_sales - operating_expenses + other_net) / NULLIF(revenue, 0) AS net_margin
FROM (SELECT TO_CHAR(p.startdate, 'YYYY-MM') AS period,
SUM(CASE WHEN a.accttype = 'Income' THEN -tal.amount ELSE 0 END) AS revenue,
SUM(CASE WHEN a.accttype = 'COGS' THEN tal.amount ELSE 0 END) AS cost_of_sales,
SUM(CASE WHEN a.accttype = 'Expense' THEN tal.amount ELSE 0 END) AS operating_expenses,
SUM(CASE WHEN a.accttype IN ('OthIncome', 'OthExpense') THEN -tal.amount ELSE 0 END) AS other_net
FROM transactionaccountingline tal
JOIN accountingbook ab ON ab.id = tal.accountingbook AND ab.isprimary = 'T'
JOIN transaction t ON t.id = tal.transaction
JOIN account a ON a.id = tal.account
JOIN accountingperiod p ON p.id = t.postingperiod
WHERE tal.posting = 'T'
AND a.accttype IN ('Income', 'COGS', 'Expense', 'OthIncome', 'OthExpense')
AND p.startdate >= ADD_MONTHS(TRUNC(SYSDATE, 'MM'), -23)
AND p.startdate <= SYSDATE
GROUP BY TO_CHAR(p.startdate, 'YYYY-MM'))
ORDER BY periodSELECT a.id AS account__id,
a.displaynamewithhierarchy AS account,
SUM(tal.amount) AS balance,
SUM(CASE WHEN t.trandate > TRUNC(SYSDATE) - 30 AND tal.amount > 0 THEN tal.amount ELSE 0 END) AS inflow_30,
SUM(CASE WHEN t.trandate > TRUNC(SYSDATE) - 30 AND tal.amount < 0 THEN -tal.amount ELSE 0 END) AS outflow_30,
SUM(CASE WHEN t.trandate > TRUNC(SYSDATE) - 30 THEN tal.amount ELSE 0 END) AS net_30,
TO_CHAR(MAX(t.trandate), 'YYYY-MM-DD') AS last_posting
FROM transactionaccountingline tal
JOIN accountingbook ab ON ab.id = tal.accountingbook AND ab.isprimary = 'T'
JOIN transaction t ON t.id = tal.transaction
JOIN account a ON a.id = tal.account
WHERE tal.posting = 'T'
AND a.accttype = 'Bank'
AND t.trandate <= SYSDATE
GROUP BY a.id, a.displaynamewithhierarchy
ORDER BY balance DESCSELECT t.id AS journal__id,
t.tranid AS journal,
TO_CHAR(t.trandate, 'YYYY-MM-DD') AS tran_date,
BUILTIN.DF(t.postingperiod) AS posting_period,
BUILTIN.DF(t.createdby) AS created_by,
t.memo AS memo,
TRUNC(SYSDATE) - TRUNC(t.createddate) AS days_waiting,
BUILTIN.DF(t.currency) AS currency,
d.total_debits
FROM transaction t
JOIN (SELECT tl.transaction, SUM(NVL(tl.debitforeignamount, 0)) AS total_debits
FROM transactionline tl
JOIN transaction j ON j.id = tl.transaction
WHERE j.type = 'Journal'
AND j.status IN ('Journal:A', 'A')
GROUP BY tl.transaction) d ON d.transaction = t.id
ORDER BY t.createddateSELECT TO_CHAR(p.startdate, 'YYYY-MM') AS period,
CASE a.accttype WHEN 'Income' THEN 'Income' WHEN 'COGS' THEN 'Cost of Sales' WHEN 'Expense' THEN 'Expense'
WHEN 'OthIncome' THEN 'Other Income' ELSE 'Other Expense' END AS section,
CASE a.accttype WHEN 'Income' THEN 1 WHEN 'COGS' THEN 2 WHEN 'Expense' THEN 3 WHEN 'OthIncome' THEN 4 ELSE 5 END AS section_order,
a.acctnumber AS account_number,
a.displaynamewithhierarchy AS account,
SUM(-tal.amount) AS amount
FROM transactionaccountingline tal
JOIN accountingbook ab ON ab.id = tal.accountingbook AND ab.isprimary = 'T'
JOIN transaction t ON t.id = tal.transaction
JOIN account a ON a.id = tal.account
JOIN accountingperiod p ON p.id = t.postingperiod
WHERE tal.posting = 'T'
AND a.accttype IN ('Income', 'COGS', 'Expense', 'OthIncome', 'OthExpense')
AND p.startdate >= ADD_MONTHS(TRUNC(SYSDATE, 'MM'), -23)
AND p.startdate <= SYSDATE
GROUP BY TO_CHAR(p.startdate, 'YYYY-MM'), a.accttype, a.acctnumber, a.displaynamewithhierarchy
ORDER BY period, section_order, account_number, accountSELECT TO_CHAR(p.startdate, 'YYYY-MM') AS period,
TO_CHAR(t.trandate, 'YYYY-MM-DD') AS tran_date,
BUILTIN.DF(t.type) AS type,
NVL(t.tranid, t.transactionnumber) AS document,
a.displaynamewithhierarchy AS account,
BUILTIN.DF(a.accttype) AS account_type,
NVL(e.altname, e.entityid) AS name,
tl.memo AS memo,
tal.debit AS debit,
tal.credit AS credit,
-tal.amount AS amount
FROM transactionaccountingline tal
JOIN accountingbook ab ON ab.id = tal.accountingbook AND ab.isprimary = 'T'
JOIN transaction t ON t.id = tal.transaction
JOIN account a ON a.id = tal.account
JOIN accountingperiod p ON p.id = t.postingperiod
JOIN transactionline tl ON tl.transaction = tal.transaction AND tl.id = tal.transactionline
LEFT JOIN entity e ON e.id = t.entity
WHERE tal.posting = 'T'
AND tal.amount <> 0
AND p.startdate >= ADD_MONTHS(TRUNC(SYSDATE, 'MM'), -23)
ORDER BY t.trandate DESC, document