var override_queryfields = [
	{
		name:'transaction_date_from',
		queryexpression:"to_char(t1.transaction_date,'yyyy-mm-dd') >= ${@transaction_date_from}"
	},
	{
		name:'transaction_date_to',
		queryexpression:"to_char(t1.transaction_date,'yyyy-mm-dd') <= ${@transaction_date_to}"
	},
	{
		name: 'journal_date_from',
		queryexpression:"to_char(t1.write_off_date,'yyyy-mm-dd') >= ${@journal_date_from}"
	},
	{
		name: 'journal_date_to',
		queryexpression:"to_char(t1.write_off_date,'yyyy-mm-dd') <= ${@journal_date_to}"
	}
];

var add_datafilters = [ {
	name : 'QUERY',
	expression : "exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 WHERE a1.trx_category = 'CONTRACT' and a1.trx_id = t1.contract_id AND trunc(sysdate) between a1.start_date AND nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id AND a1.trx_category = a2.trx_category AND a2.authorized_user_id = ${/session/@user_id} AND trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate)))"
}
];

override();
add_datafilter();