'Returns list of salary slips based on selected criteria'

def get_sal_slip_list(self, ss_status, as_dict=False):

    cond = self.get_filter_condition()
    ss_list = frappe.db.sql((u'\n DCTB  DCTB  DCTB select    t1.name,    t1.salary_structure    from    `tabSalary    Slip`    t1\n DCTB  DCTB  DCTB where    t1.docstatus    =    %s    and    t1.start_date    >=    %s    and    t1.end_date    <=    %s\n DCTB  DCTB  DCTB and    (t1.journal_entry    is    null    or    t1.journal_entry    =    "")    and    ifnull(salary_slip_based_on_timesheet,0)    =    %s    %s\n DCTB  DCTB ' % (u'%s', u'%s', u'%s', u'%s', cond)), (ss_status, self.start_date, self.end_date, self.salary_slip_based_on_timesheet), as_dict=as_dict)
    return ss_list
