var override_queryfields = [
	{
		name: 'contract_number',
		queryexpression: "t1.contract_number = ${@contract_number}"
	},
	{
		name: 'bp_name',
		queryexpression: "t1.bp_name = ${@bp_name}"
	},
	{
		name: 'journal_date',
        queryexpression: "to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"
	},
	{
		name: 'base_period',
		queryexpression: "to_char(t1.journal_date,'yyyymm') = ${@base_period}"
	}
];

var add_datafilters = [{
	name: 'base_period',
	expression: " to_char(t1.journal_date,'yyyymm') = ${@base_period} and (t1.invoice_date is null or to_char(t1.invoice_date,'yyyymm') < ${@base_period})"
}];

override();
add_datafilter();