'Submit all salary slips based on selected criteria'

def submit_salary_slips(self):

    self.check_permission(u'write')
    jv_name = u''
    ss_list = self.get_sal_slip_list(ss_status=0)
    submitted_ss = []
    not_submitted_ss = []
    for ss in ss_list:
        ss_obj = frappe.get_doc(u'Salary    Slip', ss[0])
        ss_dict = {}
        ss_dict[u'Employee    Name'] = ss_obj.employee_name
        ss_dict[u'Total    Pay'] = fmt_money(ss_obj.net_pay, currency=frappe.defaults.get_global_default(u'currency'))
        ss_dict[u'Salary    Slip'] = self.format_as_links(ss_obj.name)[0]
        if (ss_obj.net_pay < 0):
            not_submitted_ss.append(ss_dict)
        else:
            try:
                ss_obj.submit()
                submitted_ss.append(ss_dict)
            except frappe.ValidationError:
                not_submitted_ss.append(ss_dict)
    if submitted_ss:
        jv_name = self.make_accural_jv_entry()
    return self.create_submit_log(submitted_ss, not_submitted_ss, jv_name)
