Конструктор отчетов

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (1)

просмотр истории страницы
and is_folder=0
{code}
Тот же отчет, выводящий текущий баланс.
{code:lang=sql}
select '#FILESUM' || ' ' || round(sum((aa.ostatok+aa.debit-aa.credit) / cast((10000000000) as numeric(18,5))), 2)
from abonents as a
right join homes as h on a.home_id=h.id
right join admin_accounts as aa on a.account_id=aa.id
where company=0
and is_folder=0
and parent_id not in ( '244', '2', '4' , '1499')
UNION ALL
select first 1 '#TYPE 7' from users
UNION ALL
select first 1 '#SERVICE 10240' from users
UNION ALL
select a.name || ';' || h.city || ',' || h.street || ',' || h.s_number || ',' || a.A_HOME_NUMBER||';'||a.account_id||';'||round((aa.ostatok+aa.debit-aa.credit) / cast((10000000000) as numeric(18,5)), 2)|| ';;;;'
from abonents as a
right join homes as h on a.home_id=h.id
right join admin_accounts as aa on a.account_id=aa.id
where company=0
and is_folder=0
and parent_id not in ( '244', '2', '4' , '1499')
{code}

h6. Пример 98. Пример шаблона, подходящего для любого отчёта, который выводит первым столбцом порядковый номер записи (Row Number)