-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_form.sql
More file actions
executable file
·67 lines (63 loc) · 1.51 KB
/
Copy pathsearch_form.sql
File metadata and controls
executable file
·67 lines (63 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SELECT
'form' as component,
'GET' as method,
'Submit' as validate,
'search_result.sql' as action
;
/* NOTE: if you add a new parameter, ensure you pass it in the shell include in index.sql for it to be available in search_results.sql */
SELECT
'start' as name,
'date' as type,
'calendar' as prefix_icon,
'From:' as prefix,
'' as label,
ifnull($start, date('now', 'start of month')) as value,
'now' as max,
6 as width
;
SELECT
'end' as name,
'date' as type,
'To:' as prefix,
'' as label,
ifnull($end, date('now')) as value,
'now' as max,
6 as width
;
select
'payee' as name,
'' as label,
'search' as prefix_icon,
'Payee contains:' as prefix,
$payee as value,
12 as width;
WITH c AS (
SELECT distinct(category) as category FROM expense where category <> 'Transfer' order by 1)
SELECT
'category[]' as name, '' as label,
'Categories' as placeholder,
'select' as type,
true as multiple,
true as create_new,
true as searchable, 12 as width,
json_group_array(json_object(
'label', category,
'value', category,
'selected', sel.value is not null
)) as options
FROM c left join json_each($category) as sel
on c.category = sel.value;
select
'exclude' as name,
'Exclude categories' as label,
'checkbox' as type,
$exclude = 1 as checked,
1 as value,
6 as width;
select
'datagrid' as name,
'Show records' as label,
'checkbox' as type,
$datagrid = 1 as checked,
1 as value,
6 as width;