Report Example – Quotations This Month

The report opens with the period set to This month, so it always shows the current month’s quotations. You can choose another period above the report. Right-clicking a quotation opens it, or opens the customer. A second version, fixed to the current month, shows the quotations as a chart on the Mobile App Dashboard.

💡This example shows how to create a custom report that lists the quotations for the current month, with their customer, status and totals.

Navigation Example

Main Menu > Setup > Edit Reports

Note

You must be familiar with SQL to create custom reports (see Edit Reports Tutorials).

A custom report reads the database directly. This report lists the quotations of every entity, to every user you give access to it, whatever their access to transactions.

What the Report Shows

Column Description
QuotationThe Transaction Type’s code and the quotation number (e.g. QT 62).
DateThe date of the quotation.
ExpiresThe date the quotation expires.
CustomerThe customer the quotation is for.
ContactThe contact person at the customer.
RepThe rep on the quotation.
ReferenceThe quotation’s reference.
StatusThe quotation’s status (e.g. Pending).
Total (exc)The total excluding VAT, in the local currency. The total of the column appears at the bottom.
VATThe VAT, in the local currency.
Total (inc)The total including VAT, in the local currency.

Before You Start

Find the code of your Quotations Transaction Type: it is in the Code column of the Transaction Types list (e.g. QT; the Setup Example – Quotations uses CUS QT). The SQL below uses QT; replace it with your code.

How to Create the Report

  1. Navigate to Edit Reports.
  2. Click New (button) and fill in the fields as follows:
    1. Description = Enter Quotations.
    2. Code = Enter Quotations.
    3. Chart Type = Leave Column diagram selected.
    4. Note = Enter Lists the quotations for the selected period (this month by default). (optional).
  3. Click Save (button).

How to Add the SQL

  1. Click Actions (button) > Edit SQL.
  2. Paste the SQL below into the editor. Replace QT in the WHERE line with the code of your Quotations Transaction Type.
  3. Click Test (button). A message says “Test passed.” and lists the parameters date_start and date_end. Click OK (button).
  4. Click Save (button).
  5. Close the SQL popup (X in the top corner) and wait a few seconds while the fields are generated.
SELECT
  th.trans_header_id,
  th.contact_id_entity AS customer_id,
  ts.code || ' ' || COALESCE(th.trans_no_text, th.trans_no::varchar) AS quotation_no,
  th.date_trans,
  th.date_expires,
  COALESCE(cus.full_name, cus.nickname) AS customer,
  COALESCE(per.full_name, per.nickname) AS contact,
  COALESCE(rep.full_name, rep.nickname) AS rep,
  th.description AS reference,
  st.code AS status,
  th.total AS total_exc,
  th.vat,
  th.total_vat AS total_inc
FROM trans_headers th
JOIN trans_setup ts ON ts.trans_setup_id = th.trans_setup_id
LEFT JOIN contacts cus ON cus.contact_id = th.contact_id_entity
LEFT JOIN contacts per ON per.contact_id = th.contact_id_person
LEFT JOIN contacts rep ON rep.contact_id = th.contact_id_rep
LEFT JOIN status st ON st.status_id = th.status_id
WHERE ts.code = 'QT'          -- the code of your Quotations Transaction Type
  AND th.deleted_id <> 1      -- leave out deleted quotations
  AND (CAST(:date_start AS date) IS NULL
       OR th.date_trans BETWEEN CAST(:date_start AS date) AND CAST(:date_end AS date))
ORDER BY th.date_trans, th.trans_no

How the SQL Works

Part What it does
FROM trans_headers thReads the transactions (one row per transaction).
JOIN trans_setup tsAdds the Transaction Type, so that ts.code = 'QT' keeps only the quotations.
LEFT JOIN contacts (three times)Adds the names of the customer, the contact person and the rep. LEFT JOIN keeps a quotation that has no contact person or rep.
LEFT JOIN status stAdds the status code.
COALESCE(th.trans_no_text, th.trans_no::varchar)Uses the transaction number as text where one was entered (Transaction Number = Edit (Text)); otherwise the number.
th.deleted_id <> 1Leaves out deleted quotations.
:date_start and :date_end

The report’s Period filter. Edit Reports creates the filter because the SQL uses these two parameters, and the report opens with This month selected.

If you select No Date, both are empty and CAST(:date_start AS date) IS NULL shows every quotation.

trans_header_id and customer_idThe IDs the drilldowns use to open the quotation and the customer. They are hidden on the report.

