'Returns the next case no. for a new packing slip for a delivery
note'

def get_recommended_case_no(self):

    recommended_case_no = frappe.db.sql(u'SELECT    MAX(to_case_no)    FROM    `tabPacking    Slip`\n DCTB  DCTB  DCTB WHERE    delivery_note    =    %s    AND    docstatus=1', self.delivery_note)
    return (cint(recommended_case_no[0][0]) + 1)
