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
68
69
70
71
72
var override_queryfields = [
{
name: 'tax_type_rate',
queryexpression: "t1.tax_type_rate=${@tax_type_rate}"
},
{
name: 'accounting_date_from',
queryexpression: "t1.accounting_date>=trunc(to_date(${@accounting_date_from},'yyyy-mm-dd'))"
},
{
name: 'accounting_date_to',
queryexpression: "trunc(t1.accounting_date) <= to_date(${@accounting_date_to},'yyyy-mm-dd')"
},
{
name: 'invoice_date_from',
queryexpression: "t1.invoice_date between to_date(${@invoice_date_from},'yyyy-mm-dd') and nvl(to_date(${@invoice_date_to},'yyyy-mm-dd'),t1.invoice_date)"
},
{
name: 'invoice_date_to',
queryexpression: "t1.invoice_date between nvl(to_date(${@invoice_date_from},'yyyy-mm-dd'),t1.invoice_date) and to_date(${@invoice_date_to},'yyyy-mm-dd')"
},
{
name: 'invoice_number_from',
queryexpression: "t1.invoice_number >= ${@invoice_number_from} "
},
{
name: 'invoice_number_to',
queryexpression: "t1.invoice_number <= ${@invoice_number_to} "
},
{
name: 'contract_number_from',
queryexpression: "t1.contract_number >= ${@contract_number_from} "
},
{
name: 'contract_number_to',
queryexpression: "t1.contract_number <= ${@contract_number_to} "
}
];
var add_datafilters = [
{
name:'authority_flag',
expression : "(exists (SELECT 1\n" +
" FROM hls_bp_master hm,\n" +
" exp_org_unit u,\n" +
" exp_org_position op,\n" +
" exp_employee_assigns ea,\n" +
" sys_user su\n" +
" where hm.unit_id = u.unit_id\n" +
" and u.unit_id = op.unit_id\n" +
" and ea.position_id = op.position_id\n" +
" and ea.employee_id = su.employee_id\n" +
" and hm.bp_id = t1.bp_agent_id\n" +
" and su.user_id = ${/session/@user_id}) or\n" +
" exists(SELECT 1\n" +
" FROM sys_role sr\n" +
" WHERE sr.role_id =${/session/@role_id}\n" +
" and sr.role_code in ('0017', 'HAND')) or exists (select 1\n" +
" from exp_employees ee, exp_employee_types et,sys_user us\n" +
" where ee.employee_id = us.employee_id\n" +
" and ee.employee_type_id = et.employee_type_id\n" +
" and et.employee_type_code = 'STAFF'\n" +
" and us.user_id = ${/session/@user_id}))"
}
];
override();
add_datafilter();