How to Set Up the Fields

On the Fields tab, click Edit (button) if it is not blue, and edit each field as follows. The Name and Data Type columns are filled in from the SQL and cannot be changed. The captions of hidden fields do not matter.

Field Caption Editor Alignment Summary Visible Decimals
trans_header_idIDNumberLeftNoneUnchecked0
customer_idCustomer IDNumberLeftNoneUnchecked0
quotation_noQuotationTextLeftCountChecked0
date_transDateDateLeftNoneChecked0
date_expiresExpiresDateLeftNoneChecked0
customerCustomerTextLeftNoneChecked0
contactContactTextLeftNoneChecked0
repRepTextLeftNoneChecked0
referenceReferenceTextLeftNoneChecked0
statusStatusTextLeftNoneChecked0
total_excTotal (exc)NumberRightSumChecked2
vatVATNumberRightSumChecked2
total_incTotal (inc)NumberRightSumChecked2
The Fields tab of the Quotations report in Edit Reports, with the caption, editor, alignment, summary, visible, decimals and chart settings of each field
Edit Report: Fields Tab of the Quotations Report

To add a chart, check Chart Category for customer and Chart Series for total_exc (optional). The report’s Chart tab then shows one bar per quotation, labelled with the customer. Click Save (button).

How to Check the Period Filter

  1. Click Filters & Drilldown (tab).
  2. Check that the Filters section has a Period (Date Start and Date End) filter. Edit Reports adds it when it generates the fields, because the SQL uses :date_start and :date_end. Its caption cannot be changed.

How to Add the Drilldowns

  1. On the Filters & Drilldown tab, click Edit (button) if it is not blue.
  2. In the Drilldown section, add a row for the quotation:
    1. Type = Select Module.
    2. Module = Select Transaction.
    3. Fieldname = Select trans_header_id.
    4. Menu Caption = Enter Open Quotation.
  3. Click Save (button).
    • Note: An empty row is added for the next drilldown.
  4. In the new row, add the drilldown for the customer:
    1. Type = Select Module.
    2. Module = Select Contact.
    3. Fieldname = Select customer_id.
    4. Menu Caption = Enter Open Customer.
  5. Click Save (button).
The Filters and Drilldown tab of the Quotations report, with the Period filter and the Open Quotation and Open Customer drilldowns
Edit Report: Filters & Drilldown Tab of the Quotations Report

How to Give Users Access

  1. Click Menu (button) > Edit User Access.
  2. Move the users who may see the report from the Available section to the Selected section.
  3. Click Save (button).

How to View the Report

Note
  • A new report appears in the Custom Reports dropdown list only after you restart QuickEasy BOS.
  • The Data tab lists the quotations, with the number of quotations and the totals at the bottom. The Chart tab shows the chart, if the report has one.
  1. Close QuickEasy BOS and open it again.
  2. Add the report to a Menu Group, on its own or with your other custom reports (see Menu Groups).
  3. Open Custom Reports from the menu and select Quotations in the report filter (if the menu has more than one report).
  4. Check that the period is This month, or select another period.
  5. Click View (button).
  6. Right-click a quotation and select Open Quotation or Open Customer to open it.
The Quotations custom report on the desktop, with the period set to This month and five quotations listed with their totals
Custom Reports: Quotations Report (Data Tab)
The Chart tab of the Quotations report, with one column per quotation labelled with the customer
Custom Reports: Quotations Report (Chart Tab)

How to Show the Report on the Mobile App

The Mobile App Dashboard runs a custom report’s SQL exactly as it is saved. It has no filters or drilldowns, so the SQL cannot use parameters such as :date_start, and it shows each report as a chart. Create a second report for the Mobile App, with the current month fixed in the SQL.

  1. Create a new report as described in How to Create the Report, with Description = Quotations (mobile app) and Code = Quotations (mobile).
  2. Add the SQL below, as described in How to Add the SQL. It is the same SQL with the two date lines replaced, so the report always shows the current month. When you click Test (button), the message “Test passed.” appears.
  3. On the Fields tab, set up the chart:
    1. Chart Category = Check it for quotation_no (one bar per quotation). Exactly one field can be the category.
    2. Chart Series = Check it for total_exc (and total_inc if you want a second bar).
      • Note: The other field settings, including the captions, do not matter, because the Mobile App shows only the chart. The caption of the Chart Series field appears in the chart’s legend (e.g. total_exc, or Total Exc if you change it).
  4. Click Save (button).
    • Note: No Period filter is created, and no drilldowns are needed.
  5. Give the users access to the report (see How to Give Users Access).
  6. For each user who must see the chart, add the report to their Mobile > Dashboard (Select from Custom Reports) user setting: in Users, right-click the user and select View/Edit User Settings, click Edit (button) in the setting’s Value column, and move the report from Available to Selected.
  7. On the Mobile App, open the Dashboard and click Refresh (button).
SELECT
  th.trans_header_id,
  th.contact_id_entity AS customer_id,
  ts.code || ' ' || COALESCE(th.trans_no_text, th.trans_no::varchar) AS quotation_no,
  th.date_trans,
  th.date_expires,
  COALESCE(cus.full_name, cus.nickname) AS customer,
  COALESCE(per.full_name, per.nickname) AS contact,
  COALESCE(rep.full_name, rep.nickname) AS rep,
  th.description AS reference,
  st.code AS status,
  th.total AS total_exc,
  th.vat,
  th.total_vat AS total_inc
FROM trans_headers th
JOIN trans_setup ts ON ts.trans_setup_id = th.trans_setup_id
LEFT JOIN contacts cus ON cus.contact_id = th.contact_id_entity
LEFT JOIN contacts per ON per.contact_id = th.contact_id_person
LEFT JOIN contacts rep ON rep.contact_id = th.contact_id_rep
LEFT JOIN status st ON st.status_id = th.status_id
WHERE ts.code = 'QT'          -- the code of your Quotations Transaction Type
  AND th.deleted_id <> 1      -- leave out deleted quotations
  AND th.date_trans >= date_trunc('month', CURRENT_DATE)::date                      -- from the 1st of this month
  AND th.date_trans < (date_trunc('month', CURRENT_DATE) + INTERVAL '1 month')::date  -- up to the 1st of next month
ORDER BY th.date_trans, th.trans_no
Info

date_trunc('month', CURRENT_DATE) is the 1st of the current month. The report keeps the quotations from that date up to (not including) the 1st of next month, so it moves on to the new month by itself.

The Fields tab of the Quotations (mobile app) report, with quotation_no checked as the chart category and total_exc as the chart series
Edit Report: Fields Tab of the Mobile App Report
The Mobile App Dashboard showing the Quotations (mobile app) chart with one bar per quotation, QT 70 to QT 74
Mobile App Dashboard: Quotations by Quotation Number

In the second example below, customer was selected as the Chart Category instead of quotation_no, and the caption of total_exc was changed to Total Exc.

The Mobile App Dashboard showing the Quotations (mobile app) chart with one bar per customer and a tooltip with the customer’s total
Mobile App Dashboard: Quotations by Customer

Variations

To show Change the SQL
Only the quotations still open (not complete or cancelled)

Add a line to the WHERE clause:

AND st.group_id IN (0, 1) -- Pending and Active status groups

Another Transaction Type (e.g. Sales Orders)Replace 'QT' with that Transaction Type’s code, and change the report’s description and captions.
Several Transaction TypesReplace ts.code = 'QT' with ts.code IN ('QT', 'SO').

Troubleshooting

Problem What to check
The report is not on the Custom Reports dropdown listRestart QuickEasy BOS. A new report appears on the list only after a restart. Also check that you are on the report’s User Access (Menu (button) > Edit User Access).
The Mobile App shows Incomplete chart configuration… or This chart layout supports grouping by a single category only…On the report’s Fields tab, check Chart Category for exactly one field and Chart Series for at least one field.
The chart does not load on the Mobile AppUse the Mobile App version of the SQL. The Mobile App cannot fill in parameters such as :date_start, so the desktop version of the report fails there.
The report is empty
  • The code in ts.code = 'QT' must match your Quotations Transaction Type’s code exactly, including spaces and capitals.
  • Check the period: there might be no quotations in the selected month. Select No Date to see every quotation.
No SQL Statement ProvidedThe SQL was not saved. Open the report, click Actions (button) > Edit SQL, paste the SQL and click Save (button).
The Period filter is missingClose and reopen the SQL popup so that the fields and filters are generated again, and check that the SQL still contains :date_start and :date_end.
Open Quotation does nothingThe drilldown’s Fieldname must be trans_header_id and its Module must be Transaction.

Report an issue with this page

For more useful feedback, select the text on the page you are reporting on, then click Feedback again — or continue without selecting anything